--- plugins-scripts/subst.in.orig 2014-03-04 21:41:57 UTC +++ plugins-scripts/subst.in @@ -1,7 +1,7 @@ #!/usr/bin/awk function which(c,path) { - cmd = "test -x " c; + cmd = "[ " c " = @libexecdir@ ] || test -x " c; if (system(cmd)==0) { return c; @@ -53,7 +53,7 @@ # FIXME: Prepend executables with a substitution keyword instead. # /^[^#]/ && /(\/.*)?\/(bin|sbin|lib|libexec)\// { - match($0,/(\/.*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/); + match($0,/(\/[^ ]*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/); c=substr($0,RSTART,RLENGTH); sub(c,which(c,path)); } @@ -65,7 +65,7 @@ # Trusted path mechanism (deprecated) /^[ \t]*\$ENV[ \t]*\{[ \t'"]*PATH[ \t"']*\}[ \t]*=/ { - sub(/\=[ \t]*['"][^"']+["']/,"='@with_trusted_path@' # autoconf-derived"); + sub(/\=[ \t]*['"][^"']+["'];/,"='@with_trusted_path@'; # autoconf-derived"); } /^[\t ]*(export[\t ]*)?PATH[\t ]*=['"]+.+["']$/ {