2534 printf("http://"); |
2534 printf("http://"); |
2535 hostindex = 7; |
2535 hostindex = 7; |
2536 } |
2536 } |
2537 printf("%.*s", (int)repo->user.value.length, repo->user.value.ptr); |
2537 printf("%.*s", (int)repo->user.value.length, repo->user.value.ptr); |
2538 if(repo->password.value.ptr) { |
2538 if(repo->password.value.ptr) { |
|
2539 cxmutstr pw_decoded = dav_repository_get_decodedpassword(repo); |
2539 CURL *curl = curl_easy_init(); |
2540 CURL *curl = curl_easy_init(); |
2540 char *pw = curl_easy_escape( |
2541 char *pw = curl_easy_escape( |
2541 curl, |
2542 curl, |
2542 repo->password.value.ptr, |
2543 pw_decoded.ptr, |
2543 repo->password.value.length); |
2544 pw_decoded.length); |
2544 printf(":%s", pw); |
2545 printf(":%s", pw); |
2545 curl_free(pw); |
2546 curl_free(pw); |
2546 curl_easy_cleanup(curl); |
2547 curl_easy_cleanup(curl); |
|
2548 free(pw_decoded.ptr); |
2547 } |
2549 } |
2548 putchar('@'); |
2550 putchar('@'); |
2549 printf("%.*s", (int)url.length-hostindex, url.ptr+hostindex); |
2551 printf("%.*s", (int)url.length-hostindex, url.ptr+hostindex); |
2550 } else { |
2552 } else { |
2551 printf("%s", url.ptr); |
2553 printf("%s", url.ptr); |