Module Name: src Committed By: snj Date: Thu Sep 10 07:17:31 UTC 2009
Modified Files: src/dist/nvi/regex [netbsd-5]: regcomp.c Log Message: Pull up following revision(s) (requested by tnozaki in ticket #938): dist/nvi/regex/regcomp.c: revision 1.5 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.1.1.2.6.2 -r1.1.1.2.6.3 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.1.1.2.6.2 src/dist/nvi/regex/regcomp.c:1.1.1.2.6.3 --- src/dist/nvi/regex/regcomp.c:1.1.1.2.6.2 Tue Jan 20 03:14:17 2009 +++ src/dist/nvi/regex/regcomp.c Thu Sep 10 07:17:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: regcomp.c,v 1.1.1.2.6.2 2009/01/20 03:14:17 snj Exp $ */ +/* $NetBSD: regcomp.c,v 1.1.1.2.6.3 2009/09/10 07:17:30 snj 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);