]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: avoid using "[" is URLS in --help output
authorPádraig Brady <P@draigBrady.com>
Sat, 12 Feb 2022 18:43:25 +0000 (18:43 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 12 Feb 2022 18:43:25 +0000 (18:43 +0000)
* src/system.h (emit_ancillary_info): While supported if entered
  manually, the "[" character is not highlighted as part of a
  URL by default in terminals, so avoid using it.
  Addresses https://bugs.gnu.org/53946

src/system.h

index 08cfd3bc07154744d5fb1d4966453628487fae5a..09498a172bcff805355245cc497fd04b9aeaa309 100644 (file)
@@ -716,8 +716,12 @@ emit_ancillary_info (char const *program)
       fputs (_("Report any translation bugs to "
                "<https://translationproject.org/team/>\n"), stdout);
     }
+  /* .htaccess on the coreutils web site maps programs to the appropriate page,
+     however we explicitly handle "[" -> "test" here as the "[" is not
+     recognized as part of a URL by default in terminals.  */
+  char const *url_program = STREQ (program, "[") ? "test" : program;
   printf (_("Full documentation <%s%s>\n"),
-          PACKAGE_URL, program);
+          PACKAGE_URL, url_program);
   printf (_("or available locally via: info '(coreutils) %s%s'\n"),
           node, node == program ? " invocation" : "");
 }