diff --git a/Makefile b/Makefile index 4fae6be..ce6e765 100644 --- a/Makefile +++ b/Makefile @@ -30,12 +30,12 @@ options: %.o: %.c $(ECHO) CC $< @mkdir -p .depend - $(QUIET)${CC} -c ${CFLAGS} -o $@ $< -MMD -MF .depend/$@.dep + $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF .depend/$@.dep %.do: %.c $(ECHO) CC $< @mkdir -p .depend - $(QUIET)${CC} -c ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep + $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep # force recompilation of database.o if DATABASE has changed database.o: database-${DATABASE}.o diff --git a/completion.c b/completion.c index f113168..16f3474 100644 --- a/completion.c +++ b/completion.c @@ -50,7 +50,9 @@ cc_open(girara_session_t* session, const char* input) #endif char cwd[path_max]; - getcwd(cwd, path_max); + if (getcwd(cwd, path_max) == NULL) { + goto error_free; + } char* tmp_path = g_strdup_printf("%s/%s", cwd, path); if (tmp_path == NULL) { diff --git a/config.mk b/config.mk index 4e0e1b6..da58c87 100644 --- a/config.mk +++ b/config.mk @@ -29,7 +29,8 @@ INCS = ${GIRARA_INC} ${GTK_INC} LIBS = ${GIRARA_LIB} ${GTK_LIB} $(DL_LIB) -lpthread -lm # flags -CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS) -DZATHURA_PLUGINDIR=\"${PLUGINDIR}\" +CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS) +CPPFLAGS += -DZATHURA_PLUGINDIR=\"${PLUGINDIR}\" # debug DFLAGS ?= -g