|
|
@ -51,6 +51,7 @@
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#include <windows.h>
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <direct.h> // _getcwd
|
|
|
|
#include <shlobj.h>
|
|
|
|
#include <shlobj.h>
|
|
|
|
/* older SDKs not have these */
|
|
|
|
/* older SDKs not have these */
|
|
|
|
# ifndef CSIDL_MYMUSIC
|
|
|
|
# ifndef CSIDL_MYMUSIC
|
|
|
@ -113,12 +114,12 @@ namespace Exiv2 {
|
|
|
|
|
|
|
|
|
|
|
|
// first lets get the current working directory to check if there is a config file
|
|
|
|
// first lets get the current working directory to check if there is a config file
|
|
|
|
#if defined(_MSC_VER) || defined(__MINGW__)
|
|
|
|
#if defined(_MSC_VER) || defined(__MINGW__)
|
|
|
|
char path[MAX_PATH];
|
|
|
|
char buffer[MAX_PATH];
|
|
|
|
if (SUCCEEDED(GetModuleFileNameA(NULL, path, MAX_PATH))) {
|
|
|
|
auto path = _getcwd(buffer, sizeof(buffer));
|
|
|
|
dir = std::string(path);
|
|
|
|
dir = std::string(path ? path : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
auto path = get_current_dir_name();
|
|
|
|
char buffer[1024];
|
|
|
|
|
|
|
|
auto path = getcwd(buffer, sizeof(buffer));
|
|
|
|
dir = std::string(path ? path : "");
|
|
|
|
dir = std::string(path ? path : "");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
auto const filename = dir + EXV_SEPARATOR_CHR + inifile;
|
|
|
|
auto const filename = dir + EXV_SEPARATOR_CHR + inifile;
|
|
|
|