File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,23 @@ __initialize_with_resources(CFragInitBlockPtr data)
8282 return noErr ;
8383}
8484
85+ /*
86+ ** compare two FSSpecs, return true if equal, false if different
87+ ** XXX where could this function live? (jvr)
88+ */
89+
90+ static int
91+ FSpCompare (FSSpec * fss1 , FSSpec * fss2 ) {
92+ if (fss1 -> vRefNum != fss2 -> vRefNum )
93+ return 0 ;
94+ if (fss1 -> parID != fss2 -> parID )
95+ return 0 ;
96+ return !PLstrcmp (fss1 -> name , fss2 -> name );
97+ }
98+
99+ /* XXX can't include "macglue.h" somehow (jvr) */
100+ extern FSSpec PyMac_ApplicationFSSpec ; /* Application location (from macargv.c) */
101+
85102/*
86103** Insert the library resources into the search path. Put them after
87104** the resources from the application (which we assume is the current
@@ -90,7 +107,7 @@ __initialize_with_resources(CFragInitBlockPtr data)
90107void
91108PyMac_AddLibResources ()
92109{
93- if ( !library_fss_valid )
110+ if ( !library_fss_valid || FSpCompare ( & library_fss , & PyMac_ApplicationFSSpec ))
94111 return ;
95112 (void )FSpOpenResFile (& library_fss , fsRdPerm );
96113}
You can’t perform that action at this time.
0 commit comments