X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=as%2Fz80%2Faslex.c;h=0a4323ec4523d21e418543a7fbc829869fab494c;hb=662402712689eba7ab2689fa8030a533e08897aa;hp=49a395f913f0397116bf2e1901212e22d1275231;hpb=0abb805fd2d72a89b41a10144ded610ebfc072bc;p=fw%2Fsdcc diff --git a/as/z80/aslex.c b/as/z80/aslex.c index 49a395f9..0a4323ec 100644 --- a/as/z80/aslex.c +++ b/as/z80/aslex.c @@ -16,7 +16,7 @@ #include #include #include -#include + #include "asm.h" /*)Module aslex.c @@ -28,7 +28,7 @@ * char endline() * char get() * VOID getid(id,c) - * int getline() + * int as_getline() * int getmap() * char getnb() * VOID getst() @@ -164,7 +164,7 @@ char *id; do { if (p < &id[NCPS]) *p++ = c; - } while (ctype[c=get()] & ~(SPACE|ILL)); + } while (ctype[c=get()] & (0xFF - (SPACE|ILL))); unget(c); while (p < &id[NCPS]) *p++ = 0; @@ -354,9 +354,9 @@ getmap(d) return (c); } -/*)Function int getline() +/*)Function int as_getline() * - * The function getline() reads a line of assembler-source text + * The function as_getline() reads a line of assembler-source text * from an assembly source text file or an include file. * Lines of text are processed from assembler-source files until * all files have been read. If an include file is opened then @@ -364,7 +364,7 @@ getmap(d) * include file) until the end of the include file is found. * The input text line is copied into the global string ib[] * and converted to a NULL terminated string. The function - * getline() returns a (1) after succesfully reading a line + * as_getline() returns a (1) after succesfully reading a line * or a (0) if all files have been read. * * local variables: @@ -401,7 +401,7 @@ getmap(d) */ int -getline() +as_getline() { register int i; @@ -432,6 +432,8 @@ loop: if (incfil >= 0) { i = strlen(ib) - 1; if (ib[i] == '\n') ib[i] = 0; + if (i >= 1 && ib[i-1] == '\r') + ib[i-1] = 0; return (1); }