m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/src/Attic/input.c,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/src/Attic/input.c,v [branch-1_4]
Date: Fri, 18 Aug 2006 16:28:23 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/08/18 16:28:22

Index: src/input.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/input.c,v
retrieving revision 1.1.1.1.2.19
retrieving revision 1.1.1.1.2.20
diff -u -b -r1.1.1.1.2.19 -r1.1.1.1.2.20
--- src/input.c 8 Aug 2006 23:17:44 -0000       1.1.1.1.2.19
+++ src/input.c 18 Aug 2006 16:28:22 -0000      1.1.1.1.2.20
@@ -682,12 +682,12 @@
 
 #ifdef ENABLE_CHANGEWORD
 
-void
+static void
 init_pattern_buffer (struct re_pattern_buffer *buf)
 {
-  buf->translate = 0;
-  buf->fastmap = 0;
-  buf->buffer = 0;
+  buf->translate = NULL;
+  buf->fastmap = NULL;
+  buf->buffer = NULL;
   buf->allocated = 0;
 }
 
@@ -719,7 +719,9 @@
 
   /* If compilation worked, retry using the word_regexp struct.
      Can't rely on struct assigns working, so redo the compilation.  */
+  regfree (&word_regexp);
   msg = re_compile_pattern (regexp, strlen (regexp), &word_regexp);
+  re_set_registers (&word_regexp, &regs, regs.num_regs, regs.start, regs.end);
 
   if (msg != NULL)
     {
@@ -738,8 +740,7 @@
   for (i = 1; i < 256; i++)
     {
       test[0] = i;
-      if (re_search (&word_regexp, test, 1, 0, 0, &regs) >= 0)
-       strcat (word_start, test);
+      word_start[i] = re_search (&word_regexp, test, 1, 0, 0, NULL) >= 0;
     }
 }
 
@@ -826,7 +827,7 @@
 
 #ifdef ENABLE_CHANGEWORD
 
-  else if (!default_word_regexp && strchr (word_start, ch))
+  else if (!default_word_regexp && word_start[ch])
     {
       obstack_1grow (&token_stack, ch);
       while (1)
@@ -960,7 +961,7 @@
 
   if ((default_word_regexp && (isalpha (ch) || ch == '_'))
 #ifdef ENABLE_CHANGEWORD
-      || (! default_word_regexp && strchr (word_start, ch))
+      || (! default_word_regexp && word_start[ch])
 #endif /* ENABLE_CHANGEWORD */
       )
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]