mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 06:32:31 +00:00
* Expand ~ in paths, all uses should be covered.
* Moved option file parsing to VariableMap and added "import" and "try_import" options for loading option files. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@636 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include <functional>
|
||||
#include <stdexcept>
|
||||
#include <dirent.h>
|
||||
#include <rak/path.h>
|
||||
|
||||
#include "directory.h"
|
||||
|
||||
@@ -50,7 +51,7 @@ Directory::is_valid() const {
|
||||
if (m_path.empty())
|
||||
return false;
|
||||
|
||||
DIR* d = opendir(m_path.c_str());
|
||||
DIR* d = opendir(rak::path_expand(m_path).c_str());
|
||||
closedir(d);
|
||||
|
||||
return d;
|
||||
@@ -61,7 +62,7 @@ Directory::update(bool hideDot) {
|
||||
if (m_path.empty())
|
||||
throw std::logic_error("Directory::update() tried to open an empty path");
|
||||
|
||||
DIR* d = opendir(m_path.c_str());
|
||||
DIR* d = opendir(rak::path_expand(m_path).c_str());
|
||||
|
||||
if (d == NULL)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user