aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ndiscvt
diff options
context:
space:
mode:
authorWeongyo Jeong <weongyo@FreeBSD.org>2008-06-18 06:35:37 +0000
committerWeongyo Jeong <weongyo@FreeBSD.org>2008-06-18 06:35:37 +0000
commit8759b840e6ccf7b891d493c0994d62bf55d2faeb (patch)
tree5213c24a3c69ec8e15d41d72ac06490d4774338b /usr.sbin/ndiscvt
parent7a4a5cc0f4217d18eb068ab417e94ef061657ac4 (diff)
downloadsrc-8759b840e6ccf7b891d493c0994d62bf55d2faeb.tar.gz
src-8759b840e6ccf7b891d493c0994d62bf55d2faeb.zip
handle .INF files for PCMCIA correctly that specify multiple entries in
their [Manufacturer] sections and prevent a case that NDIS_PCI_DEV_TABLE definition was always emitted that it's only emitted once if a .INF file is for PCI.
Notes
Notes: svn path=/head/; revision=179855
Diffstat (limited to 'usr.sbin/ndiscvt')
-rw-r--r--usr.sbin/ndiscvt/inf.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/ndiscvt/inf.c b/usr.sbin/ndiscvt/inf.c
index ef1892f0c143..05f863de9bbe 100644
--- a/usr.sbin/ndiscvt/inf.c
+++ b/usr.sbin/ndiscvt/inf.c
@@ -258,10 +258,7 @@ dump_deviceids_pci()
struct section *sec;
struct assign *assign;
char xpsec[256];
- int found = 0;
-
- /* Emit start of PCI device table */
- fprintf (ofp, "#define NDIS_PCI_DEV_TABLE");
+ int first = 1, found = 0;
/* Find manufacturer name */
manf = find_assign("Manufacturer", NULL);
@@ -298,6 +295,12 @@ nextmanf:
found = 0;
+ if (first == 1) {
+ /* Emit start of PCI device table */
+ fprintf (ofp, "#define NDIS_PCI_DEV_TABLE");
+ first = 0;
+ }
+
retry:
/*
@@ -348,7 +351,7 @@ dump_deviceids_pcmcia()
struct section *sec;
struct assign *assign;
char xpsec[256];
- int found = 0;
+ int first = 1, found = 0;
/* Find manufacturer name */
manf = find_assign("Manufacturer", NULL);
@@ -385,8 +388,11 @@ nextmanf:
found = 0;
- /* Emit start of PCMCIA device table */
- fprintf (ofp, "#define NDIS_PCMCIA_DEV_TABLE");
+ if (first == 1) {
+ /* Emit start of PCMCIA device table */
+ fprintf (ofp, "#define NDIS_PCMCIA_DEV_TABLE");
+ first = 0;
+ }
retry: