X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=parsers.c;h=d575dce076c83660a0107d53884b4cade36b8b80;hp=e94041764c36bc5ccf7034a7afe6f16b611aefd7;hb=72db8c56417114b50c2f7aa08d71a0ab79672ef4;hpb=8ec203864b3a33b731c591034d06d55998210a79
diff --git a/parsers.c b/parsers.c
index e940417..d575dce 100644
--- a/parsers.c
+++ b/parsers.c
@@ -17,13 +17,12 @@
* along with this program. If not, see .
*/
+#include "sigrok-cli.h"
#include
#include
#include
#include
#include
-#include
-#include "sigrok-cli.h"
struct sr_probe *find_probe(GSList *probelist, const char *probename)
{
@@ -49,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;
@@ -121,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;
}
@@ -128,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;
}
@@ -138,8 +139,7 @@ range_fail:
}
probelist = g_slist_append(probelist, probe);
- if (names)
- g_strfreev(names);
+ g_strfreev(names);
}
}
@@ -183,7 +183,7 @@ GHashTable *parse_generic_arg(const char *arg, gboolean sep_first)
return hash;
}
-char *strcanon(const char *str)
+static char *strcanon(const char *str)
{
int p0, p1;
char *s;