Skip to content

Commit

Permalink
Lemon now writes errors to stderr instead of stdout, and uses full ou…
Browse files Browse the repository at this point in the history
…tput.

The previous way truncated the filename, so my editor couldn't jump to the
problem line in the source code.
  • Loading branch information
icculus committed Feb 13, 2010
1 parent d0d0d61 commit 6d2e1f0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions misc/lemon.c
Expand Up @@ -1344,6 +1344,15 @@ int max;
#define LINEWIDTH 79 /* Max width of any output line */
#define PREFIXLIMIT 30 /* Max width of the prefix on each line */
void ErrorMsg(const char *filename, int lineno, const char *format, ...){
#if __MOJOSHADER__
va_list ap;
fprintf(stderr, "%s:%d: ", filename, lineno);
va_start(ap, format);
vfprintf(stderr,format,ap);
va_end(ap);
fprintf(stderr, "\n");
fflush(stderr);
#else
char errmsg[ERRMSGSIZE];
char prefix[PREFIXLIMIT+10];
int errmsgsize;
Expand Down Expand Up @@ -1380,6 +1389,7 @@ void ErrorMsg(const char *filename, int lineno, const char *format, ...){
fprintf(stdout,"%s%.*s\n",prefix,end,&errmsg[base]);
base = restart;
}
#endif
}
/**************** From the file "main.c" ************************************/
/*
Expand Down

0 comments on commit 6d2e1f0

Please sign in to comment.