From a6b179571fa009c98e7c9621b106d016cf029a25 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 28 Aug 2000 16:14:42 +0000 Subject: [PATCH] com.c: fix endian detection quakefs.c: don't create the gamedir if userpath is . --- source/com.c | 12 +++--------- source/quakefs.c | 5 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/com.c b/source/com.c index c49d4fd..cb5627a 100644 --- a/source/com.c +++ b/source/com.c @@ -77,11 +77,7 @@ COM_Init */ void COM_Init () { - byte swaptest[2] = {1,0}; - -// set the byte swapping variables in a portable manner - if ( *(short *)swaptest == 1) - { +#ifndef WORDS_BIGENDIAN bigendien = false; BigShort = ShortSwap; LittleShort = ShortNoSwap; @@ -89,9 +85,7 @@ void COM_Init () LittleLong = LongNoSwap; BigFloat = FloatSwap; LittleFloat = FloatNoSwap; - } - else - { +#else bigendien = true; BigShort = ShortNoSwap; LittleShort = ShortSwap; @@ -99,7 +93,7 @@ void COM_Init () LittleLong = LongSwap; BigFloat = FloatNoSwap; LittleFloat = FloatSwap; - } +#endif registered = Cvar_Get("registered", "0", CVAR_NONE, "None"); cmdline = Cvar_Get("cmdline", "0", CVAR_SERVERINFO, "None"); diff --git a/source/quakefs.c b/source/quakefs.c index a795c5a..1963765 100644 --- a/source/quakefs.c +++ b/source/quakefs.c @@ -900,8 +900,9 @@ COM_InitFilesystem ( void ) /* start up with basegame->string by default */ - COM_CreatePath (va("%s/%s/dummy", fs_userpath->string, - fs_basegame->string)); + if (strcmp (fs_userpath->string, FS_USERPATH)) + COM_CreatePath (va("%s/%s/dummy", fs_userpath->string, + fs_basegame->string)); COM_AddGameDirectory(fs_basegame->string); if (hipnotic) COM_AddGameDirectory ("hipnotic");