Fixed a compiler crash on Linux when the include directory didn't exist

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401318
This commit is contained in:
Scott Ehlert 2007-08-12 05:54:09 +00:00
parent aad8efc0a7
commit ed88587a2f
2 changed files with 7 additions and 1 deletions

View File

@ -36,7 +36,7 @@ else
CPPFLAGS += $(OPT_CPP_FLAGS)
endif
CFLAGS += -DLINUX -DNDEBUG -DHAVE_STDINT_H -DAMX_ANSIONLY
CFLAGS += -DLINUX -DNDEBUG -DHAVE_STDINT_H -DAMX_ANSIONLY -DENABLE_BINRELOC
CPPFLAGS += -Wno-deprecated -fno-exceptions -fno-rtti
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)

View File

@ -1129,6 +1129,12 @@ static void setconfig(char *root)
/* add the default "include" directory */
#if defined __WIN32__ || defined _WIN32
GetModuleFileNameA(NULL,path,_MAX_PATH);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
/* see www.autopackage.org for the BinReloc module */
br_init_lib(NULL);
ptr=br_find_exe("spcomp");
strlcpy(path,ptr,sizeof path);
free(ptr);
#else
if (root!=NULL)
strlcpy(path,root,sizeof path); /* path + filename (hopefully) */