Commit 67f3a523 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont
Browse files

src/darwin_specific.c: Get a better executable path name.

parent ce1fa300
......@@ -36,6 +36,9 @@
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
#ifdef HAVE_MACH_O_DYLD_H
# include <mach-o/dyld.h>
#endif
/* CFLocaleCopyAvailableLocaleIdentifiers is present only on post-10.4 */
extern CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void) __attribute__((weak_import));
......@@ -101,6 +104,13 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
}
}
if( !p_char )
{
char path[MAXPATHLEN+1];
uint32_t path_len = MAXPATHLEN;
if ( !_NSGetExecutablePath(path, &path_len) )
p_char = strdup(path);
}
if( !p_char )
{
/* We are not linked to the VLC.framework, return the executable path */
......
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