From 2790fd68bb4783b194a6bfdf3a83b70bff3261b5 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Mon, 25 Sep 2023 08:08:30 +0100 Subject: [PATCH] Make the special "noglob" variable work. To preserve previous behaviour change the default value from true to undefined (meaning false). Also fix a misleading comment in glob.c. --- src/frontend/cpitf.c | 1 - src/frontend/parser/glob.c | 6 +++--- src/frontend/variable.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/frontend/cpitf.c b/src/frontend/cpitf.c index 484b2ff49..ec92c981c 100644 --- a/src/frontend/cpitf.c +++ b/src/frontend/cpitf.c @@ -180,7 +180,6 @@ ft_cpinit(void) } cp_vset("prompt", CP_STRING, buf); - cp_vset("noglob", CP_BOOL, &t); cp_vset("brief", CP_BOOL, &t); /* Make vectors from values in predefs[] for the current plot. diff --git a/src/frontend/parser/glob.c b/src/frontend/parser/glob.c index caefafe48..2a1566cc3 100644 --- a/src/frontend/parser/glob.c +++ b/src/frontend/parser/glob.c @@ -79,11 +79,11 @@ static inline void strip_1st_char(wordlist *wl_node); static void tilde_expand_word(wordlist *wl_node); -/* For each word, go through two steps: expand the {}'s, and then do ?*[] - * globbing in them. Sort after the second phase but not the first... +/* For each word, go through two steps: expand the {}'s, and then do + * tilde-expansion in them (not available of Windows). * * Globbing of arbitrary levels of brace nesting and tilde expansion to the - * name of a "HOME" directory are supported. ?*[] are not */ + * name of a "HOME" directory are supported. File globbing (?*[]) is not */ wordlist *cp_doglob(wordlist *wlist) { if (cp_noglob) diff --git a/src/frontend/variable.c b/src/frontend/variable.c index ef28cffed..f4302e52c 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -19,7 +19,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "variable.h" -bool cp_noglob = TRUE; +bool cp_noglob = FALSE; bool cp_nonomatch = FALSE; bool cp_noclobber = FALSE; bool cp_ignoreeof = FALSE;