aboutsummaryrefslogtreecommitdiff
path: root/lpm.c
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2022-09-27 21:08:55 -0400
committerAdam <adamdharrison@gmail.com>2022-09-27 21:08:55 -0400
commitcc5c601b6ba8d65ffb411f6ea5bc47a5ea0b88b7 (patch)
tree4957c5ff5a98d4024f9809c3283fd991a0ac515f /lpm.c
parent4b6b95cb6f55afe88c433b589d686fa1882d0f7d (diff)
downloadlite-xl-plugin-manager-cc5c601b6ba8d65ffb411f6ea5bc47a5ea0b88b7.tar.gz
lite-xl-plugin-manager-cc5c601b6ba8d65ffb411f6ea5bc47a5ea0b88b7.zip
Mostly done.
Diffstat (limited to 'lpm.c')
-rw-r--r--lpm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lpm.c b/lpm.c
index 4d9db68..6c6d55b 100644
--- a/lpm.c
+++ b/lpm.c
@@ -60,9 +60,13 @@ static int lpm_hash(lua_State* L) {
}
int lpm_symlink(lua_State* L) {
- if (symlink(luaL_checkstring(L, 1), luaL_checkstring(L, 2)))
- return luaL_error(L, "can't create symlink %s: %s", luaL_checkstring(L, 2), strerror(errno));
- return 0;
+ #ifndef _WIN32
+ if (symlink(luaL_checkstring(L, 1), luaL_checkstring(L, 2)))
+ return luaL_error(L, "can't create symlink %s: %s", luaL_checkstring(L, 2), strerror(errno));
+ return 0;
+ #else
+ return luaL_error(L, "can't create symbolic link %s: your operating system sucks", luaL_checkstring(L, 2));
+ #endif
}
int lpm_chmod(lua_State* L) {