Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen PR/41558: Stathis Kamperis: Treat a backslash f...



details:   https://anonhg.NetBSD.org/src/rev/2eddd37e8ba7
branches:  trunk
changeset: 778423:2eddd37e8ba7
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 25 16:31:23 2012 +0000

description:
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.

diffstat:

 lib/libc/gen/fnmatch.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ee101ab59647 -r 2eddd37e8ba7 lib/libc/gen/fnmatch.c
--- a/lib/libc/gen/fnmatch.c    Sun Mar 25 16:10:13 2012 +0000
+++ b/lib/libc/gen/fnmatch.c    Sun Mar 25 16:31:23 2012 +0000
@@ -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 @@
                case '\\':
                        if (!(flags & FNM_NOESCAPE)) {
                                if ((c = FOLDCASE(*pattern++, flags)) == EOS) {
-                                       c = '\\';
+                                       c = '\0';
                                        --pattern;
                                }
                        }



Home | Main Index | Thread Index | Old Index