X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=parsers.c;h=d575dce076c83660a0107d53884b4cade36b8b80;hp=f587f8d0e9da6701083a16283de0992e64b51c8f;hb=426d0cdaa91051c30d45055b3c10662fd392ea5a;hpb=20fb52e08416238c60392b410f69856cc7d98650 diff --git a/parsers.c b/parsers.c index f587f8d..d575dce 100644 --- a/parsers.c +++ b/parsers.c @@ -24,7 +24,7 @@ #include #include -static struct sr_probe *find_probe(GSList *probelist, const char *probename) +struct sr_probe *find_probe(GSList *probelist, const char *probename) { struct sr_probe *probe; GSList *l; @@ -48,8 +48,8 @@ GSList *parse_probestring(struct sr_dev_inst *sdi, const char *probestring) char **tokens, **range, **names, *eptr, str[8]; if (!probestring || !probestring[0]) - /* All probes are enabled by default by the driver. */ - return NULL; + /* Use all probes by default. */ + return g_slist_copy(sdi->probes); ret = SR_OK; range = NULL; @@ -120,6 +120,7 @@ range_fail: if (!names[0] || (names[1] && names[2])) { /* Need one or two arguments. */ g_critical("Invalid probe '%s'.", tokens[i]); + g_strfreev(names); ret = SR_ERR; break; } @@ -127,6 +128,7 @@ range_fail: probe = find_probe(sdi->probes, names[0]); if (!probe) { g_critical("unknown probe '%s'.", names[0]); + g_strfreev(names); ret = SR_ERR; break; } @@ -137,8 +139,7 @@ range_fail: } probelist = g_slist_append(probelist, probe); - if (names) - g_strfreev(names); + g_strfreev(names); } }