1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-28 16:15:02 +01:00

52781: HIST IGNORE_DUPS + HIST_REDUCE_BLANKS treats whitespace as significant

This commit is contained in:
Bart Schaefer 2024-04-01 22:29:07 -07:00
parent f57ad185b3
commit 5ba43e58c2
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2024-04-01 Bart Schaefer <schaefer@zsh.org>
* 52781 (and typo fix): Src/hashtable.c: HIST IGNORE_DUPS treats
whitespace as significant when HIST_REDUCE_BLANKS is also set.
2024-04-01 Oliver Kiddle <opk@zsh.org>
* github #115: OKURA Masafumi: Completion/Unix/Command/_ruby:

View file

@ -1397,6 +1397,14 @@ histstrcmp(const char *str1, const char *str2)
{
while (inblank(*str1)) str1++;
while (inblank(*str2)) str2++;
/* If insignificant whitespace has already been eliminated,
* there is no reason to expend similar effort here. Also,
* this is more accurate in cases of quoted whitespace.
*/
if (isset(HISTREDUCEBLANKS))
return strcmp(str1, str2);
while (*str1 && *str2) {
if (inblank(*str1)) {
if (!inblank(*str2))