summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjg <tjg>2002-11-27 10:23:26 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:23 +0100
commit3350079a799e9b685d829c720f2b875b27d1ff47 (patch)
tree573c950dd45237f88db8e45e17fa86678c3c1a58
parent8b0eda2af45a00158ef3688a1627cb127a74b20b (diff)
Bug: history dumps core if more colons than substitutions (thanks
Callum Gibson).
-rw-r--r--ChangeLog5
-rw-r--r--history.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 52e9777..34c556c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -812,3 +812,8 @@ Changes since rc-1.5b2
Bug: don't call ealloc(0) on systems where getgroups() doesn't
return egid (thanks Chris Siebenmann).
+
+2002-11-27
+
+ Bug: history dumps core if more colons than substitutions (thanks
+ Callum Gibson).
diff --git a/history.c b/history.c
index 2993a69..8be90ec 100644
--- a/history.c
+++ b/history.c
@@ -78,6 +78,8 @@ static char *sub(char *s, char *old, char *new) {
char *t, *u;
t = isin(s, old);
+ if (!t)
+ return s;
u = newstr();
*t = '\0';