* util.c (strip_password): Fix bug - don't delete path from url.
Этот коммит содержится в:
родитель
dce56e8421
Коммит
9bf6911b00
@ -1,3 +1,7 @@
|
|||||||
|
2004-11-09 Pavel Shirshov <me@pavelsh.pp.ru>
|
||||||
|
|
||||||
|
* util.c (strip_password): Fix bug - don't delete path from url.
|
||||||
|
|
||||||
2004-11-09 Jindrich Novy <jnovy@redhat.com>
|
2004-11-09 Jindrich Novy <jnovy@redhat.com>
|
||||||
|
|
||||||
* filegui.c (file_mask_dialog): Fix memory leak.
|
* filegui.c (file_mask_dialog): Fix memory leak.
|
||||||
|
18
src/util.c
18
src/util.c
@ -449,23 +449,23 @@ strip_password (char *p, int has_prefix)
|
|||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
p = q + prefixes[i].len;
|
p = q + prefixes[i].len;
|
||||||
};
|
}
|
||||||
|
|
||||||
if ((dir = strchr (p, PATH_SEP)) != NULL)
|
if ((dir = strchr (p, PATH_SEP)) != NULL)
|
||||||
*dir = '\0';
|
*dir = '\0';
|
||||||
|
|
||||||
/* search for any possible user */
|
/* search for any possible user */
|
||||||
at = strrchr (p, '@');
|
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)
|
if (dir)
|
||||||
*dir = PATH_SEP;
|
*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;
|
break;
|
||||||
}
|
}
|
||||||
return (result);
|
return (result);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user