diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-06-26 12:31:22 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-06-26 14:07:37 -0700 |
commit | e53ae9edaf0b863eba5461d50f1aabc8c7321c82 (patch) | |
tree | bad2c36dd9c0a2b1da80208b7e2e6b19b19dceee /mutt.h | |
parent | e5a32a61ba659f57025111982e86d652fe53f649 (diff) |
Escape config vars when expanding hook "command" argument.
The "command" parameter of folder, send, send2, account, reply, and
message hooks is run through mutt_extract_token() twice. Once when
parsing the hook command initially, and once via mutt_parse_rc_line()
when the actual hook fires.
In theory, Mutt users should be aware of this, and should place all
their command strings with configuration variables in single-quotes,
to delay expansion until execution.
But in reality Mutt has been escaping configuration variables as part
of mutt_extract_token() for many years.
The previous commit turned the escaping off, because it damages
"backup" assignments to a $my_ variable, and I believe is confusing
behavior.
But for hooks, users now expect the escaping behavior (for
double-quoted or unquoted command strings).
Note that mutt_parse_hook() also passed the MUTT_TOKEN_SPACE flag, but
neglected to do so for message-hook. Since all other "command"
argument hooks were included, and were added to the list over the
years, I believe this was an accidental oversight.
Diffstat (limited to 'mutt.h')
-rw-r--r-- | mutt.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -126,6 +126,7 @@ struct timespec #define MUTT_TOKEN_PATTERN (1<<4) /* !)|~ are terms (for patterns) */ #define MUTT_TOKEN_COMMENT (1<<5) /* don't reap comments */ #define MUTT_TOKEN_SEMICOLON (1<<6) /* don't treat ; as special */ +#define MUTT_TOKEN_ESC_VARS (1<<7) /* escape configuration variables */ typedef struct { |