[Python-checkins] CVS: python/dist/src/Mac/Python macmain.c,1.65,1.65.4.1
Jack Jansen
jackjansen@users.sourceforge.net
Sun, 29 Jul 2001 14:23:11 -0700
Update of /cvsroot/python/python/dist/src/Mac/Python
In directory usw-pr-cvs1:/tmp/cvs-serv16817/Python/Mac/Python
Modified Files:
Tag: release21-maint
macmain.c
Log Message:
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:-)
Index: macmain.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Python/macmain.c,v
retrieving revision 1.65
retrieving revision 1.65.4.1
diff -C2 -d -r1.65 -r1.65.4.1
*** macmain.c 2001/07/04 22:37:19 1.65
--- macmain.c 2001/07/29 21:23:09 1.65.4.1
***************
*** 487,490 ****
--- 487,495 ----
#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);