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
aad1d8ce
Commit
aad1d8ce
authored
Jun 15, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Jun 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Pass command structure into WCMD_pipe, not command line itself.
parent
a88a6c80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
wcmd.h
programs/cmd/wcmd.h
+10
-10
wcmdmain.c
programs/cmd/wcmdmain.c
+3
-2
No files found.
programs/cmd/wcmd.h
View file @
aad1d8ce
...
...
@@ -28,6 +28,15 @@
#include <ctype.h>
#include <wine/unicode.h>
/* Data structure to hold commands to be processed */
typedef
struct
_CMD_LIST
{
WCHAR
*
command
;
/* Command string to execute */
struct
_CMD_LIST
*
nextcommand
;
/* Next command string to execute */
BOOL
isAmphersand
;
/* Whether follows && */
int
bracketDepth
;
/* How deep bracketing have we got to */
}
CMD_LIST
;
void
WCMD_assoc
(
WCHAR
*
,
BOOL
);
void
WCMD_batch
(
WCHAR
*
,
WCHAR
*
,
int
,
WCHAR
*
,
HANDLE
);
void
WCMD_call
(
WCHAR
*
command
);
...
...
@@ -53,7 +62,7 @@ void WCMD_output (const WCHAR *format, ...);
void
WCMD_output_asis
(
const
WCHAR
*
message
);
void
WCMD_parse
(
WCHAR
*
s
,
WCHAR
*
q
,
WCHAR
*
p1
,
WCHAR
*
p2
);
void
WCMD_pause
(
void
);
void
WCMD_pipe
(
WCHAR
*
command
);
void
WCMD_pipe
(
CMD_LIST
*
*
command
);
void
WCMD_popd
(
void
);
void
WCMD_print_error
(
void
);
void
WCMD_process_command
(
WCHAR
*
command
);
...
...
@@ -92,15 +101,6 @@ WCHAR *WCMD_strdupW(WCHAR *input);
BOOL
WCMD_ReadFile
(
const
HANDLE
hIn
,
WCHAR
*
intoBuf
,
const
DWORD
maxChars
,
LPDWORD
charsRead
,
const
LPOVERLAPPED
unused
);
/* Data structure to hold commands to be processed */
typedef
struct
_CMD_LIST
{
WCHAR
*
command
;
/* Command string to execute */
struct
_CMD_LIST
*
nextcommand
;
/* Next command string to execute */
BOOL
isAmphersand
;
/* Whether follows && */
int
bracketDepth
;
/* How deep bracketing have we got to */
}
CMD_LIST
;
WCHAR
*
WCMD_ReadAndParseLine
(
WCHAR
*
initialcmd
,
CMD_LIST
**
output
,
HANDLE
readFrom
);
void
WCMD_process_commands
(
CMD_LIST
*
thisCmd
);
void
WCMD_free_commands
(
CMD_LIST
*
cmds
);
...
...
programs/cmd/wcmdmain.c
View file @
aad1d8ce
...
...
@@ -1487,9 +1487,10 @@ void WCMD_opt_s_strip_quotes(WCHAR *cmd) {
* Handle pipes within a command - the DOS way using temporary files.
*/
void
WCMD_pipe
(
WCHAR
*
command
)
{
void
WCMD_pipe
(
CMD_LIST
**
cmdEntry
)
{
WCHAR
*
p
;
WCHAR
*
command
=
(
*
cmdEntry
)
->
command
;
WCHAR
temp_path
[
MAX_PATH
],
temp_file
[
MAX_PATH
],
temp_file2
[
MAX_PATH
],
temp_cmd
[
1024
];
static
const
WCHAR
redirOut
[]
=
{
'%'
,
's'
,
' '
,
'>'
,
' '
,
'%'
,
's'
,
'\0'
};
static
const
WCHAR
redirIn
[]
=
{
'%'
,
's'
,
' '
,
'<'
,
' '
,
'%'
,
's'
,
'\0'
};
...
...
@@ -2077,7 +2078,7 @@ void WCMD_process_commands(CMD_LIST *thisCmd) {
if
(
thisCmd
->
command
&&
thisCmd
->
command
[
0
]
!=
':'
)
{
WINE_TRACE
(
"Executing command: '%s'
\n
"
,
wine_dbgstr_w
(
thisCmd
->
command
));
if
(
strchrW
(
thisCmd
->
command
,
'|'
)
!=
NULL
)
{
WCMD_pipe
(
thisCmd
->
comman
d
);
WCMD_pipe
(
&
thisCm
d
);
}
else
{
WCMD_process_command
(
thisCmd
->
command
);
}
...
...
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