- Applied patch to fix the need for PATH_MAX on GNU/Hurd (thanks to Jakub
  Wilk).
This commit is contained in:
Paul Beckingham 2014-01-07 23:34:06 -05:00
parent 3e4972ba4b
commit 89d536c901

View file

@ -35,6 +35,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include <Directory.h>
#include <Path.h> #include <Path.h>
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -248,17 +249,13 @@ std::string Path::expand (const std::string& in)
else if (in.length () > 2 && else if (in.length () > 2 &&
in.substr (0, 2) == "./") in.substr (0, 2) == "./")
{ {
char buf[PATH_MAX]; copy = Directory::cwd () + "/" + in.substr (2);
getcwd (buf, PATH_MAX - 1);
copy = std::string (buf) + "/" + in.substr (2);
} }
else if (in.length () > 1 && else if (in.length () > 1 &&
in[0] != '.' && in[0] != '.' &&
in[0] != '/') in[0] != '/')
{ {
char buf[PATH_MAX]; copy = Directory::cwd () + "/" + in;
getcwd (buf, PATH_MAX - 1);
copy = std::string (buf) + "/" + in;
} }
return copy; return copy;