]> granicus.if.org Git - python/commitdiff
Allow the script to have not only a TEXT filetype but also a null filetype (to enable...
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 22 May 2002 15:02:08 +0000 (15:02 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 22 May 2002 15:02:08 +0000 (15:02 +0000)
Mac/Python/macmain.c

index a4f7dc4dc3392c7aebaf2e7f0c1dbe518cfe14be..c703cdcbf2fb1143bf2f8fd7c98f94e0947583ae 100644 (file)
@@ -549,6 +549,7 @@ PyMac_InitApplication(void)
 {
        int argc;
        char **argv;
+       OSType filetype;
        
        static char scriptpath[1024];
        char *script = NULL;
@@ -573,7 +574,8 @@ PyMac_InitApplication(void)
                        chdir(curwd);
                }
                /* Check that the first argument is a text file */
-               if ( PyMac_getfiletype(argv[1]) != 'TEXT' ) {
+               filetype = PyMac_getfiletype(argv[1]);
+               if ( filetype != 'TEXT' && filetype != 0 ) {
                        Alert(NOTASCRIPT_ID, NULL);
                        exit(0);
                }