Home GnuPG

core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.

Description

core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.

* src/gpg-error.h.in (gpgrt_fnameconcat): New.
(gpgrt_absfnameconcat): New.
* src/visibility.c (gpgrt_fnameconcat, gpgrt_absfnameconcat): New.
* src/stringutils.c: New file.
(_gpgrt_vfnameconcat): New.
(_gpgrt_fnameconcat, _gpgrt_absfnameconcat): New.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.vers: Ditto.
* src/sysutils.c: Include pwd.h.
(_gpgrt_getpwdir): New.
* configure.ac: Test for pwd.h, getpwnam, getpwuid, and their _r
variants.
* src/Makefile.am (libgpg_error_la_SOURCES): Add new file.
* tests/t-stringutils.c: New.
* tests/t-common.h (xmalloc, xstrdup, xfree): New.
(die): Kludge to avoid compiler warnings.

The new functions are based on the code of make_filename from GnuPG.
They have been written by me ages ago with only minor modifications by
David Shaw. I re-license them from LGPL-3.0+ OR GPL-2.0+ to
LGPL-2.1-or-later.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Feb 18 2020, 8:53 AM
Parents
rEa6ab8e3a710b: w32: Support static link with -lws2_32.
Branches
Unknown
Tags
Unknown