]> git.eshelyaron.com Git - emacs.git/commitdiff
(Freplace_match): Handle case of `\N' in the
authorGerd Moellmann <gerd@gnu.org>
Fri, 12 May 2000 09:21:59 +0000 (09:21 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 12 May 2000 09:21:59 +0000 (09:21 +0000)
replacement when there's no group N.

src/search.c

index 34dcc7e78a2de301941616044e11bafdaddb649a..b80c1411cf66fe51565c933129af659df4d5c3dc 100644 (file)
@@ -2454,8 +2454,8 @@ since only regular expressions have distinguished subexpressions.")
       for (pos_byte = 0, pos = 0; pos_byte < length;)
        {
          unsigned char str[MAX_MULTIBYTE_LENGTH];
-         unsigned char *add_stuff;
-         int add_len;
+         unsigned char *add_stuff = NULL;
+         int add_len = 0;
          int idx = -1;
 
          if (str_multibyte)
@@ -2535,8 +2535,11 @@ since only regular expressions have distinguished subexpressions.")
            }
 
          /* Now add to the end of SUBSTED.  */
-         bcopy (add_stuff, substed + substed_len, add_len);
-         substed_len += add_len;
+         if (add_stuff)
+           {
+             bcopy (add_stuff, substed + substed_len, add_len);
+             substed_len += add_len;
+           }
        }
 
       /* Now insert what we accumulated.  */