lsearch, switch: fix -regexp case with option-like pattern
commita6c24e9c1a78da2ae9a5d5e6a110f26da40ac143
authorSteve Bennett <steveb@workware.net.au>
Wed, 6 May 2020 23:21:23 +0000 (7 09:21 +1000)
committerSteve Bennett <steveb@workware.net.au>
Wed, 6 May 2020 23:23:37 +0000 (7 09:23 +1000)
tree87f009623110e373dceb5fc082e62147ffcf2aa1
parent659f043196f313c69e32876e3641d0865a1e49cd
lsearch, switch: fix -regexp case with option-like pattern

If the pattern begins with -, the internal invocation of regexp
will treat the pattern as an option. Fix this by adding -- to the
internal invocation of regexp.

Fixes #154

Reported-by: Barry Arthur <barry.arthur@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
jim.c
jim.h
tests/jim.test
tests/lsearch.test