Module Name: src
Committed By: christos
Date: Sun Mar 25 16:31:23 UTC 2012
Modified Files:
src/lib/libc/gen: fnmatch.c
Log Message:
PR/41558: Stathis Kamperis: Treat a backslash followed by NUL as NUL, instead
of a backslash if FNM_NOESCAPE is not set. According to TOG: a backslash in
a pattern followed by any other character, will match that second character
in the string.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/gen/fnmatch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gen/fnmatch.c
diff -u src/lib/libc/gen/fnmatch.c:1.24 src/lib/libc/gen/fnmatch.c:1.25
--- src/lib/libc/gen/fnmatch.c:1.24 Mon Jan 31 14:10:18 2011
+++ src/lib/libc/gen/fnmatch.c Sun Mar 25 12:31:23 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fnmatch.c,v 1.24 2011/01/31 19:10:18 christos Exp $ */
+/* $NetBSD: fnmatch.c,v 1.25 2012/03/25 16:31:23 christos Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: fnmatch.c,v 1.24 2011/01/31 19:10:18 christos Exp $");
+__RCSID("$NetBSD: fnmatch.c,v 1.25 2012/03/25 16:31:23 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -192,7 +192,7 @@ fnmatchx(const char *pattern, const char
case '\\':
if (!(flags & FNM_NOESCAPE)) {
if ((c = FOLDCASE(*pattern++, flags)) == EOS) {
- c = '\\';
+ c = '\0';
--pattern;
}
}