Overview
| Artifact ID: | 18170cea48b4e42142900732e455f2206001a9376a35b7e44707556bd871304a |
|---|---|
| Ticket: | af3ebc5fafe0097cb93f0304cd4b7676831a706e
clock scan and clock add bugs in error cases / with abbreviated options |
| User & Date: | pointsman on 2023-05-22 11:57:25 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed to:
The clock command - as the other core commands - supports abbreviated options. Due to deficiencies in the Tcl code in library/clock.tcl this does not work as expected in some error cases. Example clock scan 1970-01-01 -format %Y-%m-%d -gmt true -timezone :Europe/Berlin ==> cannot use -gmt and -timezone in same call as the documentation say and is expected. Though clock scan 1970-01-01 -format %Y-%m-%d -g true -timezone :Europe/Berlin ==> 0 returns a result without error. Looking at [https://core.tcl-lang.org/tcl/file?udc=1&ln=1209-1242&ci=586f490293ce298c&name=library%2Fclock.tcl] (thats from core-8-6-branch, any later up to trunk has the same code) it is pretty clear what happens. In the foreach loop the option as given (even in abbreviated form) is used as key but the tests later on test only for the full option name. Other examples of erroneous option processing than the example above can easily found with this observation. With the clock add command it is even a bit worser. Look at [https://core.tcl-lang.org/tcl/file?udc=1&ln=4240-4288&ci=586f490293ce298c&name=library%2Fclock.tcl] In the part following the comment "# Check options for validity" the existence of saw(-gmt) and saw(-timezone) is tested but the saw array isn't set in any case by the code above - the test will never fire.
- foundin changed to: "8.6 - 9.0"
- is_private changed to: "0"
- login: "pointsman"
- priority changed to: "5 Medium"
- private_contact changed to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pointsman"
- subsystem changed to: "16. Commands A-H"
- title changed to:
clock scan and clock add bugs in error cases / with abbreviated options
- type changed to: "Bug"