summaryrefslogtreecommitdiffstats
path: root/src/arlib-argp.c
diff options
context:
space:
mode:
authorTimm Bäder <[email protected]>2021-01-08 09:13:28 +0100
committerMark Wielaard <[email protected]>2021-01-29 21:57:17 +0100
commit0d8cbca2c0dbb43b9376b34676620e3027075852 (patch)
treec61717a9cfd5715bd1f06407427377045de80cfe /src/arlib-argp.c
parent04e19e8a449beefad8a451bdd9a55afa8ab61456 (diff)
arlib-argp: Pull text_for_default() into file scope
Get rid of a nested function this way. Signed-off-by: Timm Bäder <[email protected]>
Diffstat (limited to 'src/arlib-argp.c')
-rw-r--r--src/arlib-argp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/arlib-argp.c b/src/arlib-argp.c
index c07d9299..a3c12e4d 100644
--- a/src/arlib-argp.c
+++ b/src/arlib-argp.c
@@ -57,25 +57,26 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
}
static char *
-help_filter (int key, const char *text, void *input __attribute__ ((unused)))
+text_for_default (const char *text)
{
- inline char *text_for_default (void)
- {
- char *new_text;
- if (unlikely (asprintf (&new_text, _("%s (default)"), text) < 0))
- return (char *) text;
- return new_text;
- }
+ char *new_text;
+ if (unlikely (asprintf (&new_text, _("%s (default)"), text) < 0))
+ return (char *) text;
+ return new_text;
+}
+static char *
+help_filter (int key, const char *text, void *input __attribute__ ((unused)))
+{
switch (key)
{
case 'D':
if (DEFAULT_AR_DETERMINISTIC)
- return text_for_default ();
+ return text_for_default (text);
break;
case 'U':
if (! DEFAULT_AR_DETERMINISTIC)
- return text_for_default ();
+ return text_for_default (text);
break;
}