From: Sean Hefty Date: Fri, 17 Dec 2010 20:06:05 +0000 (-0800) Subject: ib_acme: Support range of DLIDs for lookups X-Git-Tag: v1.0.5~19 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=1a80d1d2efa888ad294bac3e681f744555d4e816;p=~shefty%2Fibacm.git ib_acme: Support range of DLIDs for lookups Allow the user to specify multiple DLIDs as part of querying. Signed-off-by: Sean Hefty --- diff --git a/src/parse.c b/src/parse.c index e90fb09..d1c820f 100644 --- a/src/parse.c +++ b/src/parse.c @@ -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);