]> Shamusworld >> Repos - rmac/blobdiff - token.c
Bumping the patch level for the last commit. :-P
[rmac] / token.c
diff --git a/token.c b/token.c
index ca38406e5707dd07c44abed620dad9b5f5bcdeb9..c78d97ac6f0054d8ca02bf68b0a3a1c0c10406e4 100644 (file)
--- a/token.c
+++ b/token.c
@@ -617,7 +617,7 @@ overflow:
 //
 char * GetNextMacroLine(void)
 {
-       unsigned source_addr;
+//     unsigned source_addr;
 
        IMACRO * imacro = cur_inobj->inobj.imacro;
 //     LONG * strp = imacro->im_nextln;
@@ -728,7 +728,10 @@ int fpop(void)
                // Pop IFENT levels until we reach the conditional assembly context we
                // were at when the input object was entered.
                while (ifent != inobj->in_ifent)
-                       d_endif();
+               {
+                       if (d_endif() != 0)                             // Something bad happened during endif parsing?
+                               return -1;                                      // If yes, bail instead of getting stuck in a loop
+               }
 
                tok = inobj->in_otok;                           // Restore tok and otok
                etok = inobj->in_etok;
@@ -940,8 +943,10 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n");
        case SRC_IMACRO:
                if ((ln = GetNextMacroLine()) == NULL)
                {
-                       ExitMacro();                                    // Exit macro (pop args, do fpop(), etc)
-                       goto retry;                                             // Try for more lines...
+                       if (ExitMacro() == 0)                   // Exit macro (pop args, do fpop(), etc)
+                               goto retry;                                     // Try for more lines...
+                       else
+                               return TKEOF;                           // Oops, we got a non zero return code, signal EOF
                }
 
                lntag = '@';
@@ -1547,7 +1552,7 @@ int d_goto(WORD unused)
                        // Compare names (sleazo string compare)
                        // This string compare is not right. Doesn't check for lengths.
                        // (actually it does, but in a crappy, unclear way.)
-#warning "!!! Bad string comparison !!!"
+WARNING(!!!! Bad string comparison !!!)
                        s1 = sym;
 //                     s2 = (char *)(defln + 1) + 1;
                        s2 = defln->line;