Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
620af69d
Commit
620af69d
authored
May 27, 2010
by
Robert Wilhelm
Committed by
Alexandre Julliard
May 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Support system(NULL).
parent
d815e582
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
process.c
dlls/msvcrt/process.c
+18
-1
environ.c
dlls/msvcrt/tests/environ.c
+11
-0
No files found.
dlls/msvcrt/process.c
View file @
620af69d
...
...
@@ -1168,7 +1168,21 @@ int CDECL _wsystem(const MSVCRT_wchar_t* cmd)
unsigned
int
len
;
static
const
MSVCRT_wchar_t
flag
[]
=
{
' '
,
'/'
,
'c'
,
' '
,
0
};
if
(
!
(
comspec
=
msvcrt_get_comspec
()))
return
-
1
;
comspec
=
msvcrt_get_comspec
();
if
(
cmd
==
NULL
)
{
if
(
comspec
==
NULL
)
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
0
;
}
return
1
;
}
if
(
comspec
==
NULL
)
return
-
1
;
len
=
strlenW
(
comspec
)
+
strlenW
(
flag
)
+
strlenW
(
cmd
)
+
1
;
if
(
!
(
fullcmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
MSVCRT_wchar_t
))))
...
...
@@ -1195,6 +1209,9 @@ int CDECL MSVCRT_system(const char* cmd)
int
res
=
-
1
;
MSVCRT_wchar_t
*
cmdW
;
if
(
cmd
==
NULL
)
return
_wsystem
(
NULL
);
if
((
cmdW
=
msvcrt_wstrdupa
(
cmd
)))
{
res
=
_wsystem
(
cmdW
);
...
...
dlls/msvcrt/tests/environ.c
View file @
620af69d
...
...
@@ -42,6 +42,15 @@ static const char *a_very_long_env_string =
"/usr/lib/mingw32/3.4.2/;"
"/usr/lib/"
;
static
void
test_system
(
void
)
{
int
ret
=
system
(
NULL
);
ok
(
ret
==
1
,
"Expected system to return 1, got %d
\n
"
,
ret
);
ret
=
system
(
"echo OK"
);
ok
(
ret
==
0
,
"Expected system to return 0, got %d
\n
"
,
ret
);
}
START_TEST
(
environ
)
{
ok
(
_putenv
(
"cat="
)
==
0
,
"_putenv failed on deletion of nonexistent environment variable
\n
"
);
...
...
@@ -54,4 +63,6 @@ START_TEST(environ)
ok
(
_putenv
(
a_very_long_env_string
)
==
0
,
"_putenv failed for long environment string
\n
"
);
ok
(
getenv
(
"nonexistent"
)
==
NULL
,
"getenv should fail with nonexistent var name
\n
"
);
test_system
();
}
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