From 5aa6d15dcd3533ed8330462b9d4024a9eff9fbff Mon Sep 17 00:00:00 2001 From: gewlitys Date: Tue, 29 Oct 2002 01:16:12 +0000 Subject: [PATCH] Fixed it little more (so default behaviour is same for win32 and linux now) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@182 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/starcon2.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index bedbc3cfa..5a2f55b2a 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -34,19 +34,19 @@ void CDToContentDir (char *contentdir) { - char *testfile = "starcon.txt"; - - if (!FileExists (testfile)) - { - if (chdir (contentdir) || !FileExists (testfile)) - { - if (chdir ("content") || !FileExists (testfile)) + char *testfile = "starcon.txt"; + + if (!FileExists (testfile)) + { + if (chdir (contentdir) || !FileExists (testfile)) + { + if (chdir ("../../content") || !FileExists (testfile)) { fprintf(stderr, "Fatal error: content not available, running from wrong dir?\n"); exit(-1); } - } - } + } + } } int @@ -83,11 +83,7 @@ main (int argc, char *argv[]) fprintf (stderr, "The Ur-Quan Masters v%d.%d (compiled %s %s)\n", UQM_MAJOR_VERSION, UQM_MINOR_VERSION, __DATE__, __TIME__); -#ifndef WIN32 strcpy (contentdir, "content"); -#else - strcpy (contentdir, "../../content"); -#endif while ((c = getopt_long(argc, argv, "r:d:fob:ptc:?hM:S:T:emq:", long_options, &option_index)) != -1) {