Skip to content

Commit

Permalink
player/lua: fix trailing whitespace for mp.log output
Browse files Browse the repository at this point in the history
Previously it always inserts a whitespace after an arg because
i > 0 is always true.
  • Loading branch information
na-na-hi authored and kasper93 committed Apr 9, 2024
1 parent 58eae25 commit f167d18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion player/lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int script_log(lua_State *L)
const char *s = lua_tostring(L, -1);
if (s == NULL)
return luaL_error(L, "Invalid argument");
mp_msg(ctx->log, msgl, "%s%s", s, i > 0 ? " " : "");
mp_msg(ctx->log, msgl, (i == 2 ? "%s" : " %s"), s);
lua_pop(L, 1); // args... tostring
}
mp_msg(ctx->log, msgl, "\n");
Expand Down

0 comments on commit f167d18

Please sign in to comment.