From: Guus Sliepen Date: Sat, 21 Nov 2015 19:42:26 +0000 (+0100) Subject: Only try to chdir(PAKLOCATION) if it's actually set. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4f6dfab63e690fc646353823357e4bf0568e93da;p=quix0rs-blobwars.git Only try to chdir(PAKLOCATION) if it's actually set. --- diff --git a/Makefile.windows b/Makefile.windows index 245b951..d4adc68 100755 --- a/Makefile.windows +++ b/Makefile.windows @@ -4,7 +4,7 @@ DOCS = doc/* ICONS = icons/ DATA = data gfx sound music -VERSION = 1.19 +VERSION = 2.00 RELEASE ?= 1 USEPAK ?= 1 @@ -23,7 +23,7 @@ CXX = i686-w64-mingw32-g++ CXXFLAGS += -Dmain=SDL_main CXXFLAGS += -I/your/mingw/include CXXFLAGS += -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DUSEPAK=$(USEPAK) -CXXFLAGS += -DPAKNAME=\"$(PAKNAME)\" -DPAKLOCATION=\"\" -DGAMEPLAYMANUAL=\"doc/index.html\" -Wall +CXXFLAGS += -DPAKNAME=\"$(PAKNAME)\" -DPAKLOCATION=\".\" -DGAMEPLAYMANUAL=\"doc/index.html\" -Wall CXXFLAGS += -DLOCALEDIR=\"\" $(CFLAGS) -DMEDAL_SERVER_HOST=\"$(MEDAL_SERVER_HOST)\" -DMEDAL_SERVER_PORT=$(MEDAL_SERVER_PORT) -Werror LIBS = -lmingw32 -lz -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lSDL2_net -lSDL2main -lSDL2 -lwinmm -lgdi32 PAKLIBS = -lmingw32 -lz diff --git a/src/main.cpp b/src/main.cpp index 9282a1e..dbab69d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,12 +124,14 @@ int main(int argc, char *argv[]) #endif #if RELEASE - if (chdir(PAKLOCATION)) + #ifdef PAKLOCATION + if (PAKLOCATION[0] && chdir(PAKLOCATION)) { - perror("Could not chdir to " PAKLOCATION ":"); + perror("Could not chdir to '" PAKLOCATION "'"); return 1; } #endif + #endif config.engine = &engine;