1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../lua-posix/t2-realpath.patch
5 # Copyright (C) 2008 - 2014 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
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
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- posix.orig/lposix.c 2008-02-09 22:05:17.000000000 +0100
18 +++ posix/lposix.c 2008-02-09 22:11:53.000000000 +0100
23 +static int Prealpath(lua_State *L) /** realpath(path) */
25 + char buf[PATH_MAX], *rpath;
26 + const char *path = luaL_checkstring(L, 1);
27 + rpath = realpath(path, buf);
28 + if (!rpath) return pusherror(L, path);
29 + lua_pushstring(L, buf);
33 static int Paccess(lua_State *L) /** access(path,[mode]) */
36 {"pathconf", Ppathconf},
38 {"readlink", Preadlink},
39 + {"realpath", Prealpath},