]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
When calling gzopen(), use "rb" file mode instead of "r".
authorMartin Mares <mj@ucw.cz>
Mon, 27 Aug 2007 16:11:53 +0000 (18:11 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 27 Aug 2007 16:11:53 +0000 (18:11 +0200)
ChangeLog
lib/names.c

index 72176f4bb6fa38434884b8f120fb29be9ea43401..6b5905cbbd781366e2943f13f306503deed11afb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-27  Martin Mares  <mj@ucw.cz>
+
+       * lib/names.c (pci_open): When calling gzopen(), use "rb" file mode
+       instead of "r". This is needed on DOS systems, where this function
+       somewhat illogically uses the binary flag for the compressed file
+       instead of the decompressed stream inside, where binariness really
+       matters.
+
 2007-08-14  Martin Mares  <mj@ucw.cz>
 
        * lspci.c (show_ht): Added decoding of Hypertransport MSI mapping capability,
index 6d671d102f6653c5408122f4ef7e2afa4ba659ca..eee2f19b6edbb3cc82b3d388480a790cbab1fa3e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     The PCI Library -- ID to Name Translation
  *
- *     Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2007 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -26,7 +26,7 @@ static pci_file pci_open(struct pci_access *a)
   size_t len;
   char *new_name;
 
-  result = gzopen(a->id_file_name, "r");
+  result = gzopen(a->id_file_name, "rb");
   if (result)
     return result;
   len = strlen(a->id_file_name);
@@ -36,7 +36,7 @@ static pci_file pci_open(struct pci_access *a)
   memcpy(new_name, a->id_file_name, len - 3);
   new_name[len - 3] = 0;
   pci_set_name_list_path(a, new_name, 1);
-  return gzopen(a->id_file_name, "r");
+  return gzopen(a->id_file_name, "rb");
 }
 
 #define pci_close(f)           gzclose(f)