]> git.draconx.ca Git - dxcommon.git/blobdiff - scripts/gen-options.awk
Explicitly test for empty strings in awk scripts.
[dxcommon.git] / scripts / gen-options.awk
index f2cdfe7825ab6f600334a7bb76fbe32408b6f1a4..98b7c17119988438797bddfc3ae5963357abf174 100755 (executable)
@@ -213,11 +213,10 @@ $0 ~ /^-/ {
 }
 
 # Ignore any line beginning with a #
-$0 ~ /^#/ { next }
+$0 ~ /^#/ { next; }
 
-lopt {
-  sub(/^[ \t]*/, "")
-  if (!$0) { next }
+NF && lopt != "" {
+  sub(/^[ \t]*/, "");
 
   if (lopt in optionhelp)
     $0 = "\n" $0;