From a2322147c78de2e3e5f33902999c0a3c0d198a8b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 27 Aug 2007 18:11:53 +0200 Subject: [PATCH] When calling gzopen(), use "rb" file mode instead of "r". --- ChangeLog | 8 ++++++++ lib/names.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72176f4..6b5905c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-08-27 Martin Mares + + * 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 * lspci.c (show_ht): Added decoding of Hypertransport MSI mapping capability, diff --git a/lib/names.c b/lib/names.c index 6d671d1..eee2f19 100644 --- a/lib/names.c +++ b/lib/names.c @@ -1,7 +1,7 @@ /* * The PCI Library -- ID to Name Translation * - * Copyright (c) 1997--2006 Martin Mares + * Copyright (c) 1997--2007 Martin Mares * * 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) -- 2.39.2