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
71de71c3
Commit
71de71c3
authored
Nov 10, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the limit on the length of the command line.
parent
5cbd491b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
start.c
programs/start/start.c
+29
-18
No files found.
programs/start/start.c
View file @
71de71c3
...
@@ -101,12 +101,25 @@ static void license(void)
...
@@ -101,12 +101,25 @@ static void license(void)
fatal_string
(
STRING_LICENSE
);
fatal_string
(
STRING_LICENSE
);
}
}
static
char
*
build_args
(
int
argc
,
char
**
argv
)
{
int
i
,
len
=
1
;
char
*
ret
,
*
p
;
for
(
i
=
0
;
i
<
argc
;
i
++
)
len
+=
strlen
(
argv
[
i
])
+
1
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
for
(
i
=
0
,
p
=
ret
;
i
<
argc
;
i
++
)
p
+=
sprintf
(
p
,
" %s"
,
argv
[
i
]);
return
ret
;
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
char
arguments
[
MAX_PATH
];
char
*
p
;
SHELLEXECUTEINFO
sei
;
SHELLEXECUTEINFO
sei
;
int
argi
;
char
*
args
;
int
i
;
memset
(
&
sei
,
0
,
sizeof
(
sei
));
memset
(
&
sei
,
0
,
sizeof
(
sei
));
sei
.
cbSize
=
sizeof
(
sei
);
sei
.
cbSize
=
sizeof
(
sei
);
...
@@ -119,24 +132,24 @@ int main(int argc, char *argv[])
...
@@ -119,24 +132,24 @@ int main(int argc, char *argv[])
* flags start with /, are case insensitive,
* flags start with /, are case insensitive,
* and may be run together in same word.
* and may be run together in same word.
*/
*/
for
(
argi
=
1
;
argi
<
argc
;
arg
i
++
)
{
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
int
ci
;
int
ci
;
if
(
argv
[
arg
i
][
0
]
!=
'/'
)
if
(
argv
[
i
][
0
]
!=
'/'
)
break
;
break
;
/* Handle all options in this word */
/* Handle all options in this word */
for
(
ci
=
0
;
argv
[
arg
i
][
ci
];
)
{
for
(
ci
=
0
;
argv
[
i
][
ci
];
)
{
/* Skip slash */
/* Skip slash */
ci
++
;
ci
++
;
switch
(
argv
[
arg
i
][
ci
])
{
switch
(
argv
[
i
][
ci
])
{
case
'l'
:
case
'l'
:
case
'L'
:
case
'L'
:
license
();
license
();
break
;
/* notreached */
break
;
/* notreached */
case
'm'
:
case
'm'
:
case
'M'
:
case
'M'
:
if
(
argv
[
argi
][
ci
+
1
]
==
'a'
||
argv
[
arg
i
][
ci
+
1
]
==
'A'
)
if
(
argv
[
i
][
ci
+
1
]
==
'a'
||
argv
[
i
][
ci
+
1
]
==
'A'
)
sei
.
nShow
=
SW_SHOWMAXIMIZED
;
sei
.
nShow
=
SW_SHOWMAXIMIZED
;
else
else
sei
.
nShow
=
SW_SHOWMINIMIZED
;
sei
.
nShow
=
SW_SHOWMINIMIZED
;
...
@@ -150,30 +163,28 @@ int main(int argc, char *argv[])
...
@@ -150,30 +163,28 @@ int main(int argc, char *argv[])
sei
.
fMask
|=
SEE_MASK_NOCLOSEPROCESS
;
sei
.
fMask
|=
SEE_MASK_NOCLOSEPROCESS
;
break
;
break
;
default:
default:
printf
(
"Option '%s' not recognized
\n
"
,
argv
[
arg
i
]
+
ci
-
1
);
printf
(
"Option '%s' not recognized
\n
"
,
argv
[
i
]
+
ci
-
1
);
usage
();
usage
();
}
}
/* Skip to next slash */
/* Skip to next slash */
while
(
argv
[
argi
][
ci
]
&&
(
argv
[
arg
i
][
ci
]
!=
'/'
))
while
(
argv
[
i
][
ci
]
&&
(
argv
[
i
][
ci
]
!=
'/'
))
ci
++
;
ci
++
;
}
}
}
}
if
(
arg
i
==
argc
)
if
(
i
==
argc
)
usage
();
usage
();
sei
.
lpFile
=
argv
[
argi
++
];
sei
.
lpFile
=
argv
[
i
++
];
/* FIXME - prone to overflow */
arguments
[
0
]
=
0
;
for
(
p
=
arguments
;
argi
<
argc
;
argi
++
)
p
+=
sprintf
(
p
,
" %s"
,
argv
[
argi
]);
sei
.
lpParameters
=
arguments
;
args
=
build_args
(
argc
-
i
,
&
argv
[
i
]
);
sei
.
lpParameters
=
args
;
if
(
!
ShellExecuteEx
(
&
sei
))
if
(
!
ShellExecuteEx
(
&
sei
))
fatal_string_error
(
STRING_EXECFAIL
,
GetLastError
());
fatal_string_error
(
STRING_EXECFAIL
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
args
);
if
(
sei
.
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
{
if
(
sei
.
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
{
DWORD
exitcode
;
DWORD
exitcode
;
DWORD
waitcode
;
DWORD
waitcode
;
...
...
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