lpereira/hardinfo — pull request #10 by georgeAtEditShare (2013-03-05 19:55:45+00:00)
Title: Fix USB device parsing

This creates a temporary file with the lsusb information, which allows
fseek to work properly.

The program reads its data from lsusb's output. The function `__scan_usb_lsusb` calls another function `__scan_usb_lsusb_add_device` to parse each individual usb device. When it reaches the beginning of the next block (whch starts with "Bus ") it attempts to rewind a little bit and return control back to `__scan_usb_lsusb` so it can detect this substring again. Since the rewinding doesn't work, it skips listing every other USB device.

This commit comes from my company EditShare. Thanks!