Skip to content
Snippets Groups Projects
Unverified Commit 6dfd683d authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

download: Properly parse ftp:// URLs that lack user info.

Fixes a regression introduced in
a4f54234.

Reported by Hartmut Goebel.

* guix/build/download.scm (ftp-fetch): Account for the case where
'uri-userinfo' returns #f.  Remove the case where it returns "" since
that cannot happen.
parent 9909b8b9
No related branches found
No related tags found
No related merge requests found
...@@ -241,10 +241,8 @@ (define (nar-uri-abbreviation uri) ...@@ -241,10 +241,8 @@ (define (nar-uri-abbreviation uri)
(define* (ftp-fetch uri file #:key timeout) (define* (ftp-fetch uri file #:key timeout)
"Fetch data from URI and write it to FILE. Return FILE on success. Bail "Fetch data from URI and write it to FILE. Return FILE on success. Bail
out if the connection could not be established in less than TIMEOUT seconds." out if the connection could not be established in less than TIMEOUT seconds."
(let* ((userinfo (string-split (uri-userinfo uri) #\:)) (let* ((conn (match (and=> (uri-userinfo uri)
(conn (match userinfo (cut string-split <> #\:))
(("")
(ftp-open (uri-host uri) #:timeout timeout))
(((? string? user)) (((? string? user))
(ftp-open (uri-host uri) #:timeout timeout (ftp-open (uri-host uri) #:timeout timeout
#:username user)) #:username user))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment