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
2f3b2ec5
Commit
2f3b2ec5
authored
May 18, 2001
by
Mike Bond
Committed by
Alexandre Julliard
May 18, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of spawnl and spawnlp.
parent
6d3e81b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
process.c
dlls/msvcrt/process.c
+80
-0
No files found.
dlls/msvcrt/msvcrt.spec
View file @
2f3b2ec5
...
...
@@ -442,9 +442,9 @@ debug_channels (msvcrt)
@ varargs _snprintf(str long str) snprintf
@ forward -noimport _snwprintf ntdll._snwprintf
@ cdecl _sopen(str long long) MSVCRT__sopen
@
stub _spawnl #(str str) varargs
@
varargs _spawnl(str str) _spawnl
@ stub _spawnle #(str str) varargs
@
stub _spawnlp #(str str) varargs
@
varargs _spawnlp(str str) _spawnlp
@ stub _spawnlpe #(str str) varargs
@ cdecl _spawnv(long str ptr) _spawnv
@ cdecl _spawnve(long str ptr ptr) _spawnve
...
...
dlls/msvcrt/process.c
View file @
2f3b2ec5
...
...
@@ -109,6 +109,45 @@ static char* msvcrt_argvtos(const char* const* arg, char delim)
return
ret
;
}
/* INTERNAL: Convert va_list to a single 'delim'-separated string */
static
char
*
msvcrt_valisttos
(
const
char
*
arg0
,
va_list
ap
,
char
delim
)
{
va_list
search
=
ap
;
long
size
;
char
*
arg
;
char
*
ret
;
int
strsize
;
if
(
!
arg0
&&
!
delim
)
return
NULL
;
/* get length */
size
=
strlen
(
arg0
)
+
1
;
while
((
arg
=
va_arg
(
search
,
char
*
))
!=
NULL
)
{
size
+=
strlen
(
arg
)
+
1
;
}
if
(
!
(
ret
=
(
char
*
)
MSVCRT_calloc
(
size
+
1
,
1
)))
return
NULL
;
/* fill string */
search
=
ap
;
size
=
0
;
strsize
=
strlen
(
arg0
);
memcpy
(
ret
+
size
,
arg0
,
strsize
);
ret
[
size
+
strsize
]
=
delim
;
size
+=
strsize
+
1
;
while
((
arg
=
va_arg
(
search
,
char
*
))
!=
NULL
)
{
strsize
=
strlen
(
search
);
memcpy
(
ret
+
size
,
search
,
strsize
);
ret
[
size
+
strsize
]
=
delim
;
size
+=
strsize
+
1
;
}
return
ret
;
}
/*********************************************************************
* _cwait (MSVCRT.@)
*/
...
...
@@ -143,6 +182,47 @@ int _cwait(int *status, int pid, int action)
}
/*********************************************************************
* _spawnl (MSVCRT.@)
*/
int
_spawnl
(
int
flags
,
const
char
*
name
,
const
char
*
arg0
,
...)
{
va_list
ap
;
char
*
args
;
int
ret
;
va_start
(
ap
,
arg0
);
args
=
msvcrt_valisttos
(
arg0
,
ap
,
' '
);
va_end
(
ap
);
ret
=
msvcrt_spawn
(
flags
,
name
,
args
,
NULL
);
MSVCRT_free
(
args
);
return
ret
;
}
/*********************************************************************
* _spawnl (MSVCRT.@)
*/
int
_spawnlp
(
int
flags
,
const
char
*
name
,
const
char
*
arg0
,
...)
{
va_list
ap
;
char
*
args
;
int
ret
;
char
fullname
[
MAX_PATH
];
_searchenv
(
name
,
"PATH"
,
fullname
);
va_start
(
ap
,
arg0
);
args
=
msvcrt_valisttos
(
arg0
,
ap
,
' '
);
va_end
(
ap
);
ret
=
msvcrt_spawn
(
flags
,
name
,
args
,
NULL
);
MSVCRT_free
(
args
);
return
ret
;
}
/*********************************************************************
* _spawnve (MSVCRT.@)
*/
int
_spawnve
(
int
flags
,
const
char
*
name
,
const
char
*
const
*
argv
,
...
...
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