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
|
||||
#include <windows.h>
|
||||
#include "Shlwapi.h"
|
||||
#include <direct.h>
|
||||
#define getcwd _getcwd // stupid MSFT "deprecation" warning
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -36,6 +38,7 @@
|
|||
#define SEPARATOR "\\"
|
||||
#else
|
||||
#define SEPARATOR "/"
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
|
@ -238,3 +241,10 @@ bool writeTextFile(const string &path, const string &content) {
|
|||
file.close();
|
||||
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);
|
||||
string getLastPathElement(const string &path);
|
||||
string getExecutablePath();
|
||||
|
||||
string getCurrentDirectory();
|
||||
bool writeTextFile(const string &path, const string &content);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue