diff --git a/src/ChangeLog b/src/ChangeLog index 143b62574..c8da2c804 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-09 Pavel Shirshov + + * util.c (strip_password): Fix bug - don't delete path from url. + 2004-11-09 Jindrich Novy * filegui.c (file_mask_dialog): Fix memory leak. diff --git a/src/util.c b/src/util.c index fd439e03d..1ae8096c8 100644 --- a/src/util.c +++ b/src/util.c @@ -449,23 +449,23 @@ strip_password (char *p, int has_prefix) continue; else p = q + prefixes[i].len; - }; + } if ((dir = strchr (p, PATH_SEP)) != NULL) *dir = '\0'; + /* search for any possible user */ at = strrchr (p, '@'); - /* We have a username */ - if (at) { - *at = 0; - inner_colon = strchr (p, ':'); - *at = '@'; - if (inner_colon) - strcpy (inner_colon, at); - } if (dir) *dir = PATH_SEP; + + /* We have a username */ + if (at) { + inner_colon = memchr (p, ':', at - p); + if (inner_colon) + memmove (inner_colon, at, strlen(at) + 1); + } break; } return (result);