From 6cb5c7a104d85440398c5e926c5a7f8d5d6e3371 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Wed, 3 Nov 2010 10:59:36 +0100 Subject: [PATCH] Bug - fixed #527 - extended directory check in Uri for local uri/paths --- src/Uri.cpp | 9 ++++++--- src/command.cpp | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Uri.cpp b/src/Uri.cpp index 75192340f..7b27dbf58 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -126,9 +126,12 @@ std::string Uri::extension () const //////////////////////////////////////////////////////////////////////////////// bool Uri::is_directory () const { - return (path == ".") - || (path == "") - || (path[path.length()-1] == '/'); + if (is_local ()) + return Path (this->data).is_directory (); + else + return (path == ".") + || (path == "") + || (path[path.length()-1] == '/'); } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/command.cpp b/src/command.cpp index edb5e3f7f..bf46f9f6a 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -716,8 +716,7 @@ void handlePull (std::string& outs) { Directory location (context.config.get ("data.location")); - if (! uri.append ("{pending,undo,completed}.data") || - ! Path (uri.data).is_directory ()) + if (! uri.append ("{pending,undo,completed}.data")) throw std::string ("The uri '") + uri.path + "' is not a local directory."; Transport* transport;