Tk Source Code

View Ticket
Login
Ticket UUID: 1550513
Title: Fix bug when entering a relative path name (Unix)
Type: Patch Version: None
Submitter: nobody Created on: 2006-09-01 13:15:03
Subsystem: 36. [tk_chooseDirectory] Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Open Last Modified: 2006-09-01 20:15:04
Resolution: None Closed By:
    Closed on:
Description:
When a relative path name is entered in the "Selection" 
entry, it is not interpreted relative to the currently 
selected directory, as I would expect, but relative to 
[pwd].

Subsequently, the dialog gets confused and does not 
allow browsing out of [pwd], because it now considers 
[pwd] to be the file system "root".

This patch changes the behavior to be as I expect it, 
by joining the text from the "Selection" entry with the 
currently selected directory. This is consistent with 
the behavior of tk_chooseDirectory on Windows.

Thanks to the semantics of [file join], the user is 
still able to enter/paste an absolute path.

This patch also gets rid of the suspicious
set text [eval file join [file split [string trim 
$text]]]
Although I do not understand the history of this code 
fragment, it seems wrong, as it is incapable of 
browsing paths that contain space characters: it fails 
both when any of the path components contain a space, 
and also if the user attempts to enter the name of a 
directory that begins or ends in a space character.
User Comments: nobody added on 2006-09-01 20:15:04:

File Added - 191593: choosedir-1.patch

Attachments: