mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
Feature - #352 rc file should support includes
- Added include file support to Config.cpp. - Implemented isAbsolutePath helper. - Added unit tests for isAbsolutePath. - Fixed small bug in bug.bulk.t. - Added TODO items to config.t.cpp.
This commit is contained in:
parent
8d43a35ca4
commit
0780919c2e
8 changed files with 64 additions and 4 deletions
16
src/util.cpp
16
src/util.cpp
|
@ -355,6 +355,13 @@ std::string expandPath (const std::string& in)
|
|||
copy.replace (tilde, 1, pw->pw_dir);
|
||||
}
|
||||
else if ((tilde = copy.find ("~")) != std::string::npos)
|
||||
{
|
||||
struct passwd* pw = getpwuid (getuid ());
|
||||
std::string home = pw->pw_dir;
|
||||
home += "/";
|
||||
copy.replace (tilde, 1, home);
|
||||
}
|
||||
else if ((tilde = copy.find ("~")) != std::string::npos)
|
||||
{
|
||||
std::string::size_type slash;
|
||||
if ((slash = copy.find ("/", tilde)) != std::string::npos)
|
||||
|
@ -369,6 +376,15 @@ std::string expandPath (const std::string& in)
|
|||
return copy;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool isAbsolutePath (const std::string& in)
|
||||
{
|
||||
if (in.length () && in[0] == '/')
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// On Solaris no flock function exists.
|
||||
#ifdef SOLARIS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue