Browse Source

Ignore --out option supplied in command-line if -i is used.

You can still use out option in the text file specified in -i.
Tatsuhiro Tsujikawa 14 years ago
parent
commit
4c1c38a33f
2 changed files with 3 additions and 2 deletions
  1. 1 0
      src/download_helper.cc
  2. 2 2
      test/DownloadHelperTest.cc

+ 1 - 0
src/download_helper.cc

@@ -517,6 +517,7 @@ void createRequestGroupForUriList
     }
 
     SharedHandle<Option> requestOption(new Option(*option.get()));
+    requestOption->remove(PREF_OUT);
     for(std::set<std::string>::const_iterator i =
           listRequestOptions().begin(), eoi = listRequestOptions().end();
         i != eoi; ++i) {

+ 2 - 2
test/DownloadHelperTest.cc

@@ -302,8 +302,8 @@ void DownloadHelperTest::testCreateRequestGroupForUriList()
 
   SharedHandle<RequestGroup> fileISOGroup = result[1];
   SharedHandle<DownloadContext> fileISOCtx = fileISOGroup->getDownloadContext();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp/file.out"),
-                       fileISOCtx->getBasePath());
+  // PREF_OUT in option_ must be ignored.
+  CPPUNIT_ASSERT_EQUAL(std::string(), fileISOCtx->getBasePath());
 }
 
 #ifdef ENABLE_BITTORRENT