Skip to content

Commit

Permalink
Extend win.Uuid function
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Oct 19, 2023
1 parent b0c85af commit 9496225
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Binary file modified luafar/manuals/luafar2m_manual.chm
Binary file not shown.
7 changes: 6 additions & 1 deletion luafar/src/ustring.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,17 @@ int ustring_Uuid(lua_State* L)
GUID uuid;
memset(&uuid, 0, sizeof(uuid));

if(lua_gettop(L) == 0 || !lua_toboolean(L, 1)) // generate new UUID
if (!lua_toboolean(L, 1)) // generate new UUID
{
// TODO (currently it is a nil uuid)
lua_pushlstring(L, (const char*)&uuid, sizeof(uuid));
return 1;
}
else if (lua_isstring(L,1) && (!strcasecmp(lua_tostring(L,1),"U") || !strcasecmp(lua_tostring(L,1),"L")))
{
lua_pushstring(L, "00000000-0000-0000-0000-000000000000");
return 1;
}
else
{
size_t len;
Expand Down

0 comments on commit 9496225

Please sign in to comment.