home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.utils.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.utexas.edu!meyering
- From: meyering@cs.utexas.edu (Jim Meyering)
- Subject: regex-0.11 bug?
- Message-ID: <9211070334.AA29926@ai.cs.utexas.edu>
- Sender: gnulists@ai.mit.edu
- Organization: U of TX at Austin CS Dept
- Distribution: gnu
- Date: Fri, 6 Nov 1992 15:34:00 GMT
- Approved: bug-gnu-utils@prep.ai.mit.edu
- Lines: 37
-
- Summary: re_search hangs in infinite loop
-
- Using regex.[ch] from the 0.11 distribution, the following program
- doesn't terminate. The example is based on one from the tests in
- GNU m4. I've tried this with {sun,sgi} and {gcc-2.3.1,cc} with -g.
- The version of regex (rather old) that came with m4-1.0 showed
- similar problems with gcc on an SGI.
-
- --
- Jim Meyering | Member of the League for Programming Freedom
- meyering@cs.utexas.edu | Contact me or lpf@uunet.uu.net for more info.
-
- ----
- #include <sys/types.h>
- #include "regex.h"
- #define REG_EXPR "\\w+"
- #define STRING "a"
-
- int
- main ()
- {
- struct re_pattern_buffer pat_buf;
- char *msg;
-
- pat_buf.translate = 0;
- pat_buf.fastmap = 0;
- pat_buf.buffer = 0;
- pat_buf.allocated = 0;
-
- msg = re_compile_pattern (REG_EXPR, strlen (REG_EXPR), &pat_buf);
- if (msg)
- abort ();
-
- re_search (&pat_buf, STRING, strlen (STRING), 0, strlen (STRING), 0);
- exit (0);
- }
-
-