Module Name:    src
Committed By:   christos
Date:           Thu Feb 21 18:17:43 UTC 2013

Modified Files:
        src/lib/libc/gen: glob.c

Log Message:
remove code that did special handling for . and .. at the end of the path.
>From mouse@


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/gen/glob.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/glob.c
diff -u src/lib/libc/gen/glob.c:1.33 src/lib/libc/gen/glob.c:1.34
--- src/lib/libc/gen/glob.c:1.33	Thu Dec 27 16:17:47 2012
+++ src/lib/libc/gen/glob.c	Thu Feb 21 13:17:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: glob.c,v 1.33 2012/12/27 21:17:47 christos Exp $	*/
+/*	$NetBSD: glob.c,v 1.34 2013/02/21 18:17:43 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)glob.c	8.3 (Berkeley) 10/13/93";
 #else
-__RCSID("$NetBSD: glob.c,v 1.33 2012/12/27 21:17:47 christos Exp $");
+__RCSID("$NetBSD: glob.c,v 1.34 2013/02/21 18:17:43 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -612,8 +612,6 @@ glob2(Char *pathbuf, Char *pathend, Char
 	const Char *p;
 	Char *q;
 	int anymeta;
-	Char *pend;
-	ptrdiff_t diff;
 
 	_DIAGASSERT(pathbuf != NULL);
 	_DIAGASSERT(pathend != NULL);
@@ -665,26 +663,7 @@ glob2(Char *pathbuf, Char *pathend, Char
 			*q++ = *p++;
 		}
 
-                /*
-		 * No expansion, or path ends in slash-dot shash-dot-dot,
-		 * do next segment.
-		 */
-		if (pglob->gl_flags & GLOB_PERIOD) {
-			for (pend = pathend; pend > pathbuf && pend[-1] == '/';
-			    pend--)
-				continue;
-			diff = pend - pathbuf;
-		} else {
-			/* XXX: GCC */
-			diff = 0;
-			pend = pathend;
-		}
-			
-                if ((!anymeta) ||
-		    ((pglob->gl_flags & GLOB_PERIOD) &&
-		     (diff >= 1 && pend[-1] == DOT) &&
-		     (diff >= 2 && (pend[-2] == SLASH || pend[-2] == DOT)) &&
-		     (diff < 3 || pend[-3] == SLASH))) {
+                if (!anymeta) {
 			pathend = q;
 			pattern = p;
 			while (*pattern == SEP) {

Reply via email to