Skip to content

Commit

Permalink
LuaFAR: change win.JoinPath a little (see the manual)
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Nov 6, 2024
1 parent 840109e commit ed58568
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
8 changes: 6 additions & 2 deletions enc/enc_lua/luafar_manual.tsi
Original file line number Diff line number Diff line change
Expand Up @@ -9848,16 +9848,20 @@ lv=3
dt=Text
nm=win.JoinPath
ctime=3922434993
mtime=3922435036
mtime=3940098857
<article>
#_path = win.JoinPath (...)
#_
#_**Parameters:**
#_ ... : 0 or more strings (nils allowed)
#_ ... : 0 or more strings
#_
#_**Returns:**
#_ path: string
#_
#_**Note:**
#_ Empty string arguments are ignored except the last
#_ argument where it's treated as the path delimiter.
#_
#_@@@
#_
</article>
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/_globalinfo.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
Version = { 3, 0, 0, 856 },
Version = { 3, 0, 0, 857 },
MinFarVersion = { 3, 0, 0, 6380 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Expand Down
4 changes: 4 additions & 0 deletions plugins/luamacro/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
shmuel 2024-11-06 23:51:17+02:00 - build 857

1. LuaFAR: change win.JoinPath a little (see the manual)

shmuel 2024-10-31 22:45:33+02:00 - build 856

1. LuaFAR: fix actl.GetFarmanagerVersion(true)
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luafar/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 856
#define PLUGIN_BUILD 857
9 changes: 7 additions & 2 deletions plugins/luamacro/luafar/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,14 @@ static int win_JoinPath(lua_State *L)
luaL_buffinit(L, &buf);

for (idx=1; idx <= top; idx++) {
const char *s = luaL_optstring(L, idx, "");
if (*s == 0)
const char *s = luaL_checkstring(L, idx);
if (*s == 0) {
if (idx == top && !was_slash) { // treat empty string in last arg as delimiter
luaL_addchar(&buf, DELIM);
break;
}
continue;
}
if (!empty && !was_slash && *s != DELIM)
luaL_addchar(&buf, DELIM);
else if (was_slash && *s == DELIM)
Expand Down

0 comments on commit ed58568

Please sign in to comment.