From a788453eccdb7863e837b7795bd559d4aecc9067 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 11 Dec 2016 08:32:48 -0200 Subject: [PATCH] =?utf8?q?Busca=20os=20arquivos=20de=20ajuda=20no=20diret?= =?utf8?q?=C3=B3rio=20instalado.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Exporta DOCDIR para o código para que busque os arquivos de ajuda no local em que foram instalados. --- lib/Makefile.am | 2 ++ lib/help.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index 1d26720..e3be5d0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,3 +1,5 @@ +AM_CPPFLAGS = -DDOCDIR=\"'$(docdir)'\" + noinst_LTLIBRARIES = libreceita.la libreceita_la_SOURCES = declaracao.c declaracao.h \ token.c token.h \ diff --git a/lib/help.c b/lib/help.c index 66573ba..39a53e1 100644 --- a/lib/help.c +++ b/lib/help.c @@ -26,7 +26,11 @@ #include "cmd.h" #include "util.h" -static const char *helpdir = "help"; +#ifndef DOCDIR +#define DOCDIR "help" +#endif + +static const char *helpdir = DOCDIR; static int run_help(struct declaracao *dec, char **args, int argc) { -- 2.20.1