Overview
| Artifact ID: | 13f25d329748f89c0f891f565ffe937a91493682b07a3157d1f258b3f81a3db0 |
|---|---|
| Ticket: | 85d1fa7d07de7c86f0dd8165569d5ee5045283dc
Duplicate file extension check in [file executable] on Windows |
| User & Date: | thegavaguy on 2021-04-09 19:15:36 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This is essentially a minor code cleanup issue. There is no user-visible error, just a bit of unneeded extra processing time. NativeIsExec() in win/tclWinFile.c contains the following: if ((_wcsicmp(path, L"exe") == 0) || (_wcsicmp(path, L"com") == 0) || (_wcsicmp(path, L"cmd") == 0) || (_wcsicmp(path, L"cmd") == 0) || (_wcsicmp(path, L"bat") == 0)) { It unnecessarily checks for a ".cmd" extension twice. Just delete one of them to correct this. Note that earlier versions of this function checked for ".ps1" (Powershell scripts) where the second ".cmd" is now located. The commit from 2018-03-22 (da169b16 in the repo on GitHub) seems to be the last one like that. The next commit affecting tclWinFile.c, from 2018-04-30, (19642193 on GitHub) has two checks for ".cmd", although it is still using the Microsoft macro _tcsicmp and TEXT macro to allow switching between Unicode and ASCII. Since versions of Windows descended from Win95 are no longer supported by Tcl this was later simplified and the current version simply uses _wcsicmp(). All subsequent versions of tclWinFile.c have contained this duplicate check for ".cmd". [Sorry for the Git commit IDs, I have not yet installed fossil on my system.] I can't tell whether this might be an edit artefact or a merge artefact or something else, but in any case the fix is trival. - foundin changed to: "8.6.11"
- is_private changed to: "0"
- login: "thegavaguy"
- priority changed to: "5 Medium"
- private_contact changed to: "ad6a6aa0fafa585dc8ffad3abcdfbc4f54bd2985"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "thegavaguy"
- subsystem changed to: "16. Commands A-H"
- title changed to:
Duplicate file extension check in [file executable] on Windows
- type changed to: "Bug"