|
2026-10-21
| ||
| 10:03 | • Closed ticket [63e15dab99]: clock scan ignores certain abbreviated options p... artifact: f1449335fc user: serhiy.storchaka | |
|
2023-06-05
| ||
| 09:51 | • Closed ticket [af3ebc5faf]: clock scan and clock add bugs in error cases / with ... artifact: 919e70d3ef user: pointsman | |
|
2023-06-03
| ||
| 19:51 | Fix [af3ebc5fafe0097c]: clock scan and clock add bugs in error cases / with abbreviated options check-in: 72f78b6085 user: jan.nijtmans tags: core-8-6-branch | |
|
2023-06-02
| ||
| 22:23 | • Ticket [af3ebc5faf] clock scan and clock add bugs in error cases / with abbrevia... artifact: 0731ee1694 user: jan.nijtmans | |
|
2023-05-23
| ||
| 07:28 | • Ticket [af3ebc5faf]: 4 changes artifact: f202e06e13 user: oehhar | |
|
2023-05-22
| ||
| 21:10 | • Ticket [af3ebc5faf]: 3 changes artifact: a63aa79597 user: pointsman | |
| 15:04 | • Ticket [af3ebc5faf]: 4 changes artifact: 07ef317947 user: oehhar | |
| 12:19 | • Ticket [af3ebc5faf]: 3 changes artifact: b7986ca10d user: pointsman | |
| 12:17 | Proposed fix for [af3ebc5fafe0]. closed check-in: 827cc031bc user: pointsman tags: bug-af3ebc5fafe0 | |
| 11:57 | • New ticket [af3ebc5faf] clock scan and clock add bugs in error cases / with abbr... artifact: 18170cea48 user: pointsman | |
| Ticket UUID: | af3ebc5fafe0097cb93f0304cd4b7676831a706e | ||
| Title: | clock scan and clock add bugs in error cases / with abbreviated options | ||
| Type: | Bug | Created on: | 2023-05-22 11:57:25 |
| Submitter: | pointsman | Assigned to: | nobody |
| Subsystem: | 16. Commands A-H | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2023-06-05 09:51:01 |
| Status: | Closed | Closed by: | pointsman |
| Resolution: | Fixed | Closed on: | 2023-06-05 09:51:01 |
| Version: | 8.6 - 9.0 | ||
| Description: | ||||
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. | ||||
| User Comments: | ||||
pointsman added on 2023-05-22 12:19:23:
Proposed fix at [827cc031bc4]. If nobody objects I'll merge in a few days. oehhar added on 2023-05-22 15:04:45:
Just a remark. I saw today a ticket by Mr AndroWish: https://core.tcl-lang.org/tdbcsqlite3/info/d9fe8c58e03eacc1 An utility function of TCL is used to do the whole argument magic. May this be a possibility to fix this to ? I am always surprised, how many bugs are included in this abreviated command feature... Thank you and take care, Harald pointsman added on 2023-05-22 21:10:45:
Surely the option handling could be rewritten by using tcl::prefix. But the problem here is that some option combination are not allowed and that tests did not work. The least invasive seemd to me to change the code just a bit so that it does what obviously was intended. This is just a minor fix for otherwise working code. Rewriting the code has just the risk of new oversights without additional benefit. If clock can get some love then this is perhaps better spend otherwise. oehhar added on 2023-05-23 07:28:14:
Ok, thank you for the clarification, I appreciate, Harald jan.nijtmans added on 2023-06-02 22:23:24:
LGTM. Thanks! pointsman added on 2023-06-05 09:51:01:
Fix merged by Jan with [72f78b6085]. I slightly corrected the fix with [aaecc4619]. @Jan not a big thing, you perhaps thought I forgot about this but if you merged and closed the branch why did you left it to me to close the ticket? And what are this (apparently) white-space changes, messing up the simple fix as shown by [72f78b60851aaf8d]? I can't see this white-space only changes shown by the web interface with a diff between the two check-outs [72f78b6085] and [dba07ed3df].. Is the problem the web-interface, me or something else? | ||||
