summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-09-09 20:06:03 +0000
committerPaul Smith <psmith@gnu.org>2012-09-09 20:06:03 +0000
commiteabd75629e8a00505795bc78a330a4144637a5a1 (patch)
treedb57095b66dc76948a255cd7452daf49f79a9aeb /read.c
parent0ebac14c5658644c5cf839f598d0f2c29fd7117d (diff)
downloadmake-eabd75629e8a00505795bc78a330a4144637a5a1.tar.gz
Break out of an infinite loop if we're not making progress.
Diffstat (limited to 'read.c')
-rw-r--r--read.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/read.c b/read.c
index 7f6939e2..8478c8d7 100644
--- a/read.c
+++ b/read.c
@@ -3087,6 +3087,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
const char *e = p;
do
{
+ const char *o = e;
e = next_token (e);
/* Find the end of this word. We don't want to unquote and
we don't care about quoting since we're looking for the
@@ -3094,6 +3095,9 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
while (*e != '\0' && *e != stopchar && *e != VMS_COMMA
&& ! isblank ((unsigned char) *e))
++e;
+ /* If we didn't move, we're done now. */
+ if (e == o)
+ break;
if (e[-1] == ')')
{
/* Found the end, so this is the first element in an