summaryrefslogtreecommitdiff
path: root/lib/libcompat/regexp/regsub.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-07-24 05:39:13 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-07-24 05:39:13 +0000
commit0dd75bd11ad0521c80a620c4281c705e8a742521 (patch)
tree17d649ee54198f42c142904c8df9a8a70e89902f /lib/libcompat/regexp/regsub.c
parentaa71ea20647db6f1b471021155e549be8ce4dc93 (diff)
Prevent the v8 style regexp library from clashing with the POSIX regex.
Inspired by the changes to BSD/OS (and the bug they caught), but I didn't go and look at the BSD/OS sources.
Diffstat (limited to 'lib/libcompat/regexp/regsub.c')
-rw-r--r--lib/libcompat/regexp/regsub.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libcompat/regexp/regsub.c b/lib/libcompat/regexp/regsub.c
index 690ce269697..9bd32b00f7f 100644
--- a/lib/libcompat/regexp/regsub.c
+++ b/lib/libcompat/regexp/regsub.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: regsub.c,v 1.2 1996/07/24 05:39:12 downsj Exp $ */
+
/*
* regsub
*
@@ -20,7 +22,7 @@
*/
#ifndef lint
-static char *rcsid = "$Id: regsub.c,v 1.1 1995/10/18 08:42:35 deraadt Exp $";
+static char *rcsid = "$OpenBSD: regsub.c,v 1.2 1996/07/24 05:39:12 downsj Exp $";
#endif /* not lint */
#include <regexp.h>
@@ -38,7 +40,7 @@ static char *rcsid = "$Id: regsub.c,v 1.1 1995/10/18 08:42:35 deraadt Exp $";
- regsub - perform substitutions after a regexp match
*/
void
-regsub(prog, source, dest)
+v8_regsub(prog, source, dest)
const regexp *prog;
const char *source;
char *dest;
@@ -50,11 +52,11 @@ char *dest;
register int len;
if (prog == NULL || source == NULL || dest == NULL) {
- regerror("NULL parm to regsub");
+ v8_regerror("NULL parm to regsub");
return;
}
if (UCHARAT(prog->program) != MAGIC) {
- regerror("damaged regexp fed to regsub");
+ v8_regerror("damaged regexp fed to regsub");
return;
}
@@ -76,7 +78,7 @@ char *dest;
(void) strncpy(dst, prog->startp[no], len);
dst += len;
if (len != 0 && *(dst-1) == '\0') { /* strncpy hit NUL. */
- regerror("damaged match string");
+ v8_regerror("damaged match string");
return;
}
}