From 29e4982454f515af93998f39fb52334f531ad4b9 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 3 Feb 2009 00:12:50 +0000 Subject: [PATCH] Fix for bigfoot with his weird trailing slash in his $HOME. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3115 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/fs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/common/fs.c b/engine/common/fs.c index 33f923893..d0271d2e0 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -3277,9 +3277,12 @@ void COM_InitFilesystem (void) #else //yay for unix!. ev = getenv("HOME"); - if (ev) + if (ev && *ev) { - Q_snprintfz(com_homedir, sizeof(com_homedir), "%s/.fte/", ev); + if (ev[strlen(ev)-1] == '/') + Q_snprintfz(com_homedir, sizeof(com_homedir), "%s.fte/", ev); + else + Q_snprintfz(com_homedir, sizeof(com_homedir), "%s/.fte/", ev); usehome = true; // always use home on unix unless told not to } else