Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
88d536eb
Commit
88d536eb
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
re-indented to follow "project curl"-style, renamed curl_ prefix to Curl_
parent
d567659b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/strtok.c
+44
-53
44 additions, 53 deletions
lib/strtok.c
with
44 additions
and
53 deletions
lib/strtok.c
+
44
−
53
View file @
88d536eb
...
...
@@ -72,65 +72,56 @@
#include
<stddef.h>
char
*
c
url_strtok_r
(
char
*
s
,
const
char
*
delim
,
char
**
last
)
C
url_strtok_r
(
char
*
s
,
const
char
*
delim
,
char
**
last
)
{
char
*
spanp
;
int
c
,
sc
;
char
*
tok
;
char
*
spanp
;
int
c
,
sc
;
char
*
tok
;
if
(
s
==
NULL
&&
(
s
=
*
last
)
==
NULL
)
{
return
NULL
;
}
if
(
s
==
NULL
&&
(
s
=
*
last
)
==
NULL
)
{
return
NULL
;
}
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c
=
*
s
++
;
for
(
spanp
=
(
char
*
)
delim
;
(
sc
=
*
spanp
++
)
!=
0
;
)
{
if
(
c
==
sc
)
{
goto
cont
;
}
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c
=
*
s
++
;
for
(
spanp
=
(
char
*
)
delim
;
(
sc
=
*
spanp
++
)
!=
0
;
)
{
if
(
c
==
sc
)
{
goto
cont
;
}
}
if
(
c
==
0
)
/* no non-delimiter characters */
{
*
last
=
NULL
;
return
NULL
;
}
tok
=
s
-
1
;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for
(;;)
{
c
=
*
s
++
;
spanp
=
(
char
*
)
delim
;
do
{
if
((
sc
=
*
spanp
++
)
==
c
)
{
if
(
c
==
0
)
{
s
=
NULL
;
}
else
{
char
*
w
=
s
-
1
;
*
w
=
'\0'
;
}
*
last
=
s
;
return
tok
;
}
}
while
(
sc
!=
0
);
if
(
c
==
0
)
{
/* no non-delimiter characters */
*
last
=
NULL
;
return
NULL
;
}
tok
=
s
-
1
;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for
(;;)
{
c
=
*
s
++
;
spanp
=
(
char
*
)
delim
;
do
{
if
((
sc
=
*
spanp
++
)
==
c
)
{
if
(
c
==
0
)
{
s
=
NULL
;
}
else
{
char
*
w
=
s
-
1
;
*
w
=
'\0'
;
}
*
last
=
s
;
return
tok
;
}
}
/* NOTREACHED */
while
(
sc
!=
0
);
}
/* NOTREACHED */
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment