Kaydet (Commit) 75975c70 authored tarafından Jack Jansen's avatar Jack Jansen

If you double-click a file with creator Pyth but owner != TEXT exit with a…

If you double-click a file with creator Pyth but owner != TEXT exit with a warning that this is not a script but an auxiliary document such as a preferrences file or an aplication template. This is a lot better than giving syntax errors on binary data:-)
üst 6dbbb805
......@@ -95,6 +95,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* No preferences file name resource */
#define NOPREFNAME_ID BASE_ID+9
/* Not a script */
#define NOTASCRIPT_ID BASE_ID+10
/* EditPythonPrefs range. Needed here to forestall conflicts with applets */
#define EDITPYTHONPREFS_MIN 508
#define EDITPYTHONPREFS_MAX 511
......
......@@ -486,6 +486,11 @@ PyMac_InitApplication()
PyMac_FixGUSIcd();
#endif
}
/* Check that the first argument is a text file */
if ( PyMac_getfiletype(argv[1]) != 'TEXT' ) {
Alert(NOTASCRIPT_ID, NULL);
exit(0);
}
}
Py_Main(argc, argv);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment