diff --git a/ChangeLog b/ChangeLog index 62b332aae..63034fb5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-04-01 Bart Schaefer + + * 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 * github #115: OKURA Masafumi: Completion/Unix/Command/_ruby: diff --git a/Src/hashtable.c b/Src/hashtable.c index 75b06c4ad..96675a393 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -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))