Skip to content

::tkcon::ExpandPathname fails in Tcl 9.0 when glob has no matches #8

@kpvetter

Description

@kpvetter

In Tcl 9.0, the glob command uses "-nocomplain" by default. In version 2.8 of TkCon, the routine ::tkcon::ExpandPathname relies on this behavior to catch no matches (around line 5954) when it calls catch {lsort [EvalAttached [list glob $safedir]]} m*.

The user observed effect of this bug is press tab while expanding a pathname with a subdirectory in the path and there is no match, then TkCon will silently leave you in that subdirectory. (ExpandPathname cd's into that subdirectory, performs the glob, then cd's back to the original directory. But in Tcl 9.0, there's an error trying to read an unset variable, aborting the procedure prematurely.)

One simple fix is to add the conditional if {[llength $m] == 0} { set match {}} else... .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions