lsusb icon indicating copy to clipboard operation
lsusb copied to clipboard

handle empty bus_num

Open adzierzanowski opened this issue 4 years ago • 2 comments

When $bus_num is empty (e.g. in case of 05ac:8102 Apple Inc. Apple T2 Bus), the script throws the following error:

/usr/local/bin/lsusb: line 89: 16#: invalid integer constant (error token is "16#")

because it is not possible to treat an empty variable as a hexadecimal and convert it into an integer. My fix handles the situation by printing --- when the bus number is not provided.

adzierzanowski avatar Aug 07 '21 15:08 adzierzanowski

@jlhonora, can this be merged?

reitermarkus avatar May 31 '22 19:05 reitermarkus

This is the same problem fixed - in a different way - in https://github.com/jlhonora/lsusb/issues/18 also, so if you merge this one you can get a two-fer. #18 was a confirmed fix for the version I installed via homebrew.

robertlipe avatar Oct 03 '22 06:10 robertlipe