summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorjingham <jingham>2000-04-17 01:52:56 (GMT)
committerjingham <jingham>2000-04-17 01:52:56 (GMT)
commit21b62caa5947aaeca59210aa4cd0be11b52ea59b (patch)
treec7687deaedbed915eabbec2b874c575d6833f3e5 /mac
parent83db7fbaa4af6569505bb895fe80a38e9fcb5ed7 (diff)
downloadtcl-21b62caa5947aaeca59210aa4cd0be11b52ea59b.zip
tcl-21b62caa5947aaeca59210aa4cd0be11b52ea59b.tar.gz
tcl-21b62caa5947aaeca59210aa4cd0be11b52ea59b.tar.bz2
Don't append : to folder name if the folder name is empty.
Diffstat (limited to 'mac')
-rw-r--r--mac/tclMacUtil.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mac/tclMacUtil.c b/mac/tclMacUtil.c
index fd981c9..51759ef 100644
--- a/mac/tclMacUtil.c
+++ b/mac/tclMacUtil.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: tclMacUtil.c,v 1.3 1998/11/10 06:49:55 jingham Exp $
+ * RCS: @(#) $Id: tclMacUtil.c,v 1.4 2000/04/17 01:52:56 jingham Exp $
*/
#include "tcl.h"
@@ -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]] = ':';
+ }
}
/*