summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-05-15 21:24:22 (GMT)
committerhobbs <hobbs>2001-05-15 21:24:22 (GMT)
commit0824af2d146763726b1866f650c19dd9faa72351 (patch)
treec0b6f35362f2ff60b2a32c410e976da841360f64 /generic/tclFileName.c
parent837efe75ca45a00ca55b499ef33fee55229e7e4f (diff)
downloadtcl-0824af2d146763726b1866f650c19dd9faa72351.zip
tcl-0824af2d146763726b1866f650c19dd9faa72351.tar.gz
tcl-0824af2d146763726b1866f650c19dd9faa72351.tar.bz2
* generic/tclFileName.c (ExtractWinRoot): corrected ABR error
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index b09d1a2..257f49d 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.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: tclFileName.c,v 1.13 2000/04/19 23:24:52 hobbs Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.14 2001/05/15 21:24:22 hobbs Exp $
*/
#include "tclInt.h"
@@ -163,7 +163,6 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
{
FileNameInit();
-
if (path[0] == '/' || path[0] == '\\') {
/* Might be a UNC or Vol-Relative path */
char *host, *share, *tail;
@@ -173,10 +172,10 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
*typePtr = TCL_PATH_VOLUME_RELATIVE;
Tcl_DStringAppend(resultPtr, "/", 1);
return &path[1];
- }
+ }
host = (char *)&path[2];
- /* Skip seperators */
+ /* Skip separators */
while (host[0] == '/' || host[0] == '\\') host++;
for (hlen = 0; host[hlen];hlen++) {
@@ -191,7 +190,7 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
Tcl_DStringSetLength(resultPtr, offset);
share = &host[hlen];
- /* Skip seperators */
+ /* Skip separators */
while (share[0] == '/' || share[0] == '\\') share++;
for (slen = 0; share[slen];slen++) {
@@ -205,12 +204,12 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
tail = &share[slen];
- /* Skip seperators */
+ /* Skip separators */
while (tail[0] == '/' || tail[0] == '\\') tail++;
*typePtr = TCL_PATH_ABSOLUTE;
return tail;
- } else if (path[1] == ':') {
+ } else if (*path && path[1] == ':') {
/* Might be a drive sep */
Tcl_DStringSetLength(resultPtr, offset);
@@ -218,17 +217,17 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
*typePtr = TCL_PATH_VOLUME_RELATIVE;
Tcl_DStringAppend(resultPtr, path, 2);
return &path[2];
- } else {
+ } else {
char *tail = (char*)&path[3];
- /* Skip seperators */
- while (tail[0] == '/' || tail[0] == '\\') tail++;
+ /* Skip separators */
+ while (*tail && (tail[0] == '/' || tail[0] == '\\')) tail++;
*typePtr = TCL_PATH_ABSOLUTE;
Tcl_DStringAppend(resultPtr, path, 2);
- Tcl_DStringAppend(resultPtr, "/", 1);
+ Tcl_DStringAppend(resultPtr, "/", 1);
- return tail;
+ return tail;
}
} else {
*typePtr = TCL_PATH_RELATIVE;