summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/hist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 303c1dd4a..381c7e2e5 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -3473,7 +3473,8 @@ histsplitwords(char *lineptr, short **wordsp, int *nwordsp, int *nwordposp,
 			if (*lptr == *wptr ||
 			    (*lptr == '!' && *wptr == '|')) {
 			    lptr++;
-			    wptr++;
+			    if (!*++wptr)
+				break;
 			} else if (lptr[0] == '\\' &&
 				   lptr[1] == '\n') {
 			    /*