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
4691cc4f
Commit
4691cc4f
authored
Feb 09, 2009
by
Erich Hoover
Committed by
Alexandre Julliard
Feb 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wcmd: Properly cleanup redirects when there are no in/out/error pipes.
parent
e1d59b94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
wcmdmain.c
programs/cmd/wcmdmain.c
+4
-7
No files found.
programs/cmd/wcmdmain.c
View file @
4691cc4f
...
...
@@ -1204,9 +1204,9 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
SECURITY_ATTRIBUTES
sa
;
WCHAR
*
new_cmd
=
NULL
;
WCHAR
*
new_redir
=
NULL
;
HANDLE
old_stdhandles
[
3
]
=
{
INVALID_HANDLE_VALUE
,
INVALID_HANDLE_VALUE
,
INVALID_HANDLE_VALUE
};
HANDLE
old_stdhandles
[
3
]
=
{
GetStdHandle
(
STD_INPUT_HANDLE
)
,
GetStdHandle
(
STD_OUTPUT_HANDLE
)
,
GetStdHandle
(
STD_ERROR_HANDLE
)
};
DWORD
idx_stdhandles
[
3
]
=
{
STD_INPUT_HANDLE
,
STD_OUTPUT_HANDLE
,
STD_ERROR_HANDLE
};
...
...
@@ -1325,7 +1325,6 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
HeapFree
(
GetProcessHeap
(),
0
,
new_redir
);
return
;
}
old_stdhandles
[
0
]
=
GetStdHandle
(
STD_INPUT_HANDLE
);
SetStdHandle
(
STD_INPUT_HANDLE
,
h
);
/* No need to remember the temporary name any longer once opened */
...
...
@@ -1341,7 +1340,6 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
HeapFree
(
GetProcessHeap
(),
0
,
new_redir
);
return
;
}
old_stdhandles
[
0
]
=
GetStdHandle
(
STD_INPUT_HANDLE
);
SetStdHandle
(
STD_INPUT_HANDLE
,
h
);
}
...
...
@@ -1396,7 +1394,6 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
WINE_TRACE
(
"Redirect %d to '%s' (%p)
\n
"
,
handle
,
wine_dbgstr_w
(
param
),
h
);
}
old_stdhandles
[
handle
]
=
GetStdHandle
(
idx_stdhandles
[
handle
]);
SetStdHandle
(
idx_stdhandles
[
handle
],
h
);
}
...
...
@@ -1559,7 +1556,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
/* Restore old handles */
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
old_stdhandles
[
i
]
!=
INVALID_HANDLE_VALUE
)
{
if
(
old_stdhandles
[
i
]
!=
GetStdHandle
(
idx_stdhandles
[
i
])
)
{
CloseHandle
(
GetStdHandle
(
idx_stdhandles
[
i
]));
SetStdHandle
(
idx_stdhandles
[
i
],
old_stdhandles
[
i
]);
}
...
...
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