Module Name: src
Committed By: tnozaki
Date: Sun Aug 30 14:57:51 UTC 2009
Modified Files:
src/dist/nvi/regex: regcomp.c
Log Message:
fix bin/41781, the pattern /\$/ doesn't match a dollar sign anymore by default.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/regex/regcomp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/dist/nvi/regex/regcomp.c
diff -u src/dist/nvi/regex/regcomp.c:1.4 src/dist/nvi/regex/regcomp.c:1.5
--- src/dist/nvi/regex/regcomp.c:1.4 Sun Jan 18 03:45:50 2009
+++ src/dist/nvi/regex/regcomp.c Sun Aug 30 14:57:51 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: regcomp.c,v 1.4 2009/01/18 03:45:50 lukem Exp $ */
+/* $NetBSD: regcomp.c,v 1.5 2009/08/30 14:57:51 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -549,12 +549,14 @@
register sopno pos;
register int i;
register sopno subno;
+ int backsl;
pos = HERE(); /* repetion op, if any, covers from here */
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
- if (c == '\\') {
+ backsl = c == '\\';
+ if (backsl) {
(void)REQUIRE(MORE(), REG_EESCAPE);
c = (unsigned char)GETNEXT();
switch (c) {
@@ -651,7 +653,7 @@
(void)REQUIRE(MORE(), REG_EBRACE);
SETERROR(REG_BADBR);
}
- } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */
+ } else if (!backsl && c == (unsigned char)'$') /* $ (but not \$) ends it */
return(1);
return(0);