Mercurial > hg > CbC > old > device
diff mc-parse.c @ 25:b7a94557bf92
*** empty log message ***
author | kono |
---|---|
date | Wed, 05 Feb 2003 02:34:28 +0900 |
parents | e605560e6146 |
children | c6994794f084 |
line wrap: on
line diff
--- a/mc-parse.c Tue Feb 04 14:39:01 2003 +0900 +++ b/mc-parse.c Wed Feb 05 02:34:28 2003 +0900 @@ -194,7 +194,7 @@ exit(0); } } - fprintf(stderr,"%5d:%s.\n",lineno, + fprintf(stderr,"%s:%d:%s\n",filep->name0,lineno, (n==FILERR) ? "Can't open specified file" : (n==DCERR) ? "Declaration syntax" : (n==STERR) ? "Statement syntax" : @@ -302,10 +302,14 @@ void newfile(void) { + char *s; lineno=0; /* fprintf(stderr,"%s:\n",av[ac2]); */ opening(av[ac2]); if ( (filep->fcb = fopen(av[ac2++],"r")) == NULL ) error(FILERR); + s = av[ac2-1]; + filep->name0 = cheapp; + while((*cheapp++ = *s++)); } void @@ -2481,7 +2485,7 @@ getfname(void) { int i; - char name[LBUFSIZE]; + char *s,name[LBUFSIZE]; FILE *fp; getch(); @@ -2492,6 +2496,9 @@ if(ch=='\n') error(INCERR); name[i]=0; fp = fopen(name,"r") ; + s = name; + (filep+1)->name0 = cheapp; + while((*cheapp++ = *s++)); return ( (filep+1)->fcb = fp ); } @@ -2510,15 +2517,7 @@ glineno++; chptr=linebuf; i=0; -#if 1 while ((*chptr++ = c = getc(filep->fcb)) != '\n') { -#else - while ((c=getc(filep->fcb)),(*chptr++=c)!='\n') { -#endif - /* we cannot handle unsaved register in library call - so make it easy for the compiler - \ line continuation? - */ if (++i > LBUFSIZE-2) error(LNERR); if (c==EOF) { error(EOFERR);