From c734e9a9815173924395ac28a97bf374e87e7340 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sun, 14 Dec 2003 05:42:53 -0800 Subject: [PATCH] [svn] Return a pointer from url_skip_credentials. --- src/ChangeLog | 4 ++++ src/url.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f5588fbc..5e8fd113 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-12-14 Hrvoje Niksic + + * url.c (url_skip_credentials): Return a pointer directly. + 2003-12-14 Hrvoje Niksic * url.c (url_file_name): Ditto. diff --git a/src/url.c b/src/url.c index 8baa9869..cc4c3f90 100644 --- a/src/url.c +++ b/src/url.c @@ -483,15 +483,15 @@ scheme_disable (enum url_scheme scheme) If no username and password are found, return 0. */ -static int +static const char * url_skip_credentials (const char *url) { /* Look for '@' that comes before terminators, such as '/', '?', '#', or ';'. */ const char *p = (const char *)strpbrk (url, "@/?#;"); if (!p || *p != '@') - return 0; - return p + 1 - url; + return p; + return p + 1; } /* Parse credentials contained in [BEG, END). The region is expected @@ -840,7 +840,7 @@ url_parse (const char *url, int *error) p += strlen (supported_schemes[scheme].leading_string); uname_b = p; - p += url_skip_credentials (p); + p = url_skip_credentials (p); uname_e = p; /* scheme://user:pass@host[:port]... */