From f5bd9f5624e579612e25b983108ad41d29804b3c Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 1 Jul 1994 20:39:21 +0000 Subject: [PATCH] save state of `gflag' across calls to backeval(), allowing globbing to continue after backquote expansion. (fix for bug #309) --- bin/csh/glob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/csh/glob.c b/bin/csh/glob.c index c19bc76f3eb6..0b185ac530e2 100644 --- a/bin/csh/glob.c +++ b/bin/csh/glob.c @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)glob.c 5.21 (Berkeley) 6/25/91";*/ -static char rcsid[] = "$Id: glob.c,v 1.6 1994/02/07 23:55:37 cgd Exp $"; +static char rcsid[] = "$Id: glob.c,v 1.7 1994/07/01 20:39:21 pk Exp $"; #endif /* not lint */ #include @@ -480,7 +480,7 @@ globall(v) else vl = vo = saveblk(v); - if (!noglob && (gflag & G_GLOB)) { + if (!noglob && (gflag & G_GLOB) && *vl) { vl = libglob(vo); if (gflag & G_CSH) blkfree(vo); @@ -552,6 +552,7 @@ dobackp(cp, literal) { register Char *lp, *rp; Char *ep, word[MAXPATHLEN]; + short ogflag = gflag; if (pargv) { abort(); @@ -568,6 +569,7 @@ dobackp(cp, literal) if (*lp == 0) { if (pargcp != pargs) pword(); + gflag = ogflag; return (pargv); } psave(*lp);