From: SourceForge.net <no...@so...> - 2004-04-26 15:40:35
|
Bugs item #941108, was opened at 2004-04-24 02:10 Message generated for change (Comment added) made by vincentdarley You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=941108&group_id=10894 Category: 36. File System Group: development: 8.5a2 Status: Open Resolution: None Priority: 5 Submitted By: Don Porter (dgp) Assigned to: Don Porter (dgp) Summary: TclpObjNormalizePath(unix) breaks VFS spec Initial Comment: The Tcl_FSNormalizePathProc of a Tcl_Filesystem gets three arguments, (TclInterp *interp, Tcl_Obj *pathPtr, int nextCheckPoint) and an int return value. It's spelled out in in the Tcl_Filesystem docs that both nextCheckPoint and the returned value should be indices into the pathPtr->bytes array and the value should point to either the start (0) the end (bytes[cp] == '\0') or to a separator character, usually '/'. The unix TclpObjNormalizePath() routine does not follow these rules; it returns a value that points "one past" the separator, not to it. The correction is simple, just remove lines 1805-1807 from unix/tclUnixFCmd.c Those lines incorrectly advance the checkpoint value one past where it ought to be. Removing those lines leads to no new failures in the test suite on three different unix systems I tried. ---------------------------------------------------------------------- >Comment By: Vince Darley (vincentdarley) Date: 2004-04-26 15:40 Message: Logged In: YES user_id=32170 Oh yes, I would commit the simpler one now (no 'access' check), but consider adding the other check in place if/when the needs of the other discussions/fixes require it. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-04-26 15:32 Message: Logged In: YES user_id=80530 which one? The additional access() call is helpful when there are other FS's registered, as it will let the native FS claim the entire path when it can. However, when there's only a native FS around, the additional access() call adds to the overhead of path normaliztaion. Intermingled with this is Bug 931847. The plans for revising Tcl_FSNTUP might influence the choice. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2004-04-26 15:15 Message: Logged In: YES user_id=32170 Please do commit the fix. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-04-24 03:00 Message: Logged In: YES user_id=80530 Even better, in addition to removing those lines, it appears that TclpObjNormalizePath can claim to have normalized the whole thing rather than just all but the final component via this patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=941108&group_id=10894 |