Blob Blame History Raw
From 0f7273a52b4158c7193e44b128a9e54db74c7979 Mon Sep 17 00:00:00 2001
From: "Alexander V. Lukyanov" <lavv17f@gmail.com>
Date: Wed, 1 Apr 2015 16:00:52 +0300
Subject: [PATCH] mirror: fixed redirection to a file with full URL.

---
 src/MirrorJob.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/MirrorJob.cc b/src/MirrorJob.cc
index 7f89e11..ef594bc 100644
--- a/src/MirrorJob.cc
+++ b/src/MirrorJob.cc
@@ -660,9 +660,9 @@ void MirrorJob::HandleChdir(FileAccessRef& session, int &redirections)
 	    char *loc=alloca_strdup(loc_c);
 	    ParsedURL u(loc,true);
 
+	    bool is_file=(last_char(loc)!='/');
 	    if(!u.proto)
 	    {
-	       bool is_file=(last_char(loc)!='/');
 	       FileAccess::Path new_cwd(session->GetNewCwd());
 	       new_cwd.Change(0,is_file,loc);
 	       session->PathVerify(new_cwd);
@@ -671,7 +671,8 @@ void MirrorJob::HandleChdir(FileAccessRef& session, int &redirections)
 	    }
 	    session->Close(); // loc_c is no longer valid.
 	    session=FA::New(&u);
-	    session->Chdir(u.path);
+	    FileAccess::Path new_cwd(u.path,is_file,url::path_ptr(loc));
+	    session->PathVerify(new_cwd);
 	    return;
 	 }
       }
-- 
2.1.0