Changeset 1198 for trunk/src/kash/show.c
- Timestamp:
- Oct 6, 2007, 11:19:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/show.c
r809 r1198 276 276 trputc(int c) 277 277 { 278 if (debug != 1)278 if (debug(psh) != 1) 279 279 return; 280 280 putc(c, tracefile); … … 283 283 284 284 void 285 trace( const char *fmt, ...)285 trace(shinstance *psh, const char *fmt, ...) 286 286 { 287 287 #ifdef DEBUG 288 288 va_list va; 289 289 290 if (debug != 1)290 if (debug(psh) != 1) 291 291 return; 292 292 fprintf(tracefile, "[%d] ", getpid()); … … 298 298 299 299 void 300 tracev( const char *fmt, va_list va)301 { 302 #ifdef DEBUG 303 if (debug != 1)300 tracev(shinstance *psh, const char *fmt, va_list va) 301 { 302 #ifdef DEBUG 303 if (debug(psh) != 1) 304 304 return; 305 305 fprintf(tracefile, "[%d] ", getpid()); … … 313 313 trputs(const char *s) 314 314 { 315 if (debug != 1)315 if (debug(psh) != 1) 316 316 return; 317 317 fputs(s, tracefile); … … 325 325 char c; 326 326 327 if (debug != 1)327 if (debug(psh) != 1) 328 328 return; 329 329 putc('"', tracefile); … … 361 361 362 362 void 363 trargs( char **ap)364 { 365 #ifdef DEBUG 366 if (debug != 1)363 trargs(shinstance *psh, char **ap) 364 { 365 #ifdef DEBUG 366 if (debug(psh) != 1) 367 367 return; 368 368 while (*ap) { … … 386 386 #endif 387 387 388 if (debug != 1) {388 if (debug(psh) != 1) { 389 389 if (tracefile) 390 390 fflush(tracefile); … … 410 410 if (!freopen(s, "a", tracefile)) { 411 411 fprintf(stderr, "Can't re-open %s\n", s); 412 debug = 0;412 debug(psh) = 0; 413 413 return; 414 414 } … … 416 416 if ((tracefile = fopen(s, "a")) == NULL) { 417 417 fprintf(stderr, "Can't open %s\n", s); 418 debug = 0;418 debug(psh) = 0; 419 419 return; 420 420 }
Note:
See TracChangeset
for help on using the changeset viewer.