diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclPathObj.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index cd3f9f9..2be2a7e 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPathObj.c,v 1.25 2004/03/17 18:14:14 das Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.26 2004/03/26 18:45:10 vincentdarley Exp $ */ #include "tclInt.h" @@ -1690,6 +1690,11 @@ Tcl_FSGetNormalizedPath(interp, pathPtr) if (drive[0] == drive_cur) { absolutePath = Tcl_DuplicateObj(useThisCwd); /* We have a refCount on the cwd */ + + if (drive[cwdLen-1] != '/') { + /* Only add a trailing '/' if needed */ + Tcl_AppendToObj(absolutePath, "/", 1); + } } else { Tcl_DecrRefCount(useThisCwd); useThisCwd = NULL; @@ -1701,12 +1706,9 @@ Tcl_FSGetNormalizedPath(interp, pathPtr) * therefore behave the same here. */ absolutePath = Tcl_NewStringObj(path, 2); + Tcl_AppendToObj(absolutePath, "/", 1); } Tcl_IncrRefCount(absolutePath); - if (drive[cwdLen-1] != '/') { - /* Only add a trailing '/' if needed */ - Tcl_AppendToObj(absolutePath, "/", 1); - } Tcl_AppendToObj(absolutePath, path+2, -1); } #endif /* __WIN32__ */ |