1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: New function substitute_vars.

* common/stringhelp.c (substitute_envvars): Factor code out to
(substitute_vars): new.
(subst_getenv): New.
--

This is a generalized version of substitute_envvars.

(cherry picked from commit 7b7fdf45e5)
This commit is contained in:
Werner Koch 2023-06-06 18:19:37 +02:00
parent 159fb5cdbb
commit eeda4ef7d2
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 42 additions and 7 deletions

View file

@ -169,7 +169,10 @@ int compare_version_strings (const char *my_version, const char *req_version);
/* Format a string so that it fits within about TARGET_COLS columns. */
char *format_text (const char *text, int target_cols, int max_cols);
/* Substitute environmen variabales in STRING. */
/* Substitute variables in STRING. */
char *substitute_vars (const char *string,
const char *(*getval)(void *cookie, const char *name),
void *cookie);
char *substitute_envvars (const char *string);