[PATCH v3 59/60] loader: skip leading whitespace in USB/PCI ids strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When parsing the usb.ids & pci.ids files, we must skip any
leading whitespace in the vendor/device/subsystem strings.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 osinfo/osinfo_loader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 8a21a1b..30546b4 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1725,7 +1725,9 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
             goto done;                          \
         }
 #define WANT_REST(var)                          \
-        (var) = tmp+offset
+        (var) = tmp+offset;                     \
+        while (*(var) == ' ')                   \
+            (var)++
 
         if (GOT_TAB()) {
             offset++;
-- 
2.4.3

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux