Source-Changes-HG archive

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

[src/netbsd-9]: src/bin/ksh Pull up following revision(s) (requested by chris...



details:   https://anonhg.NetBSD.org/src/rev/b2aaa6adbdb5
branches:  netbsd-9
changeset: 953031:b2aaa6adbdb5
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 23 18:53:31 2021 +0000

description:
Pull up following revision(s) (requested by christos in ticket #1212):

        bin/ksh/siglist.sh: revision 1.13

PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)

diffstat:

 bin/ksh/siglist.sh |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r fa18a2ca6c7e -r b2aaa6adbdb5 bin/ksh/siglist.sh
--- a/bin/ksh/siglist.sh        Tue Feb 23 18:50:21 2021 +0000
+++ b/bin/ksh/siglist.sh        Tue Feb 23 18:53:31 2021 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: siglist.sh,v 1.12 2016/03/17 13:59:02 christos Exp $
+#      $NetBSD: siglist.sh,v 1.12.18.1 2021/02/23 18:53:31 martin Exp $
 #
 # Script to generate a sorted, complete list of signals, suitable
 # for inclusion in trap.c as array initializer.
@@ -21,16 +21,17 @@
 # The trap here to make up for a bug in bash (1.14.3(1)) that calls the trap
 (trap $trapsigs;
  echo '#include "sh.h"';
- echo '        { QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },';
+ echo ' { QwErTy /* dummy for sed sillies */ },';
  ${SED} -e '/^[         ]*#/d' -e 's/^[         ]*\([^         ][^     ]*\)[    ][      ]*\(.*[^       ]\)[    ]*$/#ifdef SIG\1\
        { QwErTy .signal = SIG\1 , .name = "\1", .mess = "\2" },\
 #endif/') > $in
-# work around for gcc 5
+echo ' { QwErTy .signal = SIGNALS , .name = "DUMMY", .mess = "hook to expand array to total signals" },' >> $in
+# work around for gcc > 5
 $CPP $in | grep -v '^#' | tr -d '\n' | ${SED} 's/},/},\
 /g' > $out
 ${SED} -n 's/{ QwErTy/{/p' < $out | ${AWK} '{print NR, $0}' | sort -k 5n -k 1n |
-    ${SED} 's/^[0-9]* //' |
-    ${AWK} 'BEGIN { last=0; nsigs=0; }
+    ${SED} -E -e 's/^[0-9]* //' -e 's/ +/ /' |
+    ${AWK} 'BEGIN { last=0; }
        {
            if ($4 ~ /^[0-9][0-9]*$/ && $5 == ",") {
                n = $4;



Home | Main Index | Thread Index | Old Index