preproc: restore correct break; in do_directive()
authorH. Peter Anvin <hpa@zytor.com>
Wed, 23 Jul 2008 14:49:26 +0000 (10:49 -0400)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 23 Jul 2008 14:52:43 +0000 (10:52 -0400)
Checkin a26433db6805cf1f1d711eb820f6a50a98f54f36 incorrectly changed a
few break;s in do_directive() that were *inside loops* to returns.
This broke single-line macros as well as %exitrep; fix.

preproc.c

index 9f520c3..7ba1b6f 100644 (file)
--- a/preproc.c
+++ b/preproc.c
@@ -2658,7 +2658,7 @@ static int do_directive(Token * tline)
          */
         for (l = istk->expansion; l; l = l->next)
             if (l->finishes && !l->finishes->name)
-               return DIRECTIVE_FOUND;
+               break;
 
         if (l)
             l->finishes->in_progress = 1;
@@ -2721,15 +2721,15 @@ static int do_directive(Token * tline)
                 skip_white_(tline);
                 if (tok_is_(tline, ",")) {
                     tline = tline->next;
-                    continue;
-                }
-                if (!tok_is_(tline, ")")) {
-                    error(ERR_NONFATAL,
-                          "`)' expected to terminate macro template");
-                    free_tlist(origline);
-                    return DIRECTIVE_FOUND;
-                }
-                return DIRECTIVE_FOUND;
+                } else {
+                   if (!tok_is_(tline, ")")) {
+                       error(ERR_NONFATAL,
+                             "`)' expected to terminate macro template");
+                       free_tlist(origline);
+                       return DIRECTIVE_FOUND;
+                   }
+                   break;
+               }
             }
             last = tline;
             tline = tline->next;