[v22,6/9] argp: do not display option name translations if __libc_enable_secure

Message ID 53ee606bab9eba01c1e9cd1d1bfc3298518d1ffd.1776957778.git.vivien@planete-kraus.eu (mailing list archive)
State New
Headers
Series Support translated long option names in getopt and argp |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Vivien Kraus April 23, 2026, 4:04 p.m. UTC
  ---
 argp/argp-help.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/argp/argp-help.c b/argp/argp-help.c
index 0cacf19e33..aad5d7be13 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1215,6 +1215,9 @@  translate_option_name (const char *name, char **allocated)
      one is used.  */
   /* FIXME: use pgettext_expr.  */
   *allocated = NULL;
+  if (__libc_enable_secure)
+    /* Translations are disabled.  */
+    return name;
   if (__asprintf (allocated, "command-line option\004%s", name) == -1)
     {
       /* *allocated is NULL */