Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
2a2bc33a
Commit
2a2bc33a
authored
Jul 05, 2017
by
Deomid Ryabkov
Committed by
Cesanta Bot
Jul 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mg_strstr
PUBLISHED_FROM=4306e870e2cab854febb6becc198ca2247e2e002
parent
41558bbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
mongoose.c
mongoose.c
+14
-0
mongoose.h
mongoose.h
+2
-0
No files found.
mongoose.c
View file @
2a2bc33a
...
...
@@ -1481,6 +1481,20 @@ int mg_strncmp(const struct mg_str str1, const struct mg_str str2, size_t n) {
}
return
mg_strcmp
(
s1
,
s2
);
}
const
char
*
mg_strstr
(
const
struct
mg_str
haystack
,
const
struct
mg_str
needle
)
WEAK
;
const
char
*
mg_strstr
(
const
struct
mg_str
haystack
,
const
struct
mg_str
needle
)
{
size_t
i
;
if
(
needle
.
len
>
haystack
.
len
)
return
NULL
;
for
(
i
=
0
;
i
<=
haystack
.
len
-
needle
.
len
;
i
++
)
{
if
(
memcmp
(
haystack
.
p
+
i
,
needle
.
p
,
needle
.
len
)
==
0
)
{
return
haystack
.
p
+
i
;
}
}
return
NULL
;
}
#ifdef MG_MODULE_LINES
#line 1 "common/str_util.c"
#endif
...
...
mongoose.h
View file @
2a2bc33a
...
...
@@ -1809,6 +1809,8 @@ const char *mg_strchr(const struct mg_str s, int c);
int
mg_strcmp
(
const
struct
mg_str
str1
,
const
struct
mg_str
str2
);
int
mg_strncmp
(
const
struct
mg_str
str1
,
const
struct
mg_str
str2
,
size_t
n
);
const
char
*
mg_strstr
(
const
struct
mg_str
haystack
,
const
struct
mg_str
needle
);
#ifdef __cplusplus
}
#endif
/* __cplusplus */
...
...
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