summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-10-30 05:10:25 +0000
committerJim Meyering <jim@meyering.net>1994-10-30 05:10:25 +0000
commit63367c9b9cd595df2eba5b1cd54d25ba41e9160f (patch)
tree1746a9d486e1493af37ba16c87a889e19c0b33a9
parent41640fd22de6bd90cee0e0ea344296ca8c5efc07 (diff)
downloadgnulib-TEXTUTILS-1_9_1i1.tar.gz
GNU text utilitiesTEXTUTILS-1_9_1i1
-rw-r--r--lib/regex.c6
-rw-r--r--lib/regex.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/regex.c b/lib/regex.c
index c7674a1e9c..33c7ea242c 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -4934,9 +4934,9 @@ re_compile_pattern (pattern, length, bufp)
}
/* Entry points compatible with 4.2 BSD regex library. We don't define
- them if this is an Emacs or POSIX compilation. */
+ them unless specifically requested. */
-#if !defined (emacs) && !defined (_POSIX_SOURCE)
+#ifdef _REGEX_RE_COMP
/* BSD has one and only one pattern buffer. */
static struct re_pattern_buffer re_comp_buf;
@@ -4987,7 +4987,7 @@ re_exec (s)
return
0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
}
-#endif /* not emacs and not _POSIX_SOURCE */
+#endif /* _REGEX_RE_COMP */
/* POSIX.2 functions. Don't define these for Emacs. */
diff --git a/lib/regex.h b/lib/regex.h
index 40f684cb8e..55927f627c 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -460,9 +460,11 @@ extern void re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
+#ifdef _REGEX_RE_COMP
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
+#endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));