summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:36:57 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:36:57 (GMT)
commitfd0226b3275a1290cbaef0a462133c21e0f43d56 (patch)
tree746779ffe4464bb13305b5b12b61dc2e15e1c91b
parent27489d4c8ce63f1ee6b5079b6e48318a03f6f7ce (diff)
downloadcpython-fd0226b3275a1290cbaef0a462133c21e0f43d56.zip
cpython-fd0226b3275a1290cbaef0a462133c21e0f43d56.tar.gz
cpython-fd0226b3275a1290cbaef0a462133c21e0f43d56.tar.bz2
Use c2pstr() in stead of Pstring() to convert C-strings to
Pascal-strings. Safer, because Pstring converts in-place and the pathname may be reused later for error messages.
-rw-r--r--Python/dynload_mac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/dynload_mac.c b/Python/dynload_mac.c
index 8f057e7..645df90 100644
--- a/Python/dynload_mac.c
+++ b/Python/dynload_mac.c
@@ -10,6 +10,7 @@
#include "TFileSpec.h" /* for Path2FSSpec() */
#endif
#include <Files.h>
+#include <TextUtils.h>
#include "macdefs.h"
#include "macglue.h"
@@ -56,12 +57,12 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
#ifdef USE_GUSI1
err = Path2FSSpec(pathname, &libspec);
#else
- (void)FSMakeFSSpec(0, 0, Pstring(pathname), &libspec);
+ c2pstrcpy((unsigned char *)buf, pathname);
+ (void)FSMakeFSSpec(0, 0, (unsigned char *)buf, &libspec);
err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething);
#endif
if ( err ) {
- sprintf(buf, "%.255s: %.200s",
- pathname, PyMac_StrError(err));
+ sprintf(buf, "%.200s: %.200s", pathname, PyMac_StrError(err));
PyErr_SetString(PyExc_ImportError, buf);
return NULL;
}