From efe54e593f51a0aea33466031a0181c9c28da6a1 Mon Sep 17 00:00:00 2001 From: weongyo Date: Wed, 18 Jun 2008 06:35:37 +0000 Subject: 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. --- usr.sbin/ndiscvt/inf.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ndiscvt/inf.c b/usr.sbin/ndiscvt/inf.c index ef1892f..05f863d 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: -- cgit v1.1