diff options
author | dgp <dgp@users.sourceforge.net> | 2020-09-15 18:04:02 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-09-15 18:04:02 (GMT) |
commit | 163d31e623394ea08605580b140ef1a5f14a0573 (patch) | |
tree | 30378ff4653a9894ccf072e5a2c622afd288bd0e /generic/tclFileName.c | |
parent | e36bada6ec8d9679acbb7b2b73f38d3d643d5dd7 (diff) | |
parent | 93124d77a6848e2118547a4f477abd8e26493252 (diff) | |
download | tcl-163d31e623394ea08605580b140ef1a5f14a0573.zip tcl-163d31e623394ea08605580b140ef1a5f14a0573.tar.gz tcl-163d31e623394ea08605580b140ef1a5f14a0573.tar.bz2 |
merge 8.7
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 32b217f..187003d 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -598,7 +598,7 @@ Tcl_SplitPath( for (i = 0; i < *argcPtr; i++) { Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr); str = TclGetStringFromObj(eltPtr, &len); - memcpy(p, str, len+1); + memcpy(p, str, len + 1); p += len+1; } @@ -2055,7 +2055,7 @@ TclGlob( * SkipToChar -- * * This function traverses a glob pattern looking for the next unquoted - * occurance of the specified character at the same braces nesting level. + * occurrence of the specified character at the same braces nesting level. * * Results: * Updates stringPtr to point to the matching character, or to the end of @@ -2445,7 +2445,7 @@ DoGlob( int len; const char *joined = TclGetStringFromObj(joinedPtr,&len); - if (strchr(separators, joined[len-1]) == NULL) { + if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) { Tcl_AppendToObj(joinedPtr, "/", 1); } } @@ -2482,7 +2482,7 @@ DoGlob( int len; const char *joined = TclGetStringFromObj(joinedPtr,&len); - if (strchr(separators, joined[len-1]) == NULL) { + if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) { if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) { Tcl_AppendToObj(joinedPtr, "/", 1); } |