summaryrefslogtreecommitdiffstats
path: root/Mac/Compat/getwd.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-06-02 21:38:19 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-06-02 21:38:19 (GMT)
commit2b44ba5203a45c54caec57695e20ef6cc4c870a2 (patch)
tree1467d4b49f1eb35ccfcb76404c5228af2081d4c7 /Mac/Compat/getwd.c
parenta04b24bf8d7dfd881176427e1140a410e2df6d41 (diff)
downloadcpython-2b44ba5203a45c54caec57695e20ef6cc4c870a2.zip
cpython-2b44ba5203a45c54caec57695e20ef6cc4c870a2.tar.gz
cpython-2b44ba5203a45c54caec57695e20ef6cc4c870a2.tar.bz2
Revived various of the compatability routines and made them Carbon-compliant. This is needed because the initial carbon-python does not use GUSI.
Diffstat (limited to 'Mac/Compat/getwd.c')
-rw-r--r--Mac/Compat/getwd.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Mac/Compat/getwd.c b/Mac/Compat/getwd.c
index 16b010a..a58fb6a 100644
--- a/Mac/Compat/getwd.c
+++ b/Mac/Compat/getwd.c
@@ -59,13 +59,18 @@ getwd(cwd)
sprintf(cwd, "I/O error %d in PBHGetVolSync", err);
return NULL;
}
+#ifdef TARGET_API_MAC_CARBON
+ p2cstrcpy(cwd, (StringPtr)cwd);
+ ecwd = strchr(cwd, EOS);
+#else
ecwd= strchr((const char *)p2cstr((unsigned char*)cwd), EOS);
+#endif
ebuf= buf;
*ebuf = EOS;
/* Next, if at least we're running HFS, walk up the path. */
- if (hfsrunning()) {
+ {
long dirid= pb.w.ioWDDirID;
pb.d.ioVRefNum= pb.w.ioWDVRefNum;
while (dirid != ROOTID) {
@@ -78,7 +83,12 @@ getwd(cwd)
return NULL;
}
dirid= pb.d.ioDrParID;
+#ifdef TARGET_API_MAC_CARBON
+ p2cstrcpy(ebuf, (StringPtr)ebuf);
+ ebuf += strlen(ebuf);
+#else
ebuf += strlen((const char *)p2cstr((unsigned char *)ebuf));
+#endif
/* Should check for buf overflow */
}
}