diff options
author | Yaniv Kamay <ykamay@redhat.com> | 2010-01-09 15:54:33 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2010-01-10 13:40:53 +0200 |
commit | 0bd3b58bc916525f957994acda875f96c7a036dc (patch) | |
tree | ff420a09e3c3b8801cd268bface296463d55542e /client/x11 | |
parent | db5375a5f898c396fc7e66abf1bb761b16c5a684 (diff) | |
download | spice-0bd3b58bc916525f957994acda875f96c7a036dc.tar.gz spice-0bd3b58bc916525f957994acda875f96c7a036dc.tar.xz spice-0bd3b58bc916525f957994acda875f96c7a036dc.zip |
client: fix logger init mix-up
enable log rotate in case RED_DEBUG is not defined
and disable log rotate in case RED_DEBUG is defined
Diffstat (limited to 'client/x11')
-rw-r--r-- | client/x11/platform.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index 473ba892..1bedb225 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -1899,11 +1899,17 @@ void Platform::get_app_data_dir(std::string& path, const std::string& app_name) { const char* home_dir = getenv("HOME"); - if (!home_dir) { + if (!home_dir || strlen(home_dir) == 0) { throw Exception("get home dir failed"); } path = home_dir; + std::string::iterator end = path.end(); + + while (end != path.begin() && *(end - 1) == '/') { + path.erase(--end); + } + path += "/."; path += app_name; |