1 Index: luaposix-5.1.2/lposix.c
2 ===================================================================
3 --- luaposix-5.1.2.orig/lposix.c 2008-06-02 17:35:21.000000000 +0200
4 +++ luaposix-5.1.2/lposix.c 2008-06-02 17:35:26.000000000 +0200
10 + * XXX: GNU and BSD handle the forward declaration of crypt() in different
11 + * and annoying ways (especially GNU). Declare it here just to make sure
14 +char *crypt(const char *, const char *);
16 +static int Pcrypt(lua_State *L)
18 + const char *str, *salt;
21 + str = luaL_checkstring(L, 1);
22 + salt = luaL_checkstring(L, 2);
23 + if (strlen(salt) < 2)
24 + luaL_error(L, "not enough salt");
26 + res = crypt(str, salt);
27 + lua_pushstring(L, res);
32 static const luaL_reg R[] =
40 {"ctermid", Pctermid},
41 {"dirname", Pdirname},
43 Index: luaposix-5.1.2/Makefile
44 ===================================================================
45 --- luaposix-5.1.2.orig/Makefile 2008-06-02 17:35:26.000000000 +0200
46 +++ luaposix-5.1.2/Makefile 2008-06-02 17:35:18.000000000 +0200
50 LDFLAGS_SHARED=-bundle -undefined dynamic_lookup
53 LDFLAGS_SHARED=-shared
62 - $(CC) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $(OBJS)
63 + $(CC) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $(OBJS) $(LIBS)
65 $(OBJS): modemuncher.c