show.c (17987) | show.c (18018) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $Id: show.c,v 1.2 1994/09/24 02:58:16 davidg Exp $ | 36 * $Id: show.c,v 1.3 1996/09/01 10:21:43 peter Exp $ |
37 */ 38 39#ifndef lint 40static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdio.h> 44#if __STDC__ --- 291 unchanged lines hidden (view full) --- 336 return; 337 fputs(s, tracefile); 338 if (strchr(s, '\n')) 339 fflush(tracefile); 340#endif 341} 342 343 | 37 */ 38 39#ifndef lint 40static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdio.h> 44#if __STDC__ --- 291 unchanged lines hidden (view full) --- 336 return; 337 fputs(s, tracefile); 338 if (strchr(s, '\n')) 339 fflush(tracefile); 340#endif 341} 342 343 |
344#ifdef DEBUG |
|
344static void 345trstring(s) 346 char *s; 347{ 348 register char *p; 349 char c; 350 | 345static void 346trstring(s) 347 char *s; 348{ 349 register char *p; 350 char c; 351 |
351#ifdef DEBUG | |
352 if (tracefile == NULL) 353 return; 354 putc('"', tracefile); 355 for (p = s ; *p ; p++) { 356 switch (*p) { 357 case '\n': c = 'n'; goto backslash; 358 case '\t': c = 't'; goto backslash; 359 case '\r': c = 'r'; goto backslash; --- 15 unchanged lines hidden (view full) --- 375 putc(*p >> 6 & 03, tracefile); 376 putc(*p >> 3 & 07, tracefile); 377 putc(*p & 07, tracefile); 378 } 379 break; 380 } 381 } 382 putc('"', tracefile); | 352 if (tracefile == NULL) 353 return; 354 putc('"', tracefile); 355 for (p = s ; *p ; p++) { 356 switch (*p) { 357 case '\n': c = 'n'; goto backslash; 358 case '\t': c = 't'; goto backslash; 359 case '\r': c = 'r'; goto backslash; --- 15 unchanged lines hidden (view full) --- 375 putc(*p >> 6 & 03, tracefile); 376 putc(*p >> 3 & 07, tracefile); 377 putc(*p & 07, tracefile); 378 } 379 break; 380 } 381 } 382 putc('"', tracefile); |
383#endif | |
384} | 383} |
384#endif |
|
385 386 387void 388trargs(ap) 389 char **ap; 390{ 391#ifdef DEBUG 392 if (tracefile == NULL) --- 7 unchanged lines hidden (view full) --- 400 } 401 fflush(tracefile); 402#endif 403} 404 405 406void 407opentrace() { | 385 386 387void 388trargs(ap) 389 char **ap; 390{ 391#ifdef DEBUG 392 if (tracefile == NULL) --- 7 unchanged lines hidden (view full) --- 400 } 401 fflush(tracefile); 402#endif 403} 404 405 406void 407opentrace() { |
408#ifdef DEBUG |
|
408 char s[100]; 409 char *getenv(); 410#ifdef O_APPEND 411 int flags; 412#endif 413 | 409 char s[100]; 410 char *getenv(); 411#ifdef O_APPEND 412 int flags; 413#endif 414 |
414#ifdef DEBUG | |
415 if (!debug) 416 return; 417#ifdef not_this_way 418 { 419 char *p; 420 if ((p = getenv("HOME")) == NULL) { 421 if (geteuid() == 0) 422 p = "/"; --- 21 unchanged lines hidden --- | 415 if (!debug) 416 return; 417#ifdef not_this_way 418 { 419 char *p; 420 if ((p = getenv("HOME")) == NULL) { 421 if (geteuid() == 0) 422 p = "/"; --- 21 unchanged lines hidden --- |