Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh The great shell trailing whitespace cleanup of 2023...



details:   https://anonhg.NetBSD.org/src/rev/a7cca7858356
branches:  trunk
changeset: 374175:a7cca7858356
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Apr 07 10:34:13 2023 +0000

description:
The great shell trailing whitespace cleanup of 2023...
Inspired by private e-mail comments from mouse@

NFCI.

diffstat:

 bin/sh/eval.c      |   8 ++++----
 bin/sh/funcs/dirs  |   6 +++---
 bin/sh/funcs/popd  |   6 +++---
 bin/sh/funcs/pushd |   6 +++---
 bin/sh/histedit.c  |   6 +++---
 bin/sh/jobs.c      |  11 +++++------
 bin/sh/jobs.h      |   4 ++--
 bin/sh/main.c      |   6 +++---
 bin/sh/memalloc.c  |   6 +++---
 bin/sh/mktokens    |   4 ++--
 bin/sh/mystring.c  |   6 +++---
 bin/sh/output.c    |   6 +++---
 bin/sh/parser.c    |   8 ++++----
 bin/sh/show.c      |   8 ++++----
 14 files changed, 45 insertions(+), 46 deletions(-)

diffs (truncated from 397 to 300 lines):

diff -r 19ac525794b2 -r a7cca7858356 bin/sh/eval.c
--- a/bin/sh/eval.c     Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/eval.c     Fri Apr 07 10:34:13 2023 +0000
@@ -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 functi
 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, s
        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 -r 19ac525794b2 -r a7cca7858356 bin/sh/funcs/dirs
--- a/bin/sh/funcs/dirs Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/funcs/dirs Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/funcs/popd
--- a/bin/sh/funcs/popd Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/funcs/popd Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/funcs/pushd
--- a/bin/sh/funcs/pushd        Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/funcs/pushd        Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/histedit.c
--- a/bin/sh/histedit.c Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/histedit.c Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/jobs.c     Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/jobs.h
--- a/bin/sh/jobs.h     Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/jobs.h     Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/main.c
--- a/bin/sh/main.c     Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/main.c     Fri Apr 07 10:34:13 2023 +0000
@@ -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 @@
 #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 -r 19ac525794b2 -r a7cca7858356 bin/sh/memalloc.c
--- a/bin/sh/memalloc.c Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/memalloc.c Fri Apr 07 10:34:13 2023 +0000
@@ -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 -r 19ac525794b2 -r a7cca7858356 bin/sh/mktokens
--- a/bin/sh/mktokens   Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/mktokens   Fri Apr 07 10:34:13 2023 +0000
@@ -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 @@ const char *const tokname[] = {'
 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 -r 19ac525794b2 -r a7cca7858356 bin/sh/mystring.c
--- a/bin/sh/mystring.c Fri Apr 07 09:39:48 2023 +0000
+++ b/bin/sh/mystring.c Fri Apr 07 10:34:13 2023 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index