shithub: lu9-p9

ref: 77da164f11d49df4956c34348407d1631f653935
dir: /base/misc.c/

View raw version
/* Nowhere in particular */

static int
p9_cleanname(lua_State *L)
{
	const char *path, *p;
	lua_Unsigned len;
	luaL_Buffer b;
	
	path = luaL_checklstring(L, 1, &len);
	luaL_buffinit(L, &b);
	luaL_addlstring(&b, path, len);
	luaL_addchar(&b, '\0');
	p = cleanname(luaL_buffaddr(&b));
	lua_pushstring(L, p);
	return 1;
}