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
9fc5e6f0
Commit
9fc5e6f0
authored
Jul 09, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid hard-coded command line length limit in WCMD_process_command.
parent
ea6863c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
wcmdmain.c
programs/wcmd/wcmdmain.c
+17
-12
No files found.
programs/wcmd/wcmdmain.c
View file @
9fc5e6f0
...
...
@@ -253,23 +253,24 @@ int main (int argc, char *argv[])
*/
void
WCMD_process_command
(
char
*
command
)
{
char
cmd
[
1024
];
char
*
p
;
int
status
,
i
;
DWORD
count
;
HANDLE
old_stdin
=
0
,
old_stdout
=
0
,
h
;
char
*
whichcmd
;
void
WCMD_process_command
(
char
*
command
)
{
char
*
cmd
,
*
p
;
int
status
,
i
,
len
;
DWORD
count
;
HANDLE
old_stdin
=
0
,
old_stdout
=
0
,
h
;
char
*
whichcmd
;
/*
* Expand up environment variables.
*/
status
=
ExpandEnvironmentStrings
(
command
,
cmd
,
sizeof
(
cmd
));
len
=
ExpandEnvironmentStrings
(
command
,
NULL
,
0
);
cmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
status
=
ExpandEnvironmentStrings
(
command
,
cmd
,
len
);
if
(
!
status
)
{
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
...
...
@@ -280,6 +281,7 @@ char *whichcmd;
if
((
cmd
[
1
]
==
':'
)
&&
IsCharAlpha
(
cmd
[
0
])
&&
(
strlen
(
cmd
)
==
2
))
{
status
=
SetCurrentDirectory
(
cmd
);
if
(
!
status
)
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
...
...
@@ -294,6 +296,7 @@ char *whichcmd;
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
old_stdin
=
GetStdHandle
(
STD_INPUT_HANDLE
);
...
...
@@ -304,6 +307,7 @@ char *whichcmd;
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
return
;
}
old_stdout
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
...
...
@@ -442,7 +446,8 @@ char *whichcmd;
ExitProcess
(
0
);
default:
WCMD_run_program
(
whichcmd
);
};
}
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
if
(
old_stdin
)
{
CloseHandle
(
GetStdHandle
(
STD_INPUT_HANDLE
));
SetStdHandle
(
STD_INPUT_HANDLE
,
old_stdin
);
...
...
@@ -451,7 +456,7 @@ char *whichcmd;
CloseHandle
(
GetStdHandle
(
STD_OUTPUT_HANDLE
));
SetStdHandle
(
STD_OUTPUT_HANDLE
,
old_stdout
);
}
}
}
/******************************************************************************
* WCMD_run_program
...
...
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