# HG changeset patch # User Karl Heuer # Date 802660211 0 # Node ID a1c38b9b0f736b3d7dd827cd72572eafca5d2b0a # Parent 9200a0e153d3069d70b7fed6c9aa149196167cdf (Freplace_match): Do the right thing with backslash. diff -r 9200a0e153d3 -r a1c38b9b0f73 src/search.c --- a/src/search.c Fri Jun 09 01:07:18 1995 +0000 +++ b/src/search.c Fri Jun 09 01:10:11 1995 +0000 @@ -1651,6 +1651,7 @@ { int substart = -1; int subend; + int delbackslash = 0; c = XSTRING (newtext)->data[pos]; if (c == '\\') @@ -1669,11 +1670,15 @@ subend = search_regs.end[c - '0']; } } + else if (c == '\\') + delbackslash = 1; } if (substart >= 0) { if (pos - 1 != lastpos + 1) - middle = Fsubstring (newtext, lastpos + 1, pos - 1); + middle = Fsubstring (newtext, + make_number (lastpos + 1), + make_number (pos - 1)); else middle = Qnil; accum = concat3 (accum, middle, @@ -1681,10 +1686,18 @@ make_number (subend))); lastpos = pos; } + else if (delbackslash) + { + middle = Fsubstring (newtext, make_number (lastpos + 1), + make_number (pos)); + accum = concat2 (accum, middle); + lastpos = pos; + } } if (pos != lastpos + 1) - middle = Fsubstring (newtext, lastpos + 1, pos); + middle = Fsubstring (newtext, make_number (lastpos + 1), + make_number (pos)); else middle = Qnil;