diff options
| author | Peter Stephenson <pws@zsh.org> | 2017-03-07 10:43:58 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@zsh.org> | 2017-03-07 10:43:58 +0000 |
| commit | f3f8537cfa05414ad14494e809d9ebfeef86ebbc (patch) | |
| tree | cfb02314dd129609ef3d6fc85ce75fc63b8c9582 /Src/zsh.h | |
| parent | 40780: Don't use =~ for simple prefix match (diff) | |
| download | zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar.gz zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar.bz2 zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar.lz zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar.xz zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.tar.zst zsh-f3f8537cfa05414ad14494e809d9ebfeef86ebbc.zip | |
40760: Always tokenize unquoted - to Dash.
This fixes use of pattern match character ranges in unusual contexts.
Attempt to detect a tokenized - in cases where we don't care.
Diffstat (limited to 'Src/zsh.h')
| -rw-r--r-- | Src/zsh.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -238,6 +238,16 @@ struct mathfunc { #define PATCHARS "#^*()|[]<>?~\\" /* + * Check for a possibly tokenized dash. + * + * A dash only needs to be a token in a character range, [a-z], but + * it's difficult in general to ensure that. So it's turned into + * a token at the usual point in the lexer. However, we need + * to check for a literal dash at many points. + */ +#define IS_DASH(x) ((x) == '-' || (x) == Dash) + +/* * Types of quote. This is used in various places, so care needs * to be taken when changing them. (Oooh, don't you look surprised.) * - Passed to quotestring() to indicate style. This is the ultimate |
