diff options
| author | kre <kre@NetBSD.org> | 2023-04-07 10:34:13 +0000 |
|---|---|---|
| committer | kre <kre@NetBSD.org> | 2023-04-07 10:34:13 +0000 |
| commit | 14acc88f9df09401cb93dd8bc3e8f19fc441dd3b (patch) | |
| tree | c97c6d6bfd8469e0e201bf5a295192d494f6fea7 /bin | |
| parent | e90e1bf9689ce97054b975996c7c9fb857034144 (diff) | |
The great shell trailing whitespace cleanup of 2023...
Inspired by private e-mail comments from mouse@
NFCI.
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/sh/eval.c | 8 | ||||
| -rw-r--r-- | bin/sh/funcs/dirs | 6 | ||||
| -rw-r--r-- | bin/sh/funcs/popd | 6 | ||||
| -rw-r--r-- | bin/sh/funcs/pushd | 6 | ||||
| -rw-r--r-- | bin/sh/histedit.c | 6 | ||||
| -rw-r--r-- | bin/sh/jobs.c | 11 | ||||
| -rw-r--r-- | bin/sh/jobs.h | 4 | ||||
| -rw-r--r-- | bin/sh/main.c | 6 | ||||
| -rw-r--r-- | bin/sh/memalloc.c | 6 | ||||
| -rw-r--r-- | bin/sh/mktokens | 4 | ||||
| -rw-r--r-- | bin/sh/mystring.c | 6 | ||||
| -rw-r--r-- | bin/sh/output.c | 6 | ||||
| -rw-r--r-- | bin/sh/parser.c | 8 | ||||
| -rw-r--r-- | bin/sh/show.c | 8 |
14 files changed, 45 insertions, 46 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 3eb79210276..0133a15d606 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.188 2022/01/05 15:25:44 kre Exp $ */ +/* $NetBSD: eval.c,v 1.189 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.188 2022/01/05 15:25:44 kre Exp $"); +__RCSID("$NetBSD: eval.c,v 1.189 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -96,7 +96,7 @@ STATIC int funcnest; /* depth of function calls */ STATIC int builtin_flags; /* evalcommand flags for builtins */ /* * Base function nesting level inside a dot command. Set to 0 initially - * and to (funcnest + 1) before every dot command to enable + * and to (funcnest + 1) before every dot command to enable * 1) detection of being in a file sourced by a dot command and * 2) counting of function nesting in that file for the implementation * of the return command. @@ -1398,7 +1398,7 @@ evalcommand(union node *cmd, int flgs, struct backcmd *backcmd) default: VXTRACE(DBG_EVAL, ("normal command%s: ", vforked?" VF":""), trargs(argv)); - redirect(cmd->ncmd.redirect, + redirect(cmd->ncmd.redirect, (vforked ? REDIR_VFORK : 0) | REDIR_KEEP); if (!vforked) for (sp = varlist.list ; sp ; sp = sp->next) diff --git a/bin/sh/funcs/dirs b/bin/sh/funcs/dirs index ef2ae0a3f8f..58fbc7631ca 100644 --- a/bin/sh/funcs/dirs +++ b/bin/sh/funcs/dirs @@ -1,4 +1,4 @@ -# $NetBSD: dirs,v 1.8 2016/02/29 23:50:59 christos Exp $ +# $NetBSD: dirs,v 1.9 2023/04/07 10:34:13 kre Exp $ # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. # @@ -34,7 +34,7 @@ pushd () { SAVE=`pwd` - if [ "$1" = "" ] + if [ "$1" = "" ] then if [ "$DSTACK" = "" ] then echo "pushd: directory stack empty." return 1 @@ -50,7 +50,7 @@ pushd () { } popd () { - if [ "$DSTACK" = "" ] + if [ "$DSTACK" = "" ] then echo "popd: directory stack empty." return 1 fi diff --git a/bin/sh/funcs/popd b/bin/sh/funcs/popd index 836741cd46a..d51a5b27d48 100644 --- a/bin/sh/funcs/popd +++ b/bin/sh/funcs/popd @@ -1,4 +1,4 @@ -# $NetBSD: popd,v 1.8 2016/02/29 23:50:59 christos Exp $ +# $NetBSD: popd,v 1.9 2023/04/07 10:34:13 kre Exp $ # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. # @@ -34,7 +34,7 @@ pushd () { SAVE=`pwd` - if [ "$1" = "" ] + if [ "$1" = "" ] then if [ "$DSTACK" = "" ] then echo "pushd: directory stack empty." return 1 @@ -50,7 +50,7 @@ pushd () { } popd () { - if [ "$DSTACK" = "" ] + if [ "$DSTACK" = "" ] then echo "popd: directory stack empty." return 1 fi diff --git a/bin/sh/funcs/pushd b/bin/sh/funcs/pushd index c6ec1afd64a..9d3e1b49d43 100644 --- a/bin/sh/funcs/pushd +++ b/bin/sh/funcs/pushd @@ -1,4 +1,4 @@ -# $NetBSD: pushd,v 1.8 2016/02/29 23:50:59 christos Exp $ +# $NetBSD: pushd,v 1.9 2023/04/07 10:34:13 kre Exp $ # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. # @@ -34,7 +34,7 @@ pushd () { SAVE=`pwd` - if [ "$1" = "" ] + if [ "$1" = "" ] then if [ "$DSTACK" = "" ] then echo "pushd: directory stack empty." return 1 @@ -50,7 +50,7 @@ pushd () { } popd () { - if [ "$DSTACK" = "" ] + if [ "$DSTACK" = "" ] then echo "popd: directory stack empty." return 1 fi diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 5a1b9649bbd..2ad8ac03a36 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -1,4 +1,4 @@ -/* $NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $ */ +/* $NetBSD: histedit.c,v 1.66 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: histedit.c,v 1.65 2022/08/22 17:33:11 kre Exp $"); +__RCSID("$NetBSD: histedit.c,v 1.66 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -189,7 +189,7 @@ bad: el_set(el, EL_EDITOR, "emacs"); VTRACE(DBG_HISTORY, ("reading $EDITRC\n")); el_source(el, lookupvar("EDITRC")); - el_set(el, EL_BIND, "^I", + el_set(el, EL_BIND, "^I", tabcomplete ? "rl-complete" : "ed-insert", NULL); INTON; } diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index af52e5098c4..0d7fbf47b81 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $ */ +/* $NetBSD: jobs.c,v 1.118 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: jobs.c,v 1.117 2022/10/30 01:46:16 kre Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.118 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -857,7 +857,7 @@ waitcmd(int argc, char **argv) * (eg: a child of the executable that exec'd us) * Simply go back and start all over again * (this is rare). - */ + */ if (job == NULL) continue; @@ -894,9 +894,8 @@ waitcmd(int argc, char **argv) * (that is, no pid args) */ snprintf(idstring, sizeof idstring, - "%d", job->ps[ job->nprocs ? - job->nprocs-1 : - 0 ].pid); + "%d", job->ps[ job->nprocs ? + job->nprocs-1 : 0 ].pid); fpid = idstring; } VTRACE(DBG_WAIT, (" (for %s)", fpid)); diff --git a/bin/sh/jobs.h b/bin/sh/jobs.h index 6cb705befe1..2e9eb5f2408 100644 --- a/bin/sh/jobs.h +++ b/bin/sh/jobs.h @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.h,v 1.25 2021/09/11 20:43:32 christos Exp $ */ +/* $NetBSD: jobs.h,v 1.26 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -77,7 +77,7 @@ struct job { #define JOBSTOPPED 1 /* all procs are stopped */ #define JOBDONE 2 /* all procs are completed */ char used; /* true if this entry is in used */ - char flags; + char flags; #define JOBCHANGED 1 /* set if status has changed */ #define JOBWANTED 2 /* set if this is a job being sought */ #define JPIPEFAIL 4 /* set if -o pipefail when job created */ diff --git a/bin/sh/main.c b/bin/sh/main.c index 615dd891d95..45b1ad6a786 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.89 2022/09/18 06:03:19 kre Exp $ */ +/* $NetBSD: main.c,v 1.90 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95"; #else -__RCSID("$NetBSD: main.c,v 1.89 2022/09/18 06:03:19 kre Exp $"); +__RCSID("$NetBSD: main.c,v 1.90 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -269,7 +269,7 @@ main(int argc, char **argv) if (sflag == 0 || minusc) { static int sigs[] = { - SIGINT, SIGQUIT, SIGHUP, + SIGINT, SIGQUIT, SIGHUP, #ifdef SIGTSTP SIGTSTP, #endif diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c index 869ee25e3d9..738e7c0b6ef 100644 --- a/bin/sh/memalloc.c +++ b/bin/sh/memalloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.37 2022/05/31 08:43:13 andvar Exp $ */ +/* $NetBSD: memalloc.c,v 1.38 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: memalloc.c,v 1.37 2022/05/31 08:43:13 andvar Exp $"); +__RCSID("$NetBSD: memalloc.c,v 1.38 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -240,7 +240,7 @@ growstackblock(void) /* * Stack marks pointing to the start of the old block - * must be relocated to point to the new block + * must be relocated to point to the new block */ xmark = markp; while (xmark != NULL && xmark->stackp == oldstackp) { diff --git a/bin/sh/mktokens b/bin/sh/mktokens index a8f81c4b563..597ee7db6ec 100644 --- a/bin/sh/mktokens +++ b/bin/sh/mktokens @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: mktokens,v 1.14 2017/07/26 03:46:54 kre Exp $ +# $NetBSD: mktokens,v 1.15 2023/04/07 10:34:13 kre Exp $ # # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. @@ -90,7 +90,7 @@ ${SED} -e 's/"/\\"/g' \ echo '}; ' ${SED} 's/"//g' /tmp/ka$$ | ${AWK} ' -/TWORD/{print "#define KWDOFFSET " NR; print ""; +/TWORD/{print "#define KWDOFFSET " NR; print ""; print "const char *const parsekwd[] = {"} /TIF/,/neverfound/{print " \"" $3 "\","}' echo ' 0 diff --git a/bin/sh/mystring.c b/bin/sh/mystring.c index 3a06c5ddbd0..7d04b302b6e 100644 --- a/bin/sh/mystring.c +++ b/bin/sh/mystring.c @@ -1,4 +1,4 @@ -/* $NetBSD: mystring.c,v 1.19 2022/04/16 14:20:45 kre Exp $ */ +/* $NetBSD: mystring.c,v 1.20 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mystring.c,v 1.19 2022/04/16 14:20:45 kre Exp $"); +__RCSID("$NetBSD: mystring.c,v 1.20 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -115,7 +115,7 @@ number(const char *s) char *ep = NULL; intmax_t n; - if (!is_digit(*s) || ((n = strtoimax(s, &ep, 10)), + if (!is_digit(*s) || ((n = strtoimax(s, &ep, 10)), (ep == NULL || ep == s || *ep != '\0'))) error("Invalid number: '%s'", s); if (n < INT_MIN || n > INT_MAX) diff --git a/bin/sh/output.c b/bin/sh/output.c index 99bd91321b7..a1e5de71b78 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -1,4 +1,4 @@ -/* $NetBSD: output.c,v 1.40 2017/11/21 03:42:39 kre Exp $ */ +/* $NetBSD: output.c,v 1.41 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: output.c,v 1.40 2017/11/21 03:42:39 kre Exp $"); +__RCSID("$NetBSD: output.c,v 1.41 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -409,7 +409,7 @@ doformat(struct output *dest, const char *f, va_list ap) if (s == NULL) error("Could not allocate formatted output buffer"); outstr(s, dest); - free(s); + free(s); #else /* !HAVE_VASPRINTF */ static const char digit[] = "0123456789ABCDEF"; char c; diff --git a/bin/sh/parser.c b/bin/sh/parser.c index b6257349038..0f5b8d072e7 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1,4 +1,4 @@ -/* $NetBSD: parser.c,v 1.179 2022/04/17 21:24:52 andvar Exp $ */ +/* $NetBSD: parser.c,v 1.180 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; #else -__RCSID("$NetBSD: parser.c,v 1.179 2022/04/17 21:24:52 andvar Exp $"); +__RCSID("$NetBSD: parser.c,v 1.180 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -1508,7 +1508,7 @@ parsebackq(VSS *const stack, char * const in, VTRACE(DBG_PARSE|DBG_LEXER, (" produced %d\n", psavelen)); if (psavelen > 0) { pstr = grabstackstr(out); - CTRACE(DBG_LEXER, + CTRACE(DBG_LEXER, ("parsebackq() reprocessing as $(%s)\n", pstr)); setinputstring(pstr, 1, line1); } @@ -2704,7 +2704,7 @@ expandonstack(char *ps, int cmdsub, int lineno) readtoken1(pgetc(), DQSYNTAX, 1); if (backquotelist != NULL) { - if (!cmdsub) + if (!cmdsub) result = ps; else if (!promptcmds) result = "-o promptcmds not set: "; diff --git a/bin/sh/show.c b/bin/sh/show.c index 61a6cf3cbb9..679f7b76664 100644 --- a/bin/sh/show.c +++ b/bin/sh/show.c @@ -1,4 +1,4 @@ -/* $NetBSD: show.c,v 1.54 2021/09/10 22:11:03 rillig Exp $ */ +/* $NetBSD: show.c,v 1.55 2023/04/07 10:34:13 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: show.c,v 1.54 2021/09/10 22:11:03 rillig Exp $"); +__RCSID("$NetBSD: show.c,v 1.55 2023/04/07 10:34:13 kre Exp $"); #endif #endif /* not lint */ @@ -1075,12 +1075,12 @@ static struct debug_flag { { 'w', DBG_WAIT }, /* waits for processes to finish */ { 'x', DBG_EXPAND }, /* word expansion ${} $() $(( )) */ { 'z', DBG_ERRS }, /* error control, jumps, cleanup */ - + { '0', DBG_U0 }, /* ad-hoc temp debug flag #0 */ { '1', DBG_U1 }, /* ad-hoc temp debug flag #1 */ { '2', DBG_U2 }, /* ad-hoc temp debug flag #2 */ { '3', DBG_U3 }, /* ad-hoc temp debug flag #3 */ - + { '@', DBG_LINE }, /* prefix trace lines with line# */ { '$', DBG_PID }, /* prefix trace lines with sh pid */ { '^', DBG_NEST }, /* show shell nesting level */ |
