diff options
| author | Oliver Kiddle <opk@zsh.org> | 2025-11-24 22:21:54 +0100 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2025-11-24 22:21:54 +0100 |
| commit | 735afc8e8a572e6e12675da40eb40ec440c9f6fe (patch) | |
| tree | e017e45e4799b7dbd59389d8bf1b4261656184f4 | |
| parent | 54103: support > and < comparisons via the test builtin (diff) | |
| download | zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar.gz zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar.bz2 zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar.lz zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar.xz zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.tar.zst zsh-735afc8e8a572e6e12675da40eb40ec440c9f6fe.zip | |
54104: fix bug with packing strings into wordcode
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | Src/parse.c | 4 | ||||
| -rw-r--r-- | Src/zsh.h | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,8 @@ 2025-11-24 Oliver Kiddle <opk@zsh.org> + * 54104: Src/parse.c, Src/zsh.h: fix bug with packing strings + into wordcode + * 54103: Src/builtin.c, Src/parse.c, Test/C02cond.ztst: support > and < comparisons via the test builtin diff --git a/Src/parse.c b/Src/parse.c index ab708a279..2b7f8bb59 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -446,7 +446,9 @@ ecstrcode(char *s) long cmp; for (pp = &ecstrs; (p = *pp); ) { - if (!(cmp = p->nfunc - ecnfunc) && !(cmp = (((long)p->hashval) - ((long)val))) && !(cmp = strcmp(p->str, s))) { + if (!(cmp = p->nfunc - ecnfunc) && + !(cmp = (int) (p->hashval - val)) && + !(cmp = strcmp(p->str, s))) { /* Re-use the existing string. */ return p->offs; } @@ -850,7 +850,7 @@ struct eccstr { int nfunc; /* Hash of str. */ - int hashval; + unsigned hashval; }; /* |
