public
Last active

Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s

  • Download Gist
path_helper.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12
Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s.
--- path_helper_bak 2009-05-07 15:54:37.000000000 +0200
+++ path_helper 2009-06-04 10:51:39.000000000 +0200
@@ -15,7 +15,7 @@
for f in "$DIR" "$DIR".d/* ; do
if [ -f "$f" ]; then
for p in $(< "$f") ; do
- [[ "$NEWPATH" = *(*:)${p}*(:*) ]] && continue
+ egrep -q "(^|${SEP})${p}($|${SEP})" <<<"$NEWPATH" && continue
[ ! -z "$NEWPATH" ] && SEP=":"
NEWPATH="${NEWPATH}${SEP}${p}"
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.