[fbreader] Changed getPwdDir to return the current directory
It was returning the value of PWD environment variable which isn't necessarily the same thing.
This commit is contained in:
parent
87bdefbe05
commit
dac803cd4e
1 changed files with 6 additions and 2 deletions
|
@ -32,8 +32,12 @@
|
|||
#include "ZLUnixFileOutputStream.h"
|
||||
|
||||
static std::string getPwdDir() {
|
||||
char *pwd = getenv("PWD");
|
||||
return (pwd != 0) ? pwd : "";
|
||||
std::string cwd;
|
||||
long size = pathconf(".", _PC_PATH_MAX);
|
||||
char* buf = new char[size];
|
||||
if (getcwd(buf, size)) cwd = buf;
|
||||
delete [] buf;
|
||||
return cwd;
|
||||
}
|
||||
|
||||
static std::string getHomeDir() {
|
||||
|
|
Loading…
Reference in a new issue