From 5ba43e58c269100a6e3adcfc118ae93346ba0165 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 1 Apr 2024 22:29:07 -0700 Subject: 52781: HIST IGNORE_DUPS + HIST_REDUCE_BLANKS treats whitespace as significant --- Src/hashtable.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Src') 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)) -- cgit 1.4.1