From d761d066cdcbacb225ae35499ad65ac16fafcae4 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 7 May 2005 10:32:25 -0700 Subject: [PATCH] [svn] Made strpbrk_or_eos inline. Use strchr(s, '\0') for finding the NUL char in the string. --- src/ChangeLog | 5 +++++ src/url.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 00ab3c93..b7ebd455 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-07 Hrvoje Niksic + + * url.c (strpbrk_or_eos): Made inline. Use strchr(s, '\0') for + finding the NUL char position. + 2005-05-07 Hrvoje Niksic * url.c (decide_copy_method): Renamed to char_needs_escaping. diff --git a/src/url.c b/src/url.c index 89e0d176..fee88593 100644 --- a/src/url.c +++ b/src/url.c @@ -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. */