[glob] + [file tail] gives wrong result

Bug #348740 reported by jepler
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tcl8.5 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: tcl8.5

This bug is reported upstream as: https://sourceforge.net/tracker/index.php?func=detail&aid=2710920&group_id=10894&atid=110894

In a specific scenario involving [glob] with a trailing slash, the
resulting files are treated improperly by [file tail]. An attached script,
which can be run by
$ tclsh fff.tcl

Expected output:
/bin/ /bin
Actual output:
/bin/ {}

("bin" can be another directory name such as "mnt" or "etc"; it depends on the order of directories returned by [glob]. The important thing is that [file tail] returns an empty string when it should return a non-empty one)

In my application, the only observed consequence of this bug is to display an empty string onscreen where a directory name should be shown, but if the result of [file tail] is used to decide on a file to use for input or output, this bug could change the file actually being opened.

Revision history for this message
jepler (jepler) wrote :
Revision history for this message
jepler (jepler) wrote :

I observed this bug in a Jaunty alpha. I did not test Intrepid. The bug does not exist in Hardy.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.