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

Daniel P. Berrange berrange at redhat.com
Mon Oct 12 17:11:20 UTC 2015


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 at redhat.com>
---
 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




More information about the Libosinfo mailing list