mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Committed my patch <dpem6hln1k.fsf@mraz.iskon.hr>.
This commit is contained in:
parent
fe387ce432
commit
0eec6b9f30
@ -1,3 +1,8 @@
|
|||||||
|
2000-06-01 Hrvoje Niksic <hniksic@iskon.hr>
|
||||||
|
|
||||||
|
* url.c (str_url): Print the port number only if it's different
|
||||||
|
from the default port number for that protocol.
|
||||||
|
|
||||||
2000-05-22 Dan Harkless <dan-wget@dilvish.speed.net>
|
2000-05-22 Dan Harkless <dan-wget@dilvish.speed.net>
|
||||||
|
|
||||||
* main.c (main): Added --help line for Damir Dzeko
|
* main.c (main): Added --help line for Damir Dzeko
|
||||||
|
11
src/url.c
11
src/url.c
@ -631,6 +631,7 @@ str_url (const struct urlinfo *u, int hide)
|
|||||||
{
|
{
|
||||||
char *res, *host, *user, *passwd, *proto_name, *dir, *file;
|
char *res, *host, *user, *passwd, *proto_name, *dir, *file;
|
||||||
int i, l, ln, lu, lh, lp, lf, ld;
|
int i, l, ln, lu, lh, lp, lf, ld;
|
||||||
|
unsigned short proto_default_port;
|
||||||
|
|
||||||
/* Look for the protocol name. */
|
/* Look for the protocol name. */
|
||||||
for (i = 0; i < ARRAY_SIZE (sup_protos); i++)
|
for (i = 0; i < ARRAY_SIZE (sup_protos); i++)
|
||||||
@ -639,6 +640,7 @@ str_url (const struct urlinfo *u, int hide)
|
|||||||
if (i == ARRAY_SIZE (sup_protos))
|
if (i == ARRAY_SIZE (sup_protos))
|
||||||
return NULL;
|
return NULL;
|
||||||
proto_name = sup_protos[i].name;
|
proto_name = sup_protos[i].name;
|
||||||
|
proto_default_port = sup_protos[i].port;
|
||||||
host = CLEANDUP (u->host);
|
host = CLEANDUP (u->host);
|
||||||
dir = CLEANDUP (u->dir);
|
dir = CLEANDUP (u->dir);
|
||||||
file = CLEANDUP (u->file);
|
file = CLEANDUP (u->file);
|
||||||
@ -693,9 +695,12 @@ str_url (const struct urlinfo *u, int hide)
|
|||||||
}
|
}
|
||||||
memcpy (res + l, host, lh);
|
memcpy (res + l, host, lh);
|
||||||
l += lh;
|
l += lh;
|
||||||
res[l++] = ':';
|
if (u->port != proto_default_port)
|
||||||
long_to_string (res + l, (long)u->port);
|
{
|
||||||
l += numdigit (u->port);
|
res[l++] = ':';
|
||||||
|
long_to_string (res + l, (long)u->port);
|
||||||
|
l += numdigit (u->port);
|
||||||
|
}
|
||||||
res[l++] = '/';
|
res[l++] = '/';
|
||||||
memcpy (res + l, dir, ld);
|
memcpy (res + l, dir, ld);
|
||||||
l += ld;
|
l += ld;
|
||||||
|
Loading…
Reference in New Issue
Block a user