From 378570256c995317907b3b38ddfcb87f5e73c2b7 Mon Sep 17 00:00:00 2001
From: Spoike <acceptthis@users.sourceforge.net>
Date: Tue, 15 Sep 2020 08:55:53 +0000
Subject: [PATCH] Make sure -homedir arg ends with a slash, to avoid messy
 surprises.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5764 fc73d0e0-1445-4013-8a0c-d673dee63da5
---
 engine/common/fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/engine/common/fs.c b/engine/common/fs.c
index 965154739..3d8b1033c 100644
--- a/engine/common/fs.c
+++ b/engine/common/fs.c
@@ -6964,6 +6964,8 @@ static void COM_InitHomedir(ftemanifest_t *man)
 	if (i && i+1<com_argc)
 	{	//explicitly override the homedir.
 		Q_strncpyz(com_homepath, com_argv[i+1], sizeof(com_homepath));
+		if (*com_homepath && com_homepath[strlen(com_homepath)-1] != '/')
+			Q_strncatz(com_homepath, "/", sizeof(com_homepath));
 		com_homepathusable = true;
 	}
 	if (COM_CheckParm("-usehome"))