Browse Source

2009-10-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Allowed non-regular file in LocalFilePathOptionHandler
	* src/OptionHandlerImpl.h
	* src/message.h
Tatsuhiro Tsujikawa 16 years ago
parent
commit
4536bd7211
3 changed files with 9 additions and 2 deletions
  1. 6 0
      ChangeLog
  2. 2 1
      src/OptionHandlerImpl.h
  3. 1 1
      src/message.h

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-10-17  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Allowed non-regular file in LocalFilePathOptionHandler
+	* src/OptionHandlerImpl.h
+	* src/message.h
+
 2009-10-17  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Fixed the bug that Netrc::parse() cannot recognize comment line.

+ 2 - 1
src/OptionHandlerImpl.h

@@ -587,7 +587,8 @@ public:
 
   virtual void parseArg(Option& option, const std::string& optarg)
   {
-    if(!File(optarg).isFile()) {
+    File f(optarg);
+    if(!f.exists() || f.isDir()) {
       throw DL_ABORT_EX
 	(StringFormat(MSG_NOT_FILE, optarg.c_str()).str());
     }

+ 1 - 1
src/message.h

@@ -174,7 +174,7 @@
 #define MSG_GID_NOT_PROVIDED "GID is not provided."
 #define MSG_CANNOT_PARSE_XML_RPC_REQUEST "Failed to parse xml-rpc request."
 #define MSG_GOOD_BYE_SEEDER "Client is in seed state: Good Bye Seeder;)"
-#define MSG_NOT_FILE _("Is '%s' a regular file?")
+#define MSG_NOT_FILE _("Is '%s' a file?")
 
 #define EX_TIME_OUT _("Timeout.")
 #define EX_INVALID_CHUNK_SIZE _("Invalid chunk size.")