Browse Source

2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Removed options which is only valid for URIs specified in
	command-line.  If they are left, because op is used as a template
	for new RequestGroup(such as created in XML-RPC command,
	BtPostDownloadHandler etc), they causes unintentional effect.
	* src/main.cc
Tatsuhiro Tsujikawa 16 years ago
parent
commit
b80de5e010
2 changed files with 17 additions and 0 deletions
  1. 8 0
      ChangeLog
  2. 9 0
      src/main.cc

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2009-11-28  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Removed options which is only valid for URIs specified in
+	command-line.  If they are left, because op is used as a template
+	for new RequestGroup(such as created in XML-RPC command,
+	BtPostDownloadHandler etc), they causes unintentional effect.
+	* src/main.cc
+
 2009-11-28  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Refer to option value of PREF_OUT only in download_helper.

+ 9 - 0
src/main.cc

@@ -250,6 +250,15 @@ downloadresultcode::RESULT main(int argc, char* argv[])
 	  createRequestGroupForUri(requestGroups, op, args);
 	}
 
+    // Remove option values which is only valid for URIs specified in
+    // command-line. If they are left, because op is used as a
+    // template for new RequestGroup(such as created in XML-RPC
+    // command), they causes unintentional effect.
+    op->remove(PREF_OUT);
+    op->remove(PREF_FORCE_SEQUENTIAL);
+    op->remove(PREF_INPUT_FILE);
+    op->remove(PREF_INDEX_OUT);
+    op->remove(PREF_SELECT_FILE);
     if(
 #ifdef ENABLE_XML_RPC
        !op->getAsBool(PREF_ENABLE_XML_RPC) &&