Overview
| Artifact ID: | ae26d49811b151068bae186b82fb1e2aa48429f15ef5cb7107272891a64a0479 |
|---|---|
| Ticket: | 697b1bbfe3387b8f777e55d4aba9a4e20833e8ed
Incorrect argument handling by [regexp] |
| User & Date: | serhiy.storchaka on 2026-10-10 21:12:12 |
Changes
- icomment:
Still the same in 8.6, 9.0 and 9.1. Cases #1, #3 and #5 are correct: an argument starting with "-" is taken as an option unless it follows <tt>--</tt>. #2 and #4 differ from the command only in compiled code: the bytecode compiler checked for a leading "-" only in words without backslashes, so <tt>\-</tt> and <tt>-\\</tt> were compiled as patterns. #6 (a pattern in a variable) is the same problem as [1902890fff]. Proposed fix for #2 and #4 in branch [/timeline?r=regexp-compile-dash-pattern|regexp-compile-dash-pattern]: the compiler checks the value of any word known at compile time, as for <tt>regsub</tt>, so both now give "bad option" as in #1. Tests regexpComp-24.12 to 24.15.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"