#include <dirent.h> /* *dir() */
#include <CoreFoundation/CoreFoundation.h>
+#include <mach-o/dyld.h>
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-#ifdef HAVE_MACH_O_DYLD_H
-# include <mach-o/dyld.h>
-#endif
#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
(void)pi_argc;
/* Get the full program path and name */
-
/* First try to see if we are linked to the framework */
for (i = 0; i < _dyld_image_count(); i++)
{
p_char = strdup( ppsz_argv[ 0 ] );
}
+ free(psz_vlcpath);
psz_vlcpath = p_char;
/* Remove trailing program name */
*p_char = '\0';
p_oldchar = p_char;
}
-
p_char++;
}
/* Check if $LANG is set. */
- if ( (p_char = getenv("LANG")) == NULL )
+ if( NULL == getenv("LANG") )
{
/*
Retrieve the preferred language as chosen in System Preferences.app
{
(void)p_this;
free( psz_vlcpath );
+ psz_vlcpath = NULL;
}