mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 20:07:56 -04:00
Move evutil_rtrim_lws_ to evutil.c where it belongs
This commit is contained in:
parent
c6ff381270
commit
61b93af561
21
evutil.c
21
evutil.c
@ -2199,6 +2199,27 @@ int evutil_ascii_strncasecmp(const char *s1, const char *s2, size_t n)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evutil_rtrim_lws_(char *str)
|
||||||
|
{
|
||||||
|
char *cp;
|
||||||
|
|
||||||
|
if (str == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((cp = strchr(str, '\0')) == NULL || (cp == str))
|
||||||
|
return;
|
||||||
|
|
||||||
|
--cp;
|
||||||
|
|
||||||
|
while (*cp == ' ' || *cp == '\t') {
|
||||||
|
*cp = '\0';
|
||||||
|
if (cp == str)
|
||||||
|
break;
|
||||||
|
--cp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evutil_issetugid(void)
|
evutil_issetugid(void)
|
||||||
{
|
{
|
||||||
|
21
http.c
21
http.c
@ -219,27 +219,6 @@ strsep(char **s, const char *del)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
|
||||||
evutil_rtrim_lws_(char *str)
|
|
||||||
{
|
|
||||||
char *cp;
|
|
||||||
|
|
||||||
if (str == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((cp = strchr(str, '\0')) == NULL || (cp == str))
|
|
||||||
return;
|
|
||||||
|
|
||||||
--cp;
|
|
||||||
|
|
||||||
while (*cp == ' ' || *cp == '\t') {
|
|
||||||
*cp = '\0';
|
|
||||||
if (cp == str)
|
|
||||||
break;
|
|
||||||
--cp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
html_replace(const char ch, const char **escaped)
|
html_replace(const char ch, const char **escaped)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user