1
0
Fork 0
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:
Peter Stephenson 2005-10-11 16:48:05 +00:00
parent 1eaa7fee0d
commit cca66ab341
8 changed files with 92 additions and 21 deletions

View file

@ -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");