From 4f6dfab63e690fc646353823357e4bf0568e93da Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 21 Nov 2015 20:42:26 +0100 Subject: [PATCH] Only try to chdir(PAKLOCATION) if it's actually set. --- Makefile.windows | 4 ++-- src/main.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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; -- 2.39.5