home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / utils / bug / 2007 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.3 KB  |  50 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.utexas.edu!meyering
  3. From: meyering@cs.utexas.edu (Jim Meyering)
  4. Subject: regex-0.11 bug?
  5. Message-ID: <9211070334.AA29926@ai.cs.utexas.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: U of TX at Austin CS Dept
  8. Distribution: gnu
  9. Date: Fri, 6 Nov 1992 15:34:00 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 37
  12.  
  13. Summary: re_search hangs in infinite loop
  14.  
  15. Using regex.[ch] from the 0.11 distribution, the following program
  16. doesn't terminate.  The example is based on one from the tests in
  17. GNU m4.  I've tried this with {sun,sgi} and {gcc-2.3.1,cc} with -g.
  18. The version of regex (rather old) that came with m4-1.0 showed
  19. similar problems with gcc on an SGI.
  20.  
  21. --
  22. Jim Meyering             | Member of the League for Programming Freedom
  23. meyering@cs.utexas.edu   | Contact me or lpf@uunet.uu.net for more info.
  24.  
  25. ----
  26. #include <sys/types.h>
  27. #include "regex.h"
  28. #define REG_EXPR "\\w+"
  29. #define STRING "a"
  30.  
  31. int
  32. main ()
  33. {
  34.   struct re_pattern_buffer pat_buf;
  35.   char *msg;
  36.  
  37.   pat_buf.translate = 0;
  38.   pat_buf.fastmap = 0;
  39.   pat_buf.buffer = 0;
  40.   pat_buf.allocated = 0;
  41.  
  42.   msg = re_compile_pattern (REG_EXPR, strlen (REG_EXPR), &pat_buf);
  43.   if (msg)
  44.     abort ();
  45.  
  46.   re_search (&pat_buf, STRING, strlen (STRING), 0, strlen (STRING), 0);
  47.   exit (0);
  48. }
  49.  
  50.