Commit 24ac1e6f authored by Niels Möller's avatar Niels Möller
Browse files

* src/invert-defs: Improved awk-code to deal with repeated message

numbers. Thanks to bellman.

Rev: src/invert-defs:1.5
parent d0d1814b
...@@ -8,13 +8,16 @@ echo " * Do not edit. */" ...@@ -8,13 +8,16 @@ echo " * Do not edit. */"
echo echo
echo "{" echo "{"
sed -e 's/^#define \(SSH_MSG_[A-Z_0-9][A-Z_0-9]*\)[ \t][ \t]*\([1-9][0-9]*\)[ \t]*$/\2 \1/' -e t -e d \ sed -e 's/^#define SSH_MSG_\([A-Z_0-9][A-Z_0-9]*\)[ \t][ \t]*\([1-9][0-9]*\)[ \t]*$/\2 \1/' -e t -e d \
| sort -nu \ | awk ' { kwds[$1] = kwds[$1] "|" $2; }
| awk 'BEGIN{i=0;} END { for (i = 0; i < 256; i++) {
{ for(j=$1;i<j;i++) print "\"Unknown\"," ; x = kwds[i];
print "\"" $2 "\","; i++;} if (x == "")
END{for(;i<256;i++) print "\"Unknown\",";}' print "\"Unknown\",";
else
print "\"" substr(x, 2) "\",";
}
}'
echo "}" echo "}"
echo echo
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment