Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
71a4a1d4
Commit
71a4a1d4
authored
Oct 02, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added LTrim() implementation.
parent
3ea9a170
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
global.c
dlls/vbscript/global.c
+23
-2
api.vbs
dlls/vbscript/tests/api.vbs
+12
-0
No files found.
dlls/vbscript/global.c
View file @
71a4a1d4
...
...
@@ -852,8 +852,29 @@ static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
static
HRESULT
Global_LTrim
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
str
,
conv_str
=
NULL
;
WCHAR
*
ptr
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
if
(
V_VT
(
arg
)
==
VT_BSTR
)
{
str
=
V_BSTR
(
arg
);
}
else
{
hres
=
to_string
(
arg
,
&
conv_str
);
if
(
FAILED
(
hres
))
return
hres
;
str
=
conv_str
;
}
for
(
ptr
=
str
;
*
ptr
&&
isspaceW
(
*
ptr
);
ptr
++
);
str
=
SysAllocString
(
ptr
);
SysFreeString
(
conv_str
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
return
return_bstr
(
res
,
str
);
}
static
HRESULT
Global_RTrim
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
71a4a1d4
...
...
@@ -237,6 +237,18 @@ TestTrim "", ""
TestTrim
123
,
"123"
if
isEnglishLang
then
TestTrim
true
,
"True"
Sub
TestLTrim
(
str
,
exstr
)
Call
ok
(
LTrim
(
str
)
=
exstr
,
"LTrim("
&
str
&
") = "
&
LTrim
(
str
))
End
Sub
TestLTrim
" test "
,
"test "
TestLTrim
"test "
,
"test "
TestLTrim
" test"
,
"test"
TestLTrim
"test"
,
"test"
TestLTrim
""
,
""
TestLTrim
123
,
"123"
if
isEnglishLang
then
TestLTrim
true
,
"True"
Sub
TestRound
(
val
,
exval
,
vt
)
Call
ok
(
Round
(
val
)
=
exval
,
"Round("
&
val
&
") = "
&
Round
(
val
))
Call
ok
(
getVT
(
Round
(
val
))
=
vt
,
"getVT(Round("
&
val
&
")) = "
&
getVT
(
Round
(
val
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment