i should explain further, since this is sneaky. since we're calling
ARGBEGIN lots of times, we hit a special case. the defn is
#define ARGBEGINfor((argv0||(argv0=*argv)),argv++,argc--;\
a subsequent call to ARGBEGIN will not reset argv0, and worse, argv0
can be pointing to bogus memory.
small but potentially deadly
diff -c /n/dump/2014/0402/sys/src/cmd/fossil/9fsys.c 9fsys.c
/n/dump/2014/0402/sys/src/cmd/fossil/9fsys.c:34,40 - 9fsys.c:34,40
char* curfsys;
} sbox;
- static char *_argv0;
+ char *_argv0;
#define argv0 _argv0
static char FsysAll[] = "all";