summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-12-12 04:24:17 +0000
committerRoland McGrath <roland@redhat.com>1995-12-12 04:24:17 +0000
commit76d037cb95c26a4a3c5ac7ba34c94cae2be7baa1 (patch)
treefc3f6cbff3985d5687b2a11f54623ea2be83d3d6
parentdfdf1bec21278ceb58295b88e22162b39d0de48b (diff)
downloadgunmake-76d037cb95c26a4a3c5ac7ba34c94cae2be7baa1.tar.gz
(collapse_continuations): Fix skipping of trailing \s so it can never
dereference before the beginning of the array.
-rw-r--r--misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index a7e9e71..88dfd60 100644
--- a/misc.c
+++ b/misc.c
@@ -50,9 +50,8 @@ collapse_continuations (line)
return;
out = in;
- if (out > line)
- while (out[-1] == '\\')
- --out;
+ while (out > line && out[-1] == '\\')
+ --out;
while (*in != '\0')
{