Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/nvi/regex fix bin/41781, the pattern /\$/ doesn't match...
details: https://anonhg.NetBSD.org/src/rev/f89ce30a7465
branches: trunk
changeset: 747049:f89ce30a7465
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Sun Aug 30 14:57:51 2009 +0000
description:
fix bin/41781, the pattern /\$/ doesn't match a dollar sign anymore by default.
diffstat:
dist/nvi/regex/regcomp.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r b017dda6941d -r f89ce30a7465 dist/nvi/regex/regcomp.c
--- a/dist/nvi/regex/regcomp.c Sun Aug 30 12:36:38 2009 +0000
+++ b/dist/nvi/regex/regcomp.c Sun Aug 30 14:57:51 2009 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index