Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
23:20 • Ticket [218562ffff] file extension bug status still Closed with 3 other chan... artifact: d9af952a3e user: dgp
2000-10-26
08:24 • Closed ticket [218562ffff]. artifact: 83e39c26ff user: welch
01:02 • New ticket [218562ffff]. artifact: 8262bc94d7 user: nobody

file extension bug

Closed / Fixed218562ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:02:19
OriginalBugID: 1126 Bug
Version: 8.0.4
SubmitDate: '1999-01-29'
LastModified: '1999-02-03'
Severity: MED
Status: Released
Submitter: welch
ChangedBy: stanton
OS: Solaris
OSVersion: SunOS muffin 5.6 Generic sun4m sparc SUNW,SPARCstation-20
Machine: Other
FixedDate: '1999-02-03'
FixedInVersion: 8.0.5
ClosedDate: '2000-10-25'


Name:

Don Libes


CVS:

RCS: @(#) $Id: tclFileName.c,v 1.3 1998/09/14 18:39:59 stanton Exp $


Extensions:

Tcl 8.0.4


ReproducibleScript:

Enter the following to the Tcl interpreter:

   file extension a..b


ObservedBehavior:

[file extension a..b]

  returns "..b"


DesiredBehavior:

[file extension a..b]

  should return ".b"


Not only is this more intuitive, but the man page says that's how it should work.


Oddly, Tcl contains code specifically for this behavior:

     /*

      * Back up to the first period in a series of contiguous dots.

      * This is needed so foo..o will be split on the first dot.

      */

 Why on earth would anyone want this behavior?  The comment isn't

very clear - to restate, it means that the extension of foo..o is

"..o".  This is inconsistent.  It means that "foo..o" and "foo.x.o"

are files with different extensions.


Patch:

*** tclFileName.c~Mon Sep 14 14:39:59 1998

--- tclFileName.cTue Jan 26 14:27:32 1999

***************

*** 1029,1045 ****

      && (lastSep > p)) {

  p = NULL;

      }

- 

-     /*

-      * Back up to the first period in a series of contiguous dots.

-      * This is needed so foo..o will be split on the first dot.

-      */

- 

-     if (p != NULL) {

- while ((p > name) && *(p-1) == '.') {

-     p--;

- }

-     }

      return p;

  }

  

--- 1029,1034 ----


PatchFiles:

tclFileName.c
welch Closed ticket [218562ffff]. [History diff]2000-10-26 08:24:15
dgp Ticket [218562ffff]: 3 changes [History diff]2001-04-16 23:20:29
Log in (anonymous is fine) to add a comment.