From: Bert Vermeulen Date: Tue, 21 Jan 2014 17:16:52 +0000 (+0100) Subject: Don't mention non-logic probes in session file metadata. X-Git-Tag: libsigrok-0.3.0~214 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=eca2f8521333b7d259cc110e025d915b50aa384c Don't mention non-logic probes in session file metadata. They don't get saved anyway, and are very confusing to clients. --- diff --git a/session_file.c b/session_file.c index 6a28a17b..545abcfd 100644 --- a/session_file.c +++ b/session_file.c @@ -253,11 +253,14 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi, cnt = 0; for (l = sdi->probes; l; l = l->next) { probe = l->data; - if (probe->enabled) { - if (probe->name) - /* Just borrowing the ptr. */ - probe_names[cnt++] = probe->name; - } + if (probe->type != SR_PROBE_LOGIC) + continue; + if (probe->enabled != TRUE) + continue; + if (!probe->name) + continue; + /* Just borrowing the ptr. */ + probe_names[cnt++] = probe->name; } if ((ret = sr_session_save_init(filename, samplerate, probe_names)) != SR_OK)