aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-05-12 09:21:59 +0000
committerGerd Moellmann2000-05-12 09:21:59 +0000
commitf8ce8a0de2f1793419fa3d342bf82174ae3a1aa5 (patch)
tree2bef202818785f75f68345baa981b86f451600f0
parentbe0505fe514dfc7ec023c631637ca6d67021c8ea (diff)
downloademacs-f8ce8a0de2f1793419fa3d342bf82174ae3a1aa5.tar.gz
emacs-f8ce8a0de2f1793419fa3d342bf82174ae3a1aa5.zip
(Freplace_match): Handle case of `\N' in the
replacement when there's no group N.
-rw-r--r--src/search.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/search.c b/src/search.c
index 34dcc7e78a2..b80c1411cf6 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2454,8 +2454,8 @@ since only regular expressions have distinguished subexpressions.")
2454 for (pos_byte = 0, pos = 0; pos_byte < length;) 2454 for (pos_byte = 0, pos = 0; pos_byte < length;)
2455 { 2455 {
2456 unsigned char str[MAX_MULTIBYTE_LENGTH]; 2456 unsigned char str[MAX_MULTIBYTE_LENGTH];
2457 unsigned char *add_stuff; 2457 unsigned char *add_stuff = NULL;
2458 int add_len; 2458 int add_len = 0;
2459 int idx = -1; 2459 int idx = -1;
2460 2460
2461 if (str_multibyte) 2461 if (str_multibyte)
@@ -2535,8 +2535,11 @@ since only regular expressions have distinguished subexpressions.")
2535 } 2535 }
2536 2536
2537 /* Now add to the end of SUBSTED. */ 2537 /* Now add to the end of SUBSTED. */
2538 bcopy (add_stuff, substed + substed_len, add_len); 2538 if (add_stuff)
2539 substed_len += add_len; 2539 {
2540 bcopy (add_stuff, substed + substed_len, add_len);
2541 substed_len += add_len;
2542 }
2540 } 2543 }
2541 2544
2542 /* Now insert what we accumulated. */ 2545 /* Now insert what we accumulated. */