mirror of
https://github.com/mirror/wget.git
synced 2025-01-22 18:21:03 +08:00
[svn] Made strpbrk_or_eos inline. Use strchr(s, '\0') for finding the NUL
char in the string.
This commit is contained in:
parent
58828beb5f
commit
d761d066cd
@ -1,3 +1,8 @@
|
|||||||
|
2005-05-07 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* url.c (strpbrk_or_eos): Made inline. Use strchr(s, '\0') for
|
||||||
|
finding the NUL char position.
|
||||||
|
|
||||||
2005-05-07 Hrvoje Niksic <hniksic@xemacs.org>
|
2005-05-07 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* url.c (decide_copy_method): Renamed to char_needs_escaping.
|
* url.c (decide_copy_method): Renamed to char_needs_escaping.
|
||||||
|
@ -584,21 +584,21 @@ static void split_path PARAMS ((const char *, char **, char **));
|
|||||||
#define strpbrk_or_eos(s, accept) ({ \
|
#define strpbrk_or_eos(s, accept) ({ \
|
||||||
char *SOE_p = strpbrk (s, accept); \
|
char *SOE_p = strpbrk (s, accept); \
|
||||||
if (!SOE_p) \
|
if (!SOE_p) \
|
||||||
SOE_p = (char *)s + strlen (s); \
|
SOE_p = strchr (s, '\0'); \
|
||||||
SOE_p; \
|
SOE_p; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#else /* not __GNUC__ */
|
#else /* not __GNUC__ */
|
||||||
|
|
||||||
static char *
|
static inline char *
|
||||||
strpbrk_or_eos (const char *s, const char *accept)
|
strpbrk_or_eos (const char *s, const char *accept)
|
||||||
{
|
{
|
||||||
char *p = strpbrk (s, accept);
|
char *p = strpbrk (s, accept);
|
||||||
if (!p)
|
if (!p)
|
||||||
p = (char *)s + strlen (s);
|
p = strchr (s, '\0');
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* not __GNUC__ */
|
||||||
|
|
||||||
/* Turn STR into lowercase; return non-zero if a character was
|
/* Turn STR into lowercase; return non-zero if a character was
|
||||||
actually changed. */
|
actually changed. */
|
||||||
|
Loading…
Reference in New Issue
Block a user