* src/regression/add.c, src/regression/add2.c, src/regression/add3.c,
[fw/sdcc] / link / z80 / lklex.c
index 670633bd1e9645c2e75f2d189eaf90ca52a5fe6e..7bc34fcaa34a6655e9fd0c1b8bfd414ba1a9f1d7 100644 (file)
@@ -144,6 +144,9 @@ char *str;
                if (p < &str[FILSPC-1])
                        *p++ = c;
                c = get();
+               if (c == ';')
+                       while (c)
+                               c = get();
 #ifdef SDK
        } while (c);
 #else /* SDK */
@@ -567,3 +570,34 @@ endline()
        c = getnb();
        return( (c == '\0' || c == ';') ? 0 : c );
 }
+
+/*)Function    VOID    chop_crlf(str)
+ *
+ *             char    *str            string to chop
+ *
+ *     The function chop_crlf() removes trailing LF or CR/LF from
+ *     str, if present.
+ *
+ *     local variables:
+ *             int     i               string length
+ *
+ *     global variables:
+ *             none
+ *
+ *     functions called:
+ *             none
+ *
+ *     side effects:
+ *             none
+ */
+
+VOID
+chop_crlf(str)
+char *str;
+{
+       register int i;
+
+       i = strlen(str);
+       if (i >= 1 && str[i-1] == '\n') str[i-1] = 0;
+       if (i >= 2 && str[i-2] == '\r') str[i-2] = 0;
+}