another fix to the stupid regex escaping.

This one works in gawk as well as mawk, and let's hope it works in the
other bazillion flavors of awk as well. :/
This commit is contained in:
rupa committed 2012-08-09 14:48:53 -04:00
1 parent 10a7cfee01
commit ae7f1d1660
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