On Wed, 2010-12-01 at 10:35 -0700, Eric Blake wrote:
> On 11/30/2010 01:27 PM, Alan Hourihane wrote:
> > Hi all,
> >
> > With grep 2.7 I got this build error....
> >
> > CC dfa.o
> > dfa.c: In function 'prepare_wc_buf':
> > dfa.c:3135:3: error: 'buf_begin' undeclared (first use in this function)
> > dfa.c:3135:3: note: each undeclared identifier is reported only once for
> > each function it appears in
> > dfa.c:3143:23: error: 'inputwcs' undeclared (first use in this function)
> > dfa.c:3143:70: error: 'mbs' undeclared (first use in this function)
> > dfa.c:3151:15: error: 'mblen_buf' undeclared (first use in this
> > function)
> > dfa.c:3169:3: error: 'buf_end' undeclared (first use in this function)
> > make[2]: *** [dfa.o] Error 1
> >
> > It turns out that the function prepare_wc_buf should also be wrapped in
> > MBS_SUPPORT checking.
> >
> > Patch attached.
>
> Thanks for taking the time to provide a patch. However, ed-script
> patches are practically worthless; could you instead provide a context
> diff (either diff -u or diff -c)?
Hi Eric,
Ooops, sorry about that. I do usually generate unified diffs. Here it is
again with -u.
Alan.
--- src/dfa.c.old 2010-12-01 19:06:49.000000000 +0000
+++ src/dfa.c 2010-12-01 19:07:10.000000000 +0000
@@ -3122,8 +3122,6 @@
return s1;
}
-#endif /* MBS_SUPPORT */
-
/* Initialize mblen_buf and inputwcs with data from the next line. */
static void
@@ -3171,6 +3169,8 @@
inputwcs[i] = 0; /* sentinel */
}
+#endif /* MBS_SUPPORT */
+
/* Search through a buffer looking for a match to the given struct dfa.
Find the first occurrence of a string matching the regexp in the
buffer, and the shortest possible version thereof. Return a pointer to