mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +01:00
21862/21863: GLOB_SUBST shouldn't swallow up backslashes in parameter
substitutions that don't match anything.
This commit is contained in:
parent
1eaa7fee0d
commit
cca66ab341
8 changed files with 92 additions and 21 deletions
|
|
@ -260,13 +260,13 @@ static char endseg[] = {
|
|||
|
||||
static char endstr[] = {
|
||||
'/', /* file only */
|
||||
'\0', Bar, Outpar, Quest, Star, Inbrack, Inpar, Inang,
|
||||
'\0', Bar, Outpar, Quest, Star, Inbrack, Inpar, Inang, Bnullkeep,
|
||||
/* all patterns */
|
||||
Tilde, Hat, Pound /* extended glob only */
|
||||
};
|
||||
|
||||
#define PATENDSTRLEN_NORM 9
|
||||
#define PATENDSTRLEN_EXT 12
|
||||
#define PATENDSTRLEN_NORM 10
|
||||
#define PATENDSTRLEN_EXT 13
|
||||
|
||||
|
||||
/* Default size for pattern buffer */
|
||||
|
|
@ -1240,6 +1240,13 @@ patcomppiece(int *flagp)
|
|||
*/
|
||||
return 0;
|
||||
break;
|
||||
case Bnullkeep:
|
||||
/*
|
||||
* Marker for restoring a backslash in output:
|
||||
* does not match a character.
|
||||
*/
|
||||
return patcomppiece(flagp);
|
||||
break;
|
||||
#ifdef DEBUG
|
||||
default:
|
||||
dputs("BUG: character not handled in patcomppiece");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue