mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 23:19:17 +00:00
vbscript: Support VT_BSTR in stack_pop_bool.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51911 Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bf284dfc17
commit
b9e38a41ea
|
@ -417,6 +417,7 @@ static int stack_pop_bool(exec_ctx_t *ctx, BOOL *b)
|
||||||
{
|
{
|
||||||
variant_val_t val;
|
variant_val_t val;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
VARIANT_BOOL vb;
|
||||||
|
|
||||||
hres = stack_pop_val(ctx, &val);
|
hres = stack_pop_val(ctx, &val);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
|
@ -437,6 +438,12 @@ static int stack_pop_bool(exec_ctx_t *ctx, BOOL *b)
|
||||||
case VT_I4:
|
case VT_I4:
|
||||||
*b = V_I4(val.v);
|
*b = V_I4(val.v);
|
||||||
break;
|
break;
|
||||||
|
case VT_BSTR:
|
||||||
|
hres = VarBoolFromStr(V_BSTR(val.v), ctx->script->lcid, 0, &vb);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return hres;
|
||||||
|
*b=vb;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FIXME("unsupported for %s\n", debugstr_variant(val.v));
|
FIXME("unsupported for %s\n", debugstr_variant(val.v));
|
||||||
release_val(&val);
|
release_val(&val);
|
||||||
|
|
|
@ -357,6 +357,22 @@ while empty
|
||||||
ok false, "while empty executed"
|
ok false, "while empty executed"
|
||||||
wend
|
wend
|
||||||
|
|
||||||
|
x = 0
|
||||||
|
if "0" then
|
||||||
|
ok false, "if ""0"" executed"
|
||||||
|
else
|
||||||
|
x = 1
|
||||||
|
end if
|
||||||
|
Call ok(x = 1, "if ""0"" else not executed")
|
||||||
|
|
||||||
|
x = 0
|
||||||
|
if "-1" then
|
||||||
|
x = 1
|
||||||
|
else
|
||||||
|
ok false, "if ""-1"" else executed"
|
||||||
|
end if
|
||||||
|
Call ok(x = 1, "if ""-1"" not executed")
|
||||||
|
|
||||||
x = 0
|
x = 0
|
||||||
WHILE x < 3 : x = x + 1 : Wend
|
WHILE x < 3 : x = x + 1 : Wend
|
||||||
Call ok(x = 3, "x not equal to 3")
|
Call ok(x = 3, "x not equal to 3")
|
||||||
|
|
Loading…
Reference in a new issue