From: Keith Packard Date: Fri, 26 Feb 2010 00:33:34 +0000 (-0800) Subject: Allow product names to have suffixes (like board revisions) X-Git-Tag: debian/0.6+106+ga1478f6~8 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=1e60deca147c85a064719dfad14ccabd1049bbbd;hp=f4d5790a284e2d02dd7568fbca90402fa5ed1aea Allow product names to have suffixes (like board revisions) When looking for a board by product name, just look at the prefix of the name instead of requiring an exact match. This will allow products to have board version suffixes. Signed-off-by: Keith Packard --- diff --git a/ao-tools/lib/cc-usbdev.c b/ao-tools/lib/cc-usbdev.c index ed39c062..afa91d49 100644 --- a/ao-tools/lib/cc-usbdev.c +++ b/ao-tools/lib/cc-usbdev.c @@ -258,7 +258,7 @@ match_dev(char *product, int serial) return NULL; for (i = 0; i < devs->ndev; i++) { dev = devs->dev[i]; - if (product && strcmp (product, dev->product) != 0) + if (product && strncmp (product, dev->product, strlen(product)) != 0) continue; if (serial && serial != dev->serial) continue;