diff options
Diffstat (limited to 'tcl/mac/tclMacUtil.c')
-rw-r--r-- | tcl/mac/tclMacUtil.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tcl/mac/tclMacUtil.c b/tcl/mac/tclMacUtil.c index 7d7867abe40..ae45a2f3751 100644 --- a/tcl/mac/tclMacUtil.c +++ b/tcl/mac/tclMacUtil.c @@ -351,13 +351,17 @@ FSpPathFromLocation( * If the file doesn't currently exist we start over. If the * directory exists everything will work just fine. Otherwise we * will just fail later. If the object is a directory, append a - * colon so full pathname ends with colon. + * colon so full pathname ends with colon, but only if the name is + * not empty. NavServices returns FSSpec's with the parent ID set, + * but the name empty... */ if (err == fnfErr) { BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); } else if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) { - tempSpec.name[0] += 1; - tempSpec.name[tempSpec.name[0]] = ':'; + if (tempSpec.name[0] > 0) { + tempSpec.name[0] += 1; + tempSpec.name[tempSpec.name[0]] = ':'; + } } /* @@ -439,3 +443,4 @@ GetGlobalMouse( OSEventAvail(0, &event); *mouse = event.where; } + |