Bug 256

Summary: sr_parse_triggerstring matches probe names against a prefix of the input
Product: libsigrok Reporter: Marcus Comstedt <marcus>
Component: APIAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal CC: bert
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Marcus Comstedt 2014-01-07 21:02:19 CET
If a probe has name "FOO", then sr_parse_triggerstring will consider any string which starts with "FOO" to be a match for this probe.  So you can type FOOBAR=r or FOO77=f or whatever.

This becomes especially troublesome when the probes have names like "0" through "15", because the input string "12" will match probe "1", and not "12" as intended.
Comment 1 Bert Vermeulen 2014-01-29 16:28:17 CET
Do you have a commandline example?
Comment 2 Marcus Comstedt 2014-01-29 16:52:46 CET
Well, something like

sigrok-cli --driver=ols -t 25=1

would set the trigger on probe 2 instead of 25.

(Why do you ask for examples if you decided not to fix the bug?)
Comment 3 Bert Vermeulen 2014-01-29 22:09:22 CET
I just wanted an example that demonstrates it, this is sort of vague as a bug report otherwise. I'd expected you to reopen when you provided one.

So yes, I can see the problem now, reopening.