]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names.c
More Windows stuff.
[pciutils.git] / lib / names.c
index 896f7c1df23199cddd40f756935c49fd6f9039b1..01f141781dd0ba6ef6c5d2b9af0a829b6be4a5ef 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *     $Id: names.c,v 1.7 2002/03/24 12:14:40 mj Exp $
- *
  *     The PCI Library -- ID to Name Translation
  *
- *     Copyright (c) 1997--2002 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ *     Copyright (c) 1997--2002 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -98,19 +96,10 @@ parse_name_list(struct pci_access *a)
       lino++;
       q = p;
       while (*p && *p != '\n')
-       {
-         if (*p == '#')
-           {
-             *p++ = 0;
-             while (*p && *p != '\n')
-               p++;
-             break;
-           }
-         p++;
-       }
+       p++;
       if (*p == '\n')
        *p++ = 0;
-      if (!*q)
+      if (!*q || *q == '#')
        continue;
       r = p;
       while (r > q && r[-1] == ' ')
@@ -284,7 +273,7 @@ pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, u32 arg1,
       if (n = nl_lookup(a, num, NL_VENDOR, arg3, 0, 0, 0))
        return n->name;
       else
-       res = snprintf(buf, size, "%04x", arg2);
+       res = snprintf(buf, size, "%04x", arg3);
       break;
     case PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM:
       if (n = nl_lookup(a, num, NL_SUBSYSTEM, arg1, arg2, arg3, arg4))