mirror of https://github.com/kiwix/libkiwix.git
Fix kiwix-mange problem with relative paths
This commit is contained in:
parent
1500cb8329
commit
934a15a0b4
|
@ -25,6 +25,8 @@
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "Shlwapi.h"
|
#include "Shlwapi.h"
|
||||||
|
#include <direct.h>
|
||||||
|
#define getcwd _getcwd // stupid MSFT "deprecation" warning
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -36,6 +38,7 @@
|
||||||
#define SEPARATOR "\\"
|
#define SEPARATOR "\\"
|
||||||
#else
|
#else
|
||||||
#define SEPARATOR "/"
|
#define SEPARATOR "/"
|
||||||
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
|
@ -238,3 +241,10 @@ bool writeTextFile(const string &path, const string &content) {
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string getCurrentDirectory() {
|
||||||
|
char* a_cwd = getcwd(NULL,0);
|
||||||
|
string s_cwd(a_cwd);
|
||||||
|
free(a_cwd);
|
||||||
|
return s_cwd;
|
||||||
|
}
|
||||||
|
|
|
@ -55,6 +55,6 @@ bool makeDirectory(const string &path);
|
||||||
bool copyFile(const string &sourcePath, const string &destPath);
|
bool copyFile(const string &sourcePath, const string &destPath);
|
||||||
string getLastPathElement(const string &path);
|
string getLastPathElement(const string &path);
|
||||||
string getExecutablePath();
|
string getExecutablePath();
|
||||||
|
string getCurrentDirectory();
|
||||||
bool writeTextFile(const string &path, const string &content);
|
bool writeTextFile(const string &path, const string &content);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue