Fossil SCM
Make url_full() and url_nouser() put the "/" between host and path of an ssh: URL that has a user name. "fossil remote hyperlink" and "fossil test-urlparser" printed such a URL without it.
Commit
f5eb8933f9ade3f1f66668c10d64d444f31f1279fd6d2845ea4cf74fa56c84f3
Parent
d9cd6aa143cebba…
1 file changed
+8
+8
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -398,10 +398,14 @@ | ||
| 398 | 398 | blob_appendf(&x, "@"); |
| 399 | 399 | } |
| 400 | 400 | url_append_host(&x, p->name); |
| 401 | 401 | if( p->dfltPort!=p->port ){ |
| 402 | 402 | blob_appendf(&x, ":%d", p->port); |
| 403 | + } | |
| 404 | + if( p->isSsh && p->path[0] && fossil_strcmp(p->path, "/")!=0 ){ | |
| 405 | + /* The path of an ssh: URL is held without its first "/". */ | |
| 406 | + blob_append_char(&x, '/'); | |
| 403 | 407 | } |
| 404 | 408 | blob_appendf(&x, "%T", p->path); |
| 405 | 409 | (void)blob_str(&x); |
| 406 | 410 | return x.aData; |
| 407 | 411 | } |
| @@ -418,10 +422,14 @@ | ||
| 418 | 422 | } |
| 419 | 423 | blob_appendf(&x, "%s://", p->protocol); |
| 420 | 424 | url_append_host(&x, p->name); |
| 421 | 425 | if( p->dfltPort!=p->port ){ |
| 422 | 426 | blob_appendf(&x, ":%d", p->port); |
| 427 | + } | |
| 428 | + if( p->isSsh && p->path[0] && fossil_strcmp(p->path, "/")!=0 ){ | |
| 429 | + /* The path of an ssh: URL is held without its first "/". */ | |
| 430 | + blob_append_char(&x, '/'); | |
| 423 | 431 | } |
| 424 | 432 | blob_appendf(&x, "%T", p->path); |
| 425 | 433 | (void)blob_str(&x); |
| 426 | 434 | return x.aData; |
| 427 | 435 | } |
| 428 | 436 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -398,10 +398,14 @@ | |
| 398 | blob_appendf(&x, "@"); |
| 399 | } |
| 400 | url_append_host(&x, p->name); |
| 401 | if( p->dfltPort!=p->port ){ |
| 402 | blob_appendf(&x, ":%d", p->port); |
| 403 | } |
| 404 | blob_appendf(&x, "%T", p->path); |
| 405 | (void)blob_str(&x); |
| 406 | return x.aData; |
| 407 | } |
| @@ -418,10 +422,14 @@ | |
| 418 | } |
| 419 | blob_appendf(&x, "%s://", p->protocol); |
| 420 | url_append_host(&x, p->name); |
| 421 | if( p->dfltPort!=p->port ){ |
| 422 | blob_appendf(&x, ":%d", p->port); |
| 423 | } |
| 424 | blob_appendf(&x, "%T", p->path); |
| 425 | (void)blob_str(&x); |
| 426 | return x.aData; |
| 427 | } |
| 428 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -398,10 +398,14 @@ | |
| 398 | blob_appendf(&x, "@"); |
| 399 | } |
| 400 | url_append_host(&x, p->name); |
| 401 | if( p->dfltPort!=p->port ){ |
| 402 | blob_appendf(&x, ":%d", p->port); |
| 403 | } |
| 404 | if( p->isSsh && p->path[0] && fossil_strcmp(p->path, "/")!=0 ){ |
| 405 | /* The path of an ssh: URL is held without its first "/". */ |
| 406 | blob_append_char(&x, '/'); |
| 407 | } |
| 408 | blob_appendf(&x, "%T", p->path); |
| 409 | (void)blob_str(&x); |
| 410 | return x.aData; |
| 411 | } |
| @@ -418,10 +422,14 @@ | |
| 422 | } |
| 423 | blob_appendf(&x, "%s://", p->protocol); |
| 424 | url_append_host(&x, p->name); |
| 425 | if( p->dfltPort!=p->port ){ |
| 426 | blob_appendf(&x, ":%d", p->port); |
| 427 | } |
| 428 | if( p->isSsh && p->path[0] && fossil_strcmp(p->path, "/")!=0 ){ |
| 429 | /* The path of an ssh: URL is held without its first "/". */ |
| 430 | blob_append_char(&x, '/'); |
| 431 | } |
| 432 | blob_appendf(&x, "%T", p->path); |
| 433 | (void)blob_str(&x); |
| 434 | return x.aData; |
| 435 | } |
| 436 |