get proper user home dir on WIN32 and adjust folders in this case a bit

This commit is contained in:
Andrzej Rybczak
2009-03-26 20:23:47 +01:00
parent a670be05fe
commit 49a13222a3
6 changed files with 26 additions and 6 deletions

View File

@@ -27,6 +27,12 @@
#include "menu.h"
#include "scrollpad.h"
#ifdef WIN32
# define HOME_ENV "USERPROFILE"
#else
# define HOME_ENV "HOME"
#endif // WIN32
#ifdef HAVE_PTHREAD_H
# include <pthread.h>
#else
@@ -41,7 +47,9 @@ typedef std::pair<std::string, std::string> string_pair;
const int ncmpcpp_window_timeout = 250;
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";
const std::string home_path = getenv(HOME_ENV) ? getenv(HOME_ENV) : "";
#undef HOME_ENV
#endif