summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/sh.glob.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-11-30 21:05:33 +0000
committerache <ache@FreeBSD.org>2000-11-30 21:05:33 +0000
commit5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068 (patch)
treea212ee10b5214f5c4302ff44d44c2542d83cf7b6 /contrib/tcsh/sh.glob.c
parentd7d472004aa5fe13bc67f9aa639952d978d342e9 (diff)
downloadFreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.zip
FreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.tar.gz
Initial import of slightly trimmed tcsh 6.10
Diffstat (limited to 'contrib/tcsh/sh.glob.c')
-rw-r--r--contrib/tcsh/sh.glob.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/tcsh/sh.glob.c b/contrib/tcsh/sh.glob.c
index 9bcd979..0af5825 100644
--- a/contrib/tcsh/sh.glob.c
+++ b/contrib/tcsh/sh.glob.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.glob.c,v 3.44 2000/01/14 22:57:28 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.glob.c,v 3.47 2000/11/11 23:03:37 christos Exp $ */
/*
* sh.glob.c: Regular expression expansion
*/
@@ -36,7 +36,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.glob.c,v 3.44 2000/01/14 22:57:28 christos Exp $")
+RCSID("$Id: sh.glob.c,v 3.47 2000/11/11 23:03:37 christos Exp $")
#include "tc.h"
@@ -452,8 +452,11 @@ globexpand(v)
*/
if ( symlinks == SYM_EXPAND )
for (s = *vl; s; s = *++vl) {
- *vl = dnormalize(s, 1);
- xfree((ptr_t) s);
+ char *path = short2str(s);
+ if (strstr(path, "..") != NULL && access(path, F_OK) == 0) {
+ *vl = dnormalize(s, 1);
+ xfree((ptr_t) s);
+ }
}
vl = nv;
@@ -901,10 +904,10 @@ backeval(cp, literal)
c = (*ip++ & TRIM);
if (c == 0)
break;
-#ifdef WINNT
+#ifdef WINNT_NATIVE
if (c == '\r')
c = ' ';
-#endif /* WINNT */
+#endif /* WINNT_NATIVE */
if (c == '\n') {
/*
* Continue around the loop one more time, so that we can eat
OpenPOWER on IntegriCloud