fix for gawk with regex chars in paths

Sub out regex chars in paths before comparing them. Fixes gawk and
doesn't seem to break other awks. Closes #54
This commit is contained in:
rupa committed 2012-07-04 00:27:26 -04:00
1 parent 8272e6ff7f
commit 9162239fbd
1 file changed
+1 -1
+1 -1
View File
@@ -142,7 +142,7 @@ _z() {
if( short == "/" ) return
# escape regex chars in right hand side
#gsub(/[\(\[\|]/, "\\\&", short)
gsub(/[\(\[\|]/, "\\&", short)
# shortest match must be common to each match
for( i in matches ) if( matches[i] && i !~ short ) return