summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/genie/src/host/path_getrelative.c
blob: 80c88da0b79b6c9ee631de289261b3d7389dcfe1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 * \file   path_getrelative.c
 * \brief  Calculate the relative path from src to dest
 */

#include "premake.h"

int path_getrelative(lua_State *L)
{
	const char *src = luaL_checkstring(L, -2);
	const char *dst = luaL_checkstring(L, -1);
	char buffer[PATH_BUFSIZE];
	get_relative_path(src, dst, buffer, PATH_BUFSIZE);
	lua_pushstring(L, buffer);
	return 1;
}