From 1e60deca147c85a064719dfad14ccabd1049bbbd Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 Feb 2010 16:33:34 -0800 Subject: [PATCH] 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 --- ao-tools/lib/cc-usbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2