summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index e2cea15..e5456c6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -35,6 +35,7 @@
#include <string.h>
#include <sys/wait.h>
#include <ctype.h>
+#include <pwd.h>
#include "ratpoison.h"
@@ -423,8 +424,15 @@ read_startup_files (char *alt_rcfile)
homedir = getenv ("HOME");
if (!homedir)
{
- PRINT_ERROR (("ratpoison: $HOME not set!?\n"));
+ struct passwd *pw;
+
+ pw = getpwuid (getuid ());
+ if (pw)
+ homedir = pw->pw_dir;
}
+
+ if (!homedir)
+ PRINT_ERROR (("ratpoison: no home directory!?\n"));
else
{
char *filename;