From 1a4e959eb34ae03a96f6d0dea68b6a6a88ac4462 Mon Sep 17 00:00:00 2001 From: Piotr Pawel Stefaniak Date: Sun, 11 Apr 2021 09:09:28 +0200 Subject: [PATCH] sh: fix debug build Approved by: jilles --- bin/sh/show.c | 7 +++---- bin/sh/show.h | 2 ++ bin/sh/trap.c | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/sh/show.c b/bin/sh/show.c index 04dc123381af..01035d76093d 100644 --- a/bin/sh/show.c +++ b/bin/sh/show.c @@ -73,7 +73,7 @@ static void shtree(union node *n, int ind, char *pfx, FILE *fp) { struct nodelist *lp; - char *s; + const char *s; if (n == NULL) return; @@ -125,7 +125,7 @@ shcmd(union node *cmd, FILE *fp) { union node *np; int first; - char *s; + const char *s; int dftfd; first = 1; @@ -274,8 +274,7 @@ indent(int amount, char *pfx, FILE *fp) */ -FILE *tracefile; - +static FILE *tracefile; #if DEBUG >= 2 int debug = 1; #else diff --git a/bin/sh/show.h b/bin/sh/show.h index 1dbdaa152b33..790a62e2942c 100644 --- a/bin/sh/show.h +++ b/bin/sh/show.h @@ -39,4 +39,6 @@ void trargs(char **); void trputc(int); void trputs(const char *); void opentrace(void); + +extern int debug; #endif diff --git a/bin/sh/trap.c b/bin/sh/trap.c index d7a98604c22c..d7ef40274270 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -274,12 +274,8 @@ setsignal(int signo) break; case SIGQUIT: #ifdef DEBUG - { - extern int debug; - if (debug) break; - } #endif action = S_CATCH; break;