summaryrefslogtreecommitdiff
path: root/sys/dev/mca/devlist2h.awk
diff options
context:
space:
mode:
authorjmc <jmc@NetBSD.org>2003-12-15 07:32:20 +0000
committerjmc <jmc@NetBSD.org>2003-12-15 07:32:20 +0000
commit43bf89bfc649acef57475def27b6ac3d55e6d60e (patch)
tree6a2ca1258f87c63d7124c3b27e00cd156d37b103 /sys/dev/mca/devlist2h.awk
parent9efe6a53664913e02f852106edda3b481b0d0203 (diff)
Fixes from PR#23177. Various lint/logic fixes:
Fix some non-initialized variables close the output files when done Redo the printing for RCS strings so they don't expand in the awk script too Do proper tests for variables existance before accessing Verified output from all scripts is identical to original versions
Diffstat (limited to 'sys/dev/mca/devlist2h.awk')
-rw-r--r--sys/dev/mca/devlist2h.awk12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/mca/devlist2h.awk b/sys/dev/mca/devlist2h.awk
index 258b462252c..5fa567715b2 100644
--- a/sys/dev/mca/devlist2h.awk
+++ b/sys/dev/mca/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $NetBSD: devlist2h.awk,v 1.1 2000/05/11 15:42:04 jdolecek Exp $
+# $NetBSD: devlist2h.awk,v 1.2 2003/12/15 07:32:20 jmc Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
# All rights reserved.
@@ -33,7 +33,7 @@
# Adapted for MCA needs by Jaromir Dolecek.
BEGIN {
- nproducts = nvendors = 0
+ nproducts = nvendors = blanklines = 0
dfile="mcadevs_data.h"
hfile="mcadevs.h"
FS=" "
@@ -44,7 +44,7 @@ NR == 1 {
VERSION = $0
gsub("\\$", "", VERSION)
- printf("/*\t\$NetBSD\$\t*/\n\n") > dfile
+ printf("/*\t$NetBSD" "$\t*/\n\n") > dfile
printf("/*\n") > dfile
printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
> dfile
@@ -53,7 +53,7 @@ NR == 1 {
printf(" *\t%s\n", VERSION) > dfile
printf(" */\n") > dfile
- printf("/*\t\$NetBSD\$\t*/\n\n") > hfile
+ printf("/*\t$NetBSD" "$\t*/\n\n") > hfile
printf("/*\n") > hfile
printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
> hfile
@@ -65,7 +65,7 @@ NR == 1 {
next
}
-$1 == "product" {
+NF > 0 && $1 == "product" {
nproducts++
alias = $3
@@ -110,4 +110,6 @@ END {
}
printf(" { 0, NULL, }\n") > dfile
printf("};\n") > dfile
+ close(dfile)
+ close(hfile)
}