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
c9b02375
Commit
c9b02375
authored
Nov 06, 2001
by
François Gouget
Committed by
Alexandre Julliard
Nov 06, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strsep is not implemented on Solaris, replace it with our own portable
implementation.
parent
69c04176
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
regapi.c
programs/regapi/regapi.c
+29
-3
No files found.
programs/regapi/regapi.c
View file @
c9b02375
...
...
@@ -318,6 +318,32 @@ static HKEY getRegClass(LPSTR lpClass)
}
/******************************************************************************
* This is a replacement for strsep which is not portable (missing on Solaris).
*/
static
char
*
getToken
(
char
**
str
,
const
char
*
delims
)
{
char
*
token
;
if
(
*
str
==
NULL
)
{
/* No more tokens */
return
NULL
;
}
token
=*
str
;
while
(
**
str
!=
'\0'
)
{
if
(
strchr
(
delims
,
**
str
)
!=
NULL
)
{
**
str
=
'\0'
;
(
*
str
)
++
;
return
token
;
}
(
*
str
)
++
;
}
/* There is no other token */
*
str
=
NULL
;
return
token
;
}
/******************************************************************************
* Returns an allocated buffer with a cleaned copy (removed the surrounding
* dbl quotes) of the passed value.
*/
...
...
@@ -616,7 +642,7 @@ static void processSetValue(LPSTR cmdline)
for
(
counter
=
0
;
counter
<
SET_VALUE_MAX_ARGS
;
counter
++
)
argv
[
counter
]
=
NULL
;
while
(
(
token
=
strsep
(
&
cmdline
,
setValueDelim
[
argCounter
]))
!=
NULL
)
while
(
(
token
=
getToken
(
&
cmdline
,
setValueDelim
[
argCounter
]))
!=
NULL
)
{
argv
[
argCounter
++
]
=
getArg
(
token
);
...
...
@@ -673,7 +699,7 @@ static void processQueryValue(LPSTR cmdline)
for
(
counter
=
0
;
counter
<
QUERY_VALUE_MAX_ARGS
;
counter
++
)
argv
[
counter
]
=
NULL
;
while
(
(
token
=
strsep
(
&
cmdline
,
queryValueDelim
[
argCounter
]))
!=
NULL
)
while
(
(
token
=
getToken
(
&
cmdline
,
queryValueDelim
[
argCounter
]))
!=
NULL
)
{
argv
[
argCounter
++
]
=
getArg
(
token
);
...
...
@@ -997,7 +1023,7 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
/*
* get the command, should be the first arg (modify cmdLine)
*/
token
=
strsep
(
&
cmdline
,
" "
);
token
=
getToken
(
&
cmdline
,
" "
);
if
(
token
!=
NULL
)
{
cmdIndex
=
getCommand
(
token
);
...
...
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