From a9fc729253eec88f56d810bd2a8edd327267c5b4 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 19 Nov 2025 13:38:15 +0900 Subject: argparse: Use SYSCONFDIR for /etc. * src/Makefile.am (libgpg_error_la_CPPFLAGS): Add SYSCONFDIR. * src/argparse.c (_gpgrt_argparser): Use it. -- GnuPG-bug-id: 7894 Signed-off-by: NIIBE Yutaka --- src/Makefile.am | 3 ++- src/argparse.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 6a3b5e4..5f06a29 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -214,7 +214,8 @@ nodist_libgpg_error_la_SOURCES = gpg-error.h # libgpg_error_la_DEPENDENCIES = \ # $(srcdir)/gpg-error.vers -libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" +libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD) gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c diff --git a/src/argparse.c b/src/argparse.c index 5fb03b3..c669a3f 100644 --- a/src/argparse.c +++ b/src/argparse.c @@ -2381,7 +2381,7 @@ _gpgrt_argparser (gpgrt_argparse_t *arg, gpgrt_opt_t *opts, s = confname; xfree (arg->internal->confname); arg->internal->confname = _gpgrt_fnameconcat - (confdir.sys? confdir.sys : "/etc", s, NULL); + (confdir.sys? confdir.sys : SYSCONFDIR, s, NULL); _gpgrt_free (tmpname); if (!arg->internal->confname) return (arg->r_opt = ARGPARSE_OUT_OF_CORE); -- cgit