openbsd-ports/devel/luafs/patches/patch-src_lfs_c
2006-07-30 04:33:18 +00:00

31 lines
770 B
Plaintext

$OpenBSD: patch-src_lfs_c,v 1.3 2006/07/30 04:38:39 pedro Exp $
--- src/lfs.c.orig Tue Mar 14 13:18:30 2006
+++ src/lfs.c Thu Jul 27 16:40:51 2006
@@ -32,14 +32,13 @@
#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
-#include <sys/types.h>
+#include <sys/param.h>
#include <utime.h>
#endif
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
-#include "compat-5.1.h"
#include "lfs.h"
@@ -91,8 +90,8 @@ static int change_dir (lua_State *L) {
** and a string describing the error
*/
static int get_dir (lua_State *L) {
- char path[255+2];
- if (getcwd(path, 255) == NULL) {
+ char path[MAXPATHLEN];
+ if (getcwd(path, sizeof(path)) == NULL) {
lua_pushnil(L);
lua_pushstring(L, getcwd_error);
return 2;