From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/vbscript/global.c | 2 +- dlls/vbscript/tests/api.vbs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 669eae3b5c4..ad5cb484947 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -1348,7 +1348,7 @@ static HRESULT Global_Right(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, TRACE("(%s %s)\n", debugstr_variant(args), debugstr_variant(args+1)); - if(V_VT(args+1) == VT_BSTR) { + if(V_VT(args) == VT_BSTR) { str = V_BSTR(args); }else { hres = to_string(args, &conv_str); diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 21834cb8a03..60ec7f5dc61 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -840,6 +840,8 @@ TestRight "test", 2, "st" TestRight "test", 5, "test" TestRight "test", 0, "" TestRight 123, 2, "23" +TestRight "test", "3", "est" +TestRight 123, "2", "23" if isEnglishLang then TestRight true, 2, "ue" Sub TestTrim(str, exstr) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1288