summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-01-23 22:28:22 +0000
committerwpaul <wpaul@FreeBSD.org>2004-01-23 22:28:22 +0000
commit4fe8f1d3a6f83aff0437ca6d1542de52fd4671a7 (patch)
tree8b3ab638258eecc69b318f8b6b6e0959b4c64e8f
parent0592926b471595a34b1a47c19cca659c664de37c (diff)
downloadFreeBSD-src-4fe8f1d3a6f83aff0437ca6d1542de52fd4671a7.zip
FreeBSD-src-4fe8f1d3a6f83aff0437ca6d1542de52fd4671a7.tar.gz
Deal with keys with descriptions that have empty fields in some of
their lines. Properly discard PCMCIA device declarations. I plan to support PCMCIA cards, but they don't work yet, and it appears some .INF files declare both PCI and PCMCIA device instances.
-rw-r--r--usr.sbin/ndiscvt/inf.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ndiscvt/inf.c b/usr.sbin/ndiscvt/inf.c
index 1ac5336..f0cacee 100644
--- a/usr.sbin/ndiscvt/inf.c
+++ b/usr.sbin/ndiscvt/inf.c
@@ -215,8 +215,9 @@ dump_deviceids()
/* Emit device IDs. */
if (strcasestr(assign->vals[1], "PCI") != NULL)
dump_pci_id(assign->vals[1]);
-#ifdef notdef
else if (strcasestr(assign->vals[1], "PCMCIA") != NULL)
+ continue;
+#ifdef notdef
dump_pcmcia_id(assign->vals[1]);
#endif
/* Emit device description */
@@ -256,7 +257,8 @@ dump_addreg(const char *s, int devidx)
stringcvt(reg->value), devidx);
} else if (strncasecmp(reg->subkey,
"Ndi\\params", strlen("Ndi\\params")-1) == 0 &&
- strcasecmp(reg->key, "ParamDesc") == 0)
+ (reg->key != NULL && strcasecmp(reg->key,
+ "ParamDesc") == 0))
dump_paramreg(sec, reg, devidx);
}
}
@@ -292,6 +294,8 @@ dump_editreg(const struct section *s, const struct reg *r)
continue;
if (reg->subkey == NULL || strcasecmp(reg->subkey, r->subkey))
continue;
+ if (reg->key == NULL)
+ continue;
if (strcasecmp(reg->key, "LimitText") == 0)
fprintf(ofp, " [maxchars=%s]", reg->value);
if (strcasecmp(reg->key, "Optional") == 0 &&
@@ -312,6 +316,8 @@ dump_dwordreg(const struct section *s, const struct reg *r)
continue;
if (reg->subkey == NULL || strcasecmp(reg->subkey, r->subkey))
continue;
+ if (reg->key == NULL)
+ continue;
if (strcasecmp(reg->key, "min") == 0)
fprintf(ofp, " [min=%s]", reg->value);
if (strcasecmp(reg->key, "max") == 0)
@@ -329,7 +335,7 @@ dump_defaultinfo(const struct section *s, const struct reg *r, int devidx)
continue;
if (reg->subkey == NULL || strcasecmp(reg->subkey, r->subkey))
continue;
- if (strcasecmp(reg->key, "Default"))
+ if (reg->key == NULL || strcasecmp(reg->key, "Default"))
continue;
fprintf(ofp, "\n\t{ \"%s\" }, %d },", reg->value == NULL ? "" :
stringcvt(reg->value), devidx);
@@ -347,7 +353,7 @@ dump_paramdesc(const struct section *s, const struct reg *r)
continue;
if (reg->subkey == NULL || strcasecmp(reg->subkey, r->subkey))
continue;
- if (strcasecmp(reg->key, "ParamDesc"))
+ if (reg->key == NULL || strcasecmp(reg->key, "ParamDesc"))
continue;
fprintf(ofp, "\n\t\"%s", stringcvt(r->value));
break;
@@ -364,6 +370,8 @@ dump_typeinfo(const struct section *s, const struct reg *r)
continue;
if (reg->subkey == NULL || strcasecmp(reg->subkey, r->subkey))
continue;
+ if (reg->key == NULL)
+ continue;
if (strcasecmp(reg->key, "type"))
continue;
if (strcasecmp(reg->value, "dword") == 0 ||
OpenPOWER on IntegriCloud