[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>
* 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) ({ \
char *SOE_p = strpbrk (s, accept); \
if (!SOE_p) \
SOE_p = (char *)s + strlen (s); \
SOE_p = strchr (s, '\0'); \
SOE_p; \
})
#else /* not __GNUC__ */
static char *
static inline char *
strpbrk_or_eos (const char *s, const char *accept)
{
char *p = strpbrk (s, accept);
if (!p)
p = (char *)s + strlen (s);
p = strchr (s, '\0');
return p;
}
#endif
#endif /* not __GNUC__ */
/* Turn STR into lowercase; return non-zero if a character was
actually changed. */