Module Name:    src
Committed By:   kre
Date:           Mon Jun 19 11:55:07 UTC 2017

Modified Files:
        src/bin/sh: mknodenames.sh

Log Message:
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.)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/mknodenames.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/mknodenames.sh
diff -u src/bin/sh/mknodenames.sh:1.3 src/bin/sh/mknodenames.sh:1.4
--- src/bin/sh/mknodenames.sh:1.3	Sun Mar 27 14:34:46 2016
+++ src/bin/sh/mknodenames.sh	Mon Jun 19 11:55:07 2017
@@ -7,7 +7,7 @@ fi
 
 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
 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" ]

Reply via email to