We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4c75da + e4ee8e5 commit ebf7b78Copy full SHA for ebf7b78
src/util/file_util.cpp
@@ -12,6 +12,7 @@ Date: January 2012
12
#include <cassert>
13
14
#include <fstream>
15
+#include <cstring>
16
#include <cstdlib>
17
#include <algorithm>
18
#include <sstream>
@@ -255,6 +256,11 @@ std::string fileutl_absolute_path(std::string const &path)
255
256
return std::string(&(buffer[0]));
257
#else
258
char *absolute = realpath(path.c_str(), nullptr);
259
+ if(absolute==NULL)
260
+ {
261
+ std::string error=std::strerror(errno);
262
+ throw std::ios::failure("Could not resolve absolute path ("+error+")");
263
+ }
264
std::string ret(absolute);
265
free(absolute);
266
return ret;
0 commit comments