summaryrefslogtreecommitdiffstats
path: root/Mac/Python
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-07-31 09:37:02 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-07-31 09:37:02 (GMT)
commit2e6445caa67955fc1f627df9655e1a49b8f3fdae (patch)
tree1a8cd389c543b6b0e902f9805f7e8ed86393e2c6 /Mac/Python
parent7e1fb7c92deff570fee8761e77adfa4e4ef5bdf7 (diff)
downloadcpython-2e6445caa67955fc1f627df9655e1a49b8f3fdae.zip
cpython-2e6445caa67955fc1f627df9655e1a49b8f3fdae.tar.gz
cpython-2e6445caa67955fc1f627df9655e1a49b8f3fdae.tar.bz2
Don't add the library file to the resource file chain if it is the
same as the application file (Just).
Diffstat (limited to 'Mac/Python')
-rw-r--r--Mac/Python/macshlglue.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/Mac/Python/macshlglue.c b/Mac/Python/macshlglue.c
index 84cddd8..4b51070 100644
--- a/Mac/Python/macshlglue.c
+++ b/Mac/Python/macshlglue.c
@@ -83,6 +83,23 @@ __initialize_with_resources(CFragInitBlockPtr data)
}
/*
+** compare two FSSpecs, return true if equal, false if different
+** XXX where could this function live? (jvr)
+*/
+
+static int
+FSpCompare(FSSpec *fss1, FSSpec *fss2) {
+ if (fss1->vRefNum != fss2->vRefNum)
+ return 0;
+ if (fss1->parID != fss2->parID)
+ return 0;
+ return !PLstrcmp(fss1->name, fss2->name);
+}
+
+/* XXX can't include "macglue.h" somehow (jvr) */
+extern FSSpec PyMac_ApplicationFSSpec; /* Application location (from macargv.c) */
+
+/*
** Insert the library resources into the search path. Put them after
** the resources from the application (which we assume is the current
** resource file). Again, we ignore errors.
@@ -90,7 +107,7 @@ __initialize_with_resources(CFragInitBlockPtr data)
void
PyMac_AddLibResources()
{
- if ( !library_fss_valid )
+ if ( !library_fss_valid || FSpCompare(&library_fss, &PyMac_ApplicationFSSpec))
return;
(void)FSpOpenResFile(&library_fss, fsRdPerm);
}