summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luxio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/luxio.c b/luxio.c
index 1daff3b..7ca5b87 100644
--- a/luxio.c
+++ b/luxio.c
@@ -938,9 +938,10 @@ luxio_chdir(lua_State *L) /* 5.2.1 */
static int
luxio_getcwd(lua_State *L) /* 5.2.2 */
{
- char buf[PATH_MAX];
+ size_t buflen = pathconf("/", _PC_PATH_MAX) + 256;
+ char buf[buflen];
- if (getcwd(buf, PATH_MAX) == NULL) {
+ if (getcwd(buf, buflen) == NULL) {
lua_pushnil(L);
} else {
lua_pushstring(L, buf);