1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Made strpbrk_or_eos inline. Use strchr(s, '\0') for finding the NUL

char in the string.
This commit is contained in:
hniksic 2005-05-07 10:32:25 -07:00
parent 58828beb5f
commit d761d066cd
2 changed files with 9 additions and 4 deletions

View File

@ -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.

View File

@ -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. */