From: Abhijit Menon-Sen Date: Sat, 29 Aug 2009 07:38:46 +0000 (+0530) Subject: Backslash-escape /s in the target of a generated s/// expression X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72a2bbbfb72321e2cf05f31b10294c5597890005;p=p5sagit%2Fp5-mst-13.2.git Backslash-escape /s in the target of a generated s/// expression Fixes #68840 reported by Guglielmo Bondioni, where a2p incorrectly translated sub(/foo/,"bar/baz") into s/foo/bar/baz/. --- diff --git a/x2p/walk.c b/x2p/walk.c index ef754c5..d3d5f91 100644 --- a/x2p/walk.c +++ b/x2p/walk.c @@ -845,7 +845,7 @@ sub Pick {\n\ for (t = tmp2str->str_ptr, d=tokenbuf; *t; d++,t++) { if (*t == '&') *d++ = '$' + (char)128; - else if (*t == '$') + else if (*t == '$' || *t == '/') *d++ = '\\' + (char)128; *d = *t + 128; }