]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
ib_acme: Support range of DLIDs for lookups
authorSean Hefty <sean.hefty@intel.com>
Fri, 17 Dec 2010 20:06:05 +0000 (12:06 -0800)
committerSean Hefty <sean.hefty@intel.com>
Fri, 17 Dec 2010 23:19:46 +0000 (15:19 -0800)
Allow the user to specify multiple DLIDs as part of
querying.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/parse.c

index e90fb0955eb53e3ac1bc723b89a63d3a465804b7..d1c820ffc8b72fe38aeeeb37ffa5889bba1d7243 100644 (file)
@@ -80,8 +80,15 @@ char **parse(char *args, int *count)
        cpy = malloc(strlen(args) + 1);
        strcpy(cpy, args);
 
-       token = strtok(cpy, "[");
-       next = strtok(NULL, "]");
+       if (args[0] == '[') {
+               cpy[0] = '\0';
+               token = cpy;
+               next = strtok(cpy + 1, "]");
+       } else {
+               token = strtok(cpy, "[");
+               next = strtok(NULL, "]");
+       }
+
        if (!next) {
                str_size = strlen(token) + 1;
                str_buf = malloc(str_size);