Break out of an infinite loop if we're not making progress.
authorPaul Smith <psmith@gnu.org>
Sun, 9 Sep 2012 20:06:03 +0000 (20:06 +0000)
committerPaul Smith <psmith@gnu.org>
Sun, 9 Sep 2012 20:06:03 +0000 (20:06 +0000)
ChangeLog
read.c

index aa2e5175426b562b58cc6e16fdaed57035d9260a..ffe1a5d368e43396337831b4c17a591c16c7bafc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * read.c (record_files): Reset the default macro values if .POSIX
        is set.  Fixes Savannah bug #37069.
+       (parse_file_seq): Break out of an infinite loop if we're not
+       making progress when parsing archive references.
 
 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
 
diff --git a/read.c b/read.c
index 7f6939e2dd2c21c0c35a3f2809c61cd51c4ed520..8478c8d73c94b3935a55994c404a30201a813019 100644 (file)
--- 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