From 9ef6ae5b49ad2db31154cf06410d3b9b0f353332 Mon Sep 17 00:00:00 2001 From: Marco Mattila Date: Sun, 19 Feb 2012 21:13:53 +0200 Subject: [PATCH] Use wxStandardPaths to find out the path to binaries in linux. --- common/edaappl.cpp | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/common/edaappl.cpp b/common/edaappl.cpp index bcce7aa9bc..005aff1e83 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -447,40 +447,7 @@ bool EDA_APP::SetBinDir() /* Linux and Unix */ #elif defined(__UNIX__) - - // Under Linux, if argv[0] doesn't the complete path to the executable, - // it's necessary to obtain it using "which ". - FILE* ftmp; - - char Line[1024]; - char FileName[1024]; - wxString str_arg0; - - FileName[0] = 0; - str_arg0 = argv[0]; - - if( strchr( (const char*) argv[0], '/' ) == NULL ) // no path - { - sprintf( FileName, "which %s > %s", TO_UTF8( str_arg0 ), TMP_FILE ); - - int ret = system( FileName ); - (void) ret; - - if( ( ftmp = fopen( TMP_FILE, "rt" ) ) != NULL ) - { - const char* line = fgets( Line, 1000, ftmp ); - (void) line; - fclose( ftmp ); - remove( TMP_FILE ); - } - - m_BinDir = FROM_UTF8( Line ); - } - else - { - m_BinDir = argv[0]; - } - + m_BinDir = wxStandardPaths().GetExecutablePath(); #else m_BinDir = argv[0]; #endif /* __UNIX__ */