*** regex.c.orig Fri May 7 14:43:30 1993 --- regex.c Fri May 7 14:44:41 1993 *************** *** 24,30 **** --- 24,32 ---- #pragma alloca #endif + #ifndef _GNU_SOURCE #define _GNU_SOURCE + #endif /* We need this for `regex.h', and perhaps for the Emacs include files. */ #include *************** *** 4679,4685 **** /* Entry points compatible with 4.2 BSD regex library. We don't define them if this is an Emacs or POSIX compilation. */ ! #if !defined (emacs) && !defined (_POSIX_SOURCE) /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; --- 4681,4687 ---- /* Entry points compatible with 4.2 BSD regex library. We don't define them if this is an Emacs or POSIX compilation. */ ! #if (!defined (emacs) && !defined (_POSIX_SOURCE)) || defined(USE_BSD_REGEX) /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; *************** *** 4773,4779 **** { reg_errcode_t ret; ! if (!s) { if (!re_comp_buf.buffer) return "No previous regular expression"; --- 4775,4781 ---- { reg_errcode_t ret; ! if (!s || *s == '\0') { if (!re_comp_buf.buffer) return "No previous regular expression"; *************** *** 4784,4789 **** --- 4786,4792 ---- /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; + preg->used = 0; /* Don't bother to use a fastmap when searching. This simplifies the REG_NEWLINE case: if we used a fastmap, we'd have to put all the