From c854652cfeef01c8f350990e90bb82444aa0db07 Mon Sep 17 00:00:00 2001 From: Rob Jonson Date: Sun, 25 Sep 2011 23:11:46 +0100 Subject: [PATCH] expose make_path to lua MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Denis-Courmont --- modules/lua/libs/strings.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/lua/libs/strings.c b/modules/lua/libs/strings.c index d9aeaa5b71..ab8e435744 100644 --- a/modules/lua/libs/strings.c +++ b/modules/lua/libs/strings.c @@ -91,6 +91,15 @@ static int vlclua_make_uri( lua_State *L ) return 1; } +static int vlclua_make_path( lua_State *L ) +{ + const char *psz_input = luaL_checkstring( L, 1 ); + char *psz_path = make_path( psz_input); + lua_pushstring( L, psz_path ); + free( psz_path ); + return 1; +} + static int vlclua_resolve_xml_special_chars( lua_State *L ) { int i_top = lua_gettop( L ); @@ -145,6 +154,7 @@ static const luaL_Reg vlclua_strings_reg[] = { { "decode_uri", vlclua_decode_uri }, { "encode_uri_component", vlclua_encode_uri_component }, { "make_uri", vlclua_make_uri }, + { "make_path", vlclua_make_path }, { "resolve_xml_special_chars", vlclua_resolve_xml_special_chars }, { "convert_xml_special_chars", vlclua_convert_xml_special_chars }, { "from_charset", vlclua_from_charset }, -- 2.11.4.GIT