From da353234f401986deb76831d76effffd0d0e2257 Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Thu, 10 Jun 2010 13:37:54 +0000 Subject: fix luatex lfs.currentdir() under Sun Studio Compiler git-svn-id: svn://tug.org/texlive/trunk@18867 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Build/source/texk/web2c/luatexdir/luafilesystem') diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c index c4598e41aae..eed623dfad8 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c @@ -114,15 +114,14 @@ static int change_dir (lua_State *L) { ** and a string describing the error */ static int get_dir (lua_State *L) { - char *path; - if ((path = getcwd(NULL, 0)) == NULL) { + char path[500]; + if (getcwd((char *)path, 500) == NULL) { lua_pushnil(L); lua_pushstring(L, getcwd_error); return 2; } else { lua_pushstring(L, path); - free(path); return 1; } } -- cgit v1.2.3