Dash:
[t2.git] / package / lua / lua-posix / mktemp.patch
blob262edd75e41158e52d95d924a944f5664dfabfa0
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../lua-posix/mktemp.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -urN posix.orig/lposix.c posix/lposix.c
18 --- posix.orig/lposix.c 2008-02-28 17:37:32.000000000 +0100
19 +++ posix/lposix.c 2008-02-28 17:45:41.000000000 +0100
20 @@ -257,6 +257,13 @@
21 return pushresult(L, mkdir(path, 0777), path);
24 +static int Pmktemp(lua_State *L) /** mktemp(path) */
26 + char *path = strdup (luaL_checkstring(L, 1));
27 + lua_pushstring(L, mktemp(path));
28 + free (path);
29 + return 1;
32 static int Pchdir(lua_State *L) /** chdir(path) */
34 @@ -810,6 +817,7 @@
35 {"kill", Pkill},
36 {"link", Plink},
37 {"mkdir", Pmkdir},
38 + {"mktemp", Pmktemp},
39 {"mkfifo", Pmkfifo},
40 {"pathconf", Ppathconf},
41 {"putenv", Pputenv},