chiark
/
gitweb
/
~ijackson
/
trains.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
00dd425
)
better reporting of bad input
author
ian
<ian>
Thu, 5 Jan 2006 02:36:38 +0000
(
02:36
+0000)
committer
ian
<ian>
Thu, 5 Jan 2006 02:36:38 +0000
(
02:36
+0000)
hostside/gui-plan.c
patch
|
blob
|
history
diff --git
a/hostside/gui-plan.c
b/hostside/gui-plan.c
index 3a4b9a893656a7c57042f6cdd440967a555078bf..1df8766ae440a660557820dafe3a770010f353df 100644
(file)
--- a/
hostside/gui-plan.c
+++ b/
hostside/gui-plan.c
@@
-53,6
+53,9
@@
static int redraw_needed_count, expose_count;
static Pixmap bg_pixmap;
static unsigned long train_pixel, owned_pixel;
static Pixmap bg_pixmap;
static unsigned long train_pixel, owned_pixel;
+static const char *badcmdreport_data;
+static size_t badcmdreport_recsz;
+
static void diex(const char *fn, const char *w) __attribute__((noreturn));
static void diex(const char *fn, const char *w) {
die("Xlib call failed: %s%s%s%s", fn,
static void diex(const char *fn, const char *w) __attribute__((noreturn));
static void diex(const char *fn, const char *w) {
die("Xlib call failed: %s%s%s%s", fn,
@@
-79,7
+82,8
@@
static void diexpm(const char *fn, const char *w, int xpmst) {
}while(0)
void vbadcmd(ParseState *ps, const char *fmt, va_list al) {
}while(0)
void vbadcmd(ParseState *ps, const char *fmt, va_list al) {
- fprintf(stderr,"gui-plan: incorrect input: ");
+ fprintf(stderr,"gui-plan: incorrect input: `%.*s': ",
+ (int)badcmdreport_recsz, badcmdreport_data);
vfprintf(stderr,fmt,al);
putc('\n',stderr);
exit(8);
vfprintf(stderr,fmt,al);
putc('\n',stderr);
exit(8);
@@
-248,7
+252,8
@@
static void *stdin_ifok(oop_source *evts, oop_read *cl_read,
if (evt != OOP_RD_OK)
return stdin_iferr(evts,cl_read,evt,errmsg,errnoval,data,recsz,cl_v);
if (evt != OOP_RD_OK)
return stdin_iferr(evts,cl_read,evt,errmsg,errnoval,data,recsz,cl_v);
-fprintf(stderr,"gui-plan>%.*s<\n",(int)recsz,data);
+ badcmdreport_data= data;
+ badcmdreport_recsz= recsz;
ps.cl= 0;
ps.remain= data;
ps.cl= 0;
ps.remain= data;