X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstrutil.c;h=382708936244ba9a3f0b2aa0972c66fab12177c2;hb=ca314e060f653e6a0b5ec0f58914bac4d426217f;hp=72378d4a2942d5dd7f411e35d41ffb7a01b9a183;hpb=9a17c23bc9810206eae7741bc4b35bc4d78999d3;p=libsigrok.git diff --git a/src/strutil.c b/src/strutil.c index 72378d4a..38270893 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -555,8 +555,13 @@ SR_API uint64_t sr_parse_timestring(const char *timestring) /** @since 0.1.0 */ SR_API gboolean sr_parse_boolstring(const char *boolstr) { - if (!boolstr) - return FALSE; + /* + * Complete absence of an input spec is assumed to mean TRUE, + * as in command line option strings like this: + * ...:samplerate=100k:header:numchannels=4:... + */ + if (!boolstr || !*boolstr) + return TRUE; if (!g_ascii_strncasecmp(boolstr, "true", 4) || !g_ascii_strncasecmp(boolstr, "yes", 3) ||