Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mtree Encode literal global characters in files. O...



details:   https://anonhg.NetBSD.org/src/rev/b40ad2359201
branches:  trunk
changeset: 781881:b40ad2359201
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 05 01:28:20 2012 +0000

description:
Encode literal global characters in files.  Otherwise the results of
updating a directory using the resulting spec will be surprising.

See http://svnweb.freebsd.org/base/head/usr.sbin/mtree/test/test00.sh
for test cases.
(brooks)

diffstat:

 usr.sbin/mtree/spec.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r bfb0950bd709 -r b40ad2359201 usr.sbin/mtree/spec.c
--- a/usr.sbin/mtree/spec.c     Fri Oct 05 01:27:29 2012 +0000
+++ b/usr.sbin/mtree/spec.c     Fri Oct 05 01:28:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec.c,v 1.82 2012/10/05 01:19:54 christos Exp $       */
+/*     $NetBSD: spec.c,v 1.83 2012/10/05 01:28:20 christos Exp $       */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.82 2012/10/05 01:19:54 christos Exp $");
+__RCSID("$NetBSD: spec.c,v 1.83 2012/10/05 01:28:20 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -415,7 +415,8 @@
 char *
 vispath(const char *path)
 {
-       const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' };
+       const char extra[] = { ' ', '\t', '\n', '\\', '#', '*', '?', '[',
+           '#', '\0' };
        static char pathbuf[4*MAXPATHLEN + 1];
 
        strsvis(pathbuf, path, VIS_CSTYLE, extra);



Home | Main Index | Thread Index | Old Index