From d2b544b9d37c09475630d7a1001b8aec21503e85 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 28 Jul 2019 08:18:28 +0200 Subject: gcc2 and main directory fixes. diff --git a/scav.c b/scav.c index f736d89..8c0a17b 100644 --- a/scav.c +++ b/scav.c @@ -4,6 +4,8 @@ #define VERSION "SDL Scavenger version 1.4.5.4 (1/5/2015)" #include "scav.h" +#include +#include char demolevel0[]={ 0x04,0x44,0x44,0x07,0x00,0x06,0x60,0x00,0x70,0x44,0x44,0x40, @@ -1704,6 +1706,8 @@ int main (int argc, char **argv) strcpy(rcname,RCNAME); strcpy(LevelsName,LEVELSNAME); /* Normally use default name */ + chdir(dirname(argv[0])); + #if defined(__WIN32__) || defined(WIN32) /* Crude command line options for windows (no getopt function) */ if (argc != 1) /* command line option used */ @@ -1758,7 +1762,6 @@ int main (int argc, char **argv) while (1) { int option_index = 0; - opterr = 0; static struct option long_options[] = { {"window", 0, 0, 'w'}, {"help", 0, 0, 'h'}, @@ -1770,6 +1773,7 @@ int main (int argc, char **argv) {"quiet", 0, 0, 'q'}, {0, 0, 0, 0} }; + opterr = 0; c = getopt_long (argc, argv, "hvwsqc:l:L:", long_options, &option_index); -- 2.21.0