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
a801995c
Commit
a801995c
authored
Mar 13, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add 2>&1 and 1>&2 support.
parent
4ef2f8ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
wcmdmain.c
programs/cmd/wcmdmain.c
+29
-10
No files found.
programs/cmd/wcmdmain.c
View file @
a801995c
...
...
@@ -533,18 +533,37 @@ void WCMD_process_command (char *command)
else
{
creationDisposition
=
CREATE_ALWAYS
;
}
/* Add support for 2>&1 */
redir
=
p
;
h
=
CreateFile
(
WCMD_parameter
(
p
,
0
,
NULL
),
GENERIC_WRITE
,
0
,
&
sa
,
creationDisposition
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
if
(
SetFilePointer
(
h
,
0
,
NULL
,
FILE_END
)
==
INVALID_SET_FILE_POINTER
)
{
WCMD_print_error
();
if
(
*
p
==
'&'
)
{
int
idx
=
*
(
p
+
1
)
-
'0'
;
if
(
DuplicateHandle
(
GetCurrentProcess
(),
GetStdHandle
(
idx_stdhandles
[
idx
]),
GetCurrentProcess
(),
&
h
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
)
==
0
)
{
WINE_FIXME
(
"Duplicating handle failed with gle %d
\n
"
,
GetLastError
());
}
WINE_TRACE
(
"Redirect %d (%p) to %d (%p)
\n
"
,
handle
,
GetStdHandle
(
idx_stdhandles
[
idx
]),
idx
,
h
);
}
else
{
char
*
param
=
WCMD_parameter
(
p
,
0
,
NULL
);
h
=
CreateFile
(
param
,
GENERIC_WRITE
,
0
,
&
sa
,
creationDisposition
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
if
(
SetFilePointer
(
h
,
0
,
NULL
,
FILE_END
)
==
INVALID_SET_FILE_POINTER
)
{
WCMD_print_error
();
}
WINE_TRACE
(
"Redirect %d to '%s' (%p)
\n
"
,
handle
,
param
,
h
);
}
old_stdhandles
[
handle
]
=
GetStdHandle
(
idx_stdhandles
[
handle
]);
SetStdHandle
(
idx_stdhandles
[
handle
],
h
);
}
...
...
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