From 73b29f079b50412700727e0f77991506c03d19fe Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 19 Mar 2019 13:44:47 +0000
Subject: 44142: Fix hist_reduce_spaces bug.
When there were as an unstripped comment on the line the
pointer for stripping spaces could be bogus. Don't do
any editing in that case.
---
Src/hist.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'Src')
diff --git a/Src/hist.c b/Src/hist.c
index f7e53de74..901cd3b1a 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1198,8 +1198,9 @@ histreduceblanks(void)
chline[pos] = '\0';
} else {
ptr = chline + pos;
- while ((*ptr++ = *lastptr++))
- ;
+ if (ptr < lastptr)
+ while ((*ptr++ = *lastptr++))
+ ;
}
}
--
cgit 1.4.1