Source-Changes-HG archive

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

[src/trunk]: src/bin/sh It is amazing what nonsense appears to work sometimes...



details:   https://anonhg.NetBSD.org/src/rev/08dace5acd06
branches:  trunk
changeset: 824810:08dace5acd06
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jun 19 11:55:07 2017 +0000

description:
It is amazing what nonsense appears to work sometimes... (all my nonsense too!)

Two bugs here, one benign because of the way the script is used.
The other hidden by NetBSD's sort being stable, and the data not really
requiring sorting at all...

So as it happens these fixes change nothing, but they are needed anyway.

(The contents of the generated file are only used in DEBUG shells, so
this is really even less important than it seems.)

diffstat:

 bin/sh/mknodenames.sh |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 02381b065b14 -r 08dace5acd06 bin/sh/mknodenames.sh
--- a/bin/sh/mknodenames.sh     Mon Jun 19 10:59:01 2017 +0000
+++ b/bin/sh/mknodenames.sh     Mon Jun 19 11:55:07 2017 +0000
@@ -7,7 +7,7 @@
 
 NODES=$1
 
-test -t 1 && -z "$2" && exec > nodenames.h
+test -t 1 && test -z "$2" && exec > nodenames.h
 
 echo "#ifdef DEBUG"
 echo '
@@ -28,7 +28,7 @@
 echo '#ifdef DEFINE_NODENAMES'
 echo "STATIC const char * const NodeNames[${MAX} + 1] = {"
 
-grep '^#define' "$NODES" | sort -k2n | while read define name number opt_comment
+grep '^#define' "$NODES" | sort -k3n | while read define name number opt_comment
 do
        : ${next:=0}
        while [ "$number" -gt "$next" ]



Home | Main Index | Thread Index | Old Index