]> granicus.if.org Git - python/commitdiff
Don't add the library file to the resource file chain if it is the
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 31 Jul 1998 09:37:02 +0000 (09:37 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 31 Jul 1998 09:37:02 +0000 (09:37 +0000)
same as the application file (Just).

Mac/Python/macshlglue.c

index 84cddd86dc8b0d4929b679c0be1c843a96a98296..4b5107067029717259a4032650b6b9a77449ece1 100644 (file)
@@ -82,6 +82,23 @@ __initialize_with_resources(CFragInitBlockPtr data)
        return noErr;
 }
 
+/*
+** 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
@@ -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);
 }