diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2014-12-09 02:41:01 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2014-12-09 02:41:01 +0900 |
commit | 0a07ffd47cb5000ff32d5fc5905e7d3e87603d16 (patch) | |
tree | 50156e820693a0ac5fe0a6b72d44e6c756f06303 /Src/utils.c | |
parent | 88f4e24d4c42de1072898cd0e26e3d43c7de448c (diff) | |
download | zsh-0a07ffd47cb5000ff32d5fc5905e7d3e87603d16.tar.gz zsh-0a07ffd47cb5000ff32d5fc5905e7d3e87603d16.tar.xz zsh-0a07ffd47cb5000ff32d5fc5905e7d3e87603d16.zip |
33932: revise boundary check in unmeta()
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Src/utils.c b/Src/utils.c index 5c90638a2..ab3d3da93 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -4208,10 +4208,8 @@ unmeta(const char *file_name) meta = 0; for (t = file_name; *t; t++) { - if (*t == Meta) { - meta = t[1]; - break; - } + if (*t == Meta) + meta = 1; } if (!meta) { /* @@ -4250,7 +4248,7 @@ unmeta(const char *file_name) } for (t = file_name, p = fn; *t; p++) - if ((*p = *t++) == Meta) + if ((*p = *t++) == Meta && *t) *p = *t++ ^ 32; *p = '\0'; return fn; |