Lines 125-131
do { \
Link Here
|
125 |
} while (0) |
125 |
} while (0) |
126 |
|
126 |
|
127 |
#if defined (EXTENDED_GLOB) |
127 |
#if defined (EXTENDED_GLOB) |
128 |
extern int extended_glob; |
128 |
extern int extended_glob, extglob_flag; |
129 |
#endif |
129 |
#endif |
130 |
|
130 |
|
131 |
#if defined (TRANSLATABLE_STRINGS) |
131 |
#if defined (TRANSLATABLE_STRINGS) |
Lines 312-319
static int token_before_that;
Link Here
|
312 |
/* The token read prior to token_before_that. */ |
312 |
/* The token read prior to token_before_that. */ |
313 |
static int two_tokens_ago; |
313 |
static int two_tokens_ago; |
314 |
|
314 |
|
315 |
static int global_extglob; |
|
|
316 |
|
317 |
/* The line number in a script where the word in a `case WORD', `select WORD' |
315 |
/* The line number in a script where the word in a `case WORD', `select WORD' |
318 |
or `for WORD' begins. This is a nested command maximum, since the array |
316 |
or `for WORD' begins. This is a nested command maximum, since the array |
319 |
index is decremented after a case, select, or for command is parsed. */ |
317 |
index is decremented after a case, select, or for command is parsed. */ |
Lines 3304-3310
reset_parser ()
Link Here
|
3304 |
#if defined (EXTENDED_GLOB) |
3302 |
#if defined (EXTENDED_GLOB) |
3305 |
/* Reset to global value of extended glob */ |
3303 |
/* Reset to global value of extended glob */ |
3306 |
if (parser_state & (PST_EXTPAT|PST_CMDSUBST)) |
3304 |
if (parser_state & (PST_EXTPAT|PST_CMDSUBST)) |
3307 |
extended_glob = global_extglob; |
3305 |
extended_glob = extglob_flag; |
3308 |
#endif |
3306 |
#endif |
3309 |
|
3307 |
|
3310 |
parser_state = 0; |
3308 |
parser_state = 0; |
Lines 4118-4127
parse_comsub (qc, open, close, lenp, flags)
Link Here
|
4118 |
expand_aliases = posixly_correct != 0; |
4116 |
expand_aliases = posixly_correct != 0; |
4119 |
#if defined (EXTENDED_GLOB) |
4117 |
#if defined (EXTENDED_GLOB) |
4120 |
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a |
4118 |
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a |
4121 |
conditional command and have already set global_extglob appropriately. */ |
4119 |
conditional command and have already set extended_glob appropriately. */ |
4122 |
if (shell_compatibility_level <= 51 && was_extpat == 0) |
4120 |
if (shell_compatibility_level <= 51 && was_extpat == 0) |
4123 |
{ |
4121 |
{ |
4124 |
local_extglob = global_extglob = extended_glob; |
4122 |
local_extglob = extended_glob; |
4125 |
extended_glob = 1; |
4123 |
extended_glob = 1; |
4126 |
} |
4124 |
} |
4127 |
#endif |
4125 |
#endif |
Lines 4229-4235
xparse_dolparen (base, string, indp, flags)
Link Here
|
4229 |
{ |
4227 |
{ |
4230 |
sh_parser_state_t ps; |
4228 |
sh_parser_state_t ps; |
4231 |
sh_input_line_state_t ls; |
4229 |
sh_input_line_state_t ls; |
4232 |
int orig_ind, nc, sflags, start_lineno; |
4230 |
int orig_ind, nc, sflags, start_lineno, local_extglob; |
4233 |
char *ret, *ep, *ostring; |
4231 |
char *ret, *ep, *ostring; |
4234 |
|
4232 |
|
4235 |
/*debug_parser(1);*/ |
4233 |
/*debug_parser(1);*/ |
Lines 4272-4278
xparse_dolparen (base, string, indp, flags)
Link Here
|
4272 |
old value will be restored by restore_parser_state(). */ |
4270 |
old value will be restored by restore_parser_state(). */ |
4273 |
expand_aliases = 0; |
4271 |
expand_aliases = 0; |
4274 |
#if defined (EXTENDED_GLOB) |
4272 |
#if defined (EXTENDED_GLOB) |
4275 |
global_extglob = extended_glob; /* for reset_parser() */ |
4273 |
local_extglob = extended_glob; |
4276 |
#endif |
4274 |
#endif |
4277 |
|
4275 |
|
4278 |
token_to_read = DOLPAREN; /* let's trick the parser */ |
4276 |
token_to_read = DOLPAREN; /* let's trick the parser */ |
Lines 4290-4295
xparse_dolparen (base, string, indp, flags)
Link Here
|
4290 |
restore_input_line_state (&ls); |
4288 |
restore_input_line_state (&ls); |
4291 |
restore_parser_state (&ps); |
4289 |
restore_parser_state (&ps); |
4292 |
|
4290 |
|
|
|
4291 |
#if defined (EXTENDED_GLOB) |
4292 |
extended_glob = local_extglob; |
4293 |
#endif |
4293 |
token_to_read = 0; |
4294 |
token_to_read = 0; |
4294 |
|
4295 |
|
4295 |
/* If parse_string returns < 0, we need to jump to top level with the |
4296 |
/* If parse_string returns < 0, we need to jump to top level with the |
Lines 4724-4735
cond_term ()
Link Here
|
4724 |
} |
4725 |
} |
4725 |
|
4726 |
|
4726 |
/* rhs */ |
4727 |
/* rhs */ |
|
|
4728 |
#if defined (EXTENDED_GLOB) |
4727 |
local_extglob = extended_glob; |
4729 |
local_extglob = extended_glob; |
4728 |
if (parser_state & PST_EXTPAT) |
4730 |
if (parser_state & PST_EXTPAT) |
4729 |
extended_glob = 1; |
4731 |
extended_glob = 1; |
|
|
4732 |
#endif |
4730 |
tok = read_token (READ); |
4733 |
tok = read_token (READ); |
|
|
4734 |
#if defined (EXTENDED_GLOB) |
4731 |
if (parser_state & PST_EXTPAT) |
4735 |
if (parser_state & PST_EXTPAT) |
4732 |
extended_glob = local_extglob; |
4736 |
extended_glob = local_extglob; |
|
|
4737 |
#endif |
4733 |
parser_state &= ~(PST_REGEXP|PST_EXTPAT); |
4738 |
parser_state &= ~(PST_REGEXP|PST_EXTPAT); |
4734 |
|
4739 |
|
4735 |
if (tok == WORD) |
4740 |
if (tok == WORD) |
Lines 4776-4782
parse_cond_command ()
Link Here
|
4776 |
{ |
4781 |
{ |
4777 |
COND_COM *cexp; |
4782 |
COND_COM *cexp; |
4778 |
|
4783 |
|
4779 |
global_extglob = extended_glob; |
|
|
4780 |
cexp = cond_expr (); |
4784 |
cexp = cond_expr (); |
4781 |
return (make_cond_command (cexp)); |
4785 |
return (make_cond_command (cexp)); |
4782 |
} |
4786 |
} |