--- p7zip_15.14.1/CPP/myWindows/mySplitCommandLine.cpp.~1~ 2015-10-10 15:37:36.000000000 +0300 +++ p7zip_15.14.1/CPP/myWindows/mySplitCommandLine.cpp 2016-06-08 13:24:30.762224258 +0300 @@ -106,9 +106,15 @@ { // define P7ZIP_HOME_DIR static char p7zip_home_dir[MAX_PATH]; - AString dir,name; - my_windows_split_path(arguments[0],dir,name); - snprintf(p7zip_home_dir,sizeof(p7zip_home_dir),"P7ZIP_HOME_DIR=%s/",(const char *)dir); +#if defined(_LP64) || defined (__amd64) + static char default_path[] = "/usr/lib/64/7z"; +#else + static char default_path[] = "/usr/lib/7z"; +#endif + char *env; + if ((env = getenv("P7ZIP_HOME_DIR")) == NULL) + env = default_path; + snprintf(p7zip_home_dir,sizeof(p7zip_home_dir),"P7ZIP_HOME_DIR=%s/",env); p7zip_home_dir[sizeof(p7zip_home_dir)-1] = 0; putenv(p7zip_home_dir); }