X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bin%2Fvlc.c;h=bad420bacc584dc13f96d830ebe3b3081ff0fbb5;hb=fcc9a34048474173cbfa17b7106044cbdc31cfbe;hp=3dc0fe4f25d459bce6d0d59da06986c729f7fa95;hpb=94f95f8faf07fab0f8757e18e984d3151fc7bbae;p=vlc diff --git a/bin/vlc.c b/bin/vlc.c index 3dc0fe4f25..bad420bacc 100644 --- a/bin/vlc.c +++ b/bin/vlc.c @@ -34,6 +34,10 @@ #include #include +#ifdef __APPLE__ +#include +#endif + /* Explicit HACK */ extern void LocaleFree (const char *); @@ -134,7 +138,16 @@ int main( int i_argc, const char *ppsz_argv[] ) # endif #endif - for (int i = 1; i < i_argc; i++) + int i = 1; +#ifdef __APPLE__ + /* When VLC.app is run by double clicking in Mac OS X, the 2nd arg + * is the PSN - process serial number (a unique PID-ish thingie) + * still ok for real Darwin & when run from command line + * for example -psn_0_9306113 */ + if(i_argc >= 2 && !strncmp( ppsz_argv[1] , "-psn" , 4 )) + i = 2; +#endif + for (; i < i_argc; i++) if ((argv[argc++] = FromLocale (ppsz_argv[i])) == NULL) return 1; // BOOM! argv[argc] = NULL;