diff options
Diffstat (limited to 'cad/openvsp/files/patch-src_util_FileUtil.cpp')
-rw-r--r-- | cad/openvsp/files/patch-src_util_FileUtil.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cad/openvsp/files/patch-src_util_FileUtil.cpp b/cad/openvsp/files/patch-src_util_FileUtil.cpp new file mode 100644 index 000000000000..75365e74e79e --- /dev/null +++ b/cad/openvsp/files/patch-src_util_FileUtil.cpp @@ -0,0 +1,31 @@ +--- src/util/FileUtil.cpp.orig 2019-03-28 20:30:27 UTC ++++ src/util/FileUtil.cpp +@@ -19,7 +19,9 @@ + #include <pwd.h> + #endif + ++#include <libgen.h> + ++ + vector< string > ScanFolder( const char* dir_path ) + { + vector< string > file_vec; +@@ -107,9 +109,18 @@ bail: + + string PathToExe() + { ++ + int bufsize = 255; + char *path = NULL; + bool done = false; ++ ++ char temp[PATH_MAX]; ++ char exepath[PATH_MAX]; ++ ++ ::snprintf(temp, sizeof(temp),"/proc/curproc/file"); ++ ::realpath(temp, exepath); ++ ++ return dirname(exepath); + + // Pre-loop initialization. + #ifdef WIN32 |