mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 05:02:31 +00:00
* Added a default low_diskspace check for 500MB.
* Properly catch the exceptions being thrown by the 'in_*' events. * Expand ~ in ExecFile. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@950 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+15
@@ -58,6 +58,21 @@ path_expand(const std::string& path) {
|
||||
return home + path.substr(1);
|
||||
}
|
||||
|
||||
inline char*
|
||||
path_expand(const char* src, char* first, char* last) {
|
||||
if (*src == '~') {
|
||||
char* home = std::getenv("HOME");
|
||||
|
||||
if (home == NULL)
|
||||
return first;
|
||||
|
||||
first += strlcpy(first, home, std::distance(first, last));
|
||||
src++;
|
||||
}
|
||||
|
||||
return first + strlcpy(first, src, std::distance(first, last));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user