diff options
-rw-r--r-- | listbas.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -141,6 +141,7 @@ void parse_args(int argc, char **argv, int from_env) { } #define ENV_MAX_ARGS 64 +/* #define DEBUG_ENV */ /* make a fake argv and argc */ void parse_env_args(void) { @@ -151,8 +152,9 @@ void parse_env_args(void) { env = getenv(ENV_OPTS); if(!env) return; - if(verbose) - fprintf(stderr, "%s: read options from environment: \"%s\"\n.", self, env); +#ifdef DEBUG_ENV + fprintf(stderr, "%s: " ENV_OPTS " is set in the env, using it.\n", self); +#endif fargv[0] = (char *)self; fargv[1] = env; @@ -162,7 +164,7 @@ void parse_env_args(void) { if(*p == ' ' || *p == '\t') { *p = '\0'; if(fargc == ENV_MAX_ARGS) { - fprintf(stderr, "%s: too many spaces in LISTBAS_OPTS (max %d)\n", self, ENV_MAX_ARGS - 1); + fprintf(stderr, "%s: Too many spaces in " ENV_OPTS " (max %d)\n", self, ENV_MAX_ARGS - 1); break; } fargv[fargc++] = p + 1; @@ -171,6 +173,16 @@ void parse_env_args(void) { fargv[fargc] = NULL; +#ifdef DEBUG_ENV + { + char **p; + fprintf(stderr, "%s: Read options from environment:\n", self); + for(p = fargv + 1; *p; p++) { + fprintf(stderr, "\t%s\n", *p); + } + } +#endif + parse_args(fargc, fargv, 1); } @@ -487,7 +499,7 @@ int main(int argc, char **argv) { list(); if(badtok) { - fprintf(stderr, "%s: program has unknown tokens; maybe Turbo BASIC or BASIC XL/XE?\n", self); + fprintf(stderr, "%s: Program has unknown tokens; maybe Turbo BASIC or BASIC XL/XE?\n", self); return 2; } |