Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

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

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. 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.
    
  5. foundin changed to: "8.6.11"
  6. is_private changed to: "0"
  7. login: "thegavaguy"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "ad6a6aa0fafa585dc8ffad3abcdfbc4f54bd2985"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "thegavaguy"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to:
    Duplicate file extension check in [file executable] on Windows
    
  16. type changed to: "Bug"