summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-18 16:58:12 +0000
committerKarl Berry <karl@freefriends.org>2021-05-18 16:58:12 +0000
commit795f209c807150ac14e95c4f2ded2aa468f0cb9f (patch)
treec35d54676d21e361c3ecb10c53a8ce58721b98a7 /Build/source/texk/web2c/lib
parent8c427c519c09a5b37bf093cfce57788e1d45af9f (diff)
add url for @tug.org bug reporting addresses
git-svn-id: svn://tug.org/texlive/trunk@59252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/usage.c46
2 files changed, 37 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 1f82cfdb9ee..96c5d0cd99f 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-18 Karl Berry <karl@freefriends.org>
+
+ * usage.c (usagehelp): if bug_email arg ends in "@tug.org"
+ also output the url for the mailing list.
+
2021-04-28 Marcel Fabian Krueger <tex@2krueger.de>
Hironori KITAGAWA <h_kitagawa2001@yahoo.co.jp>
Karl Berry <karl@freefriends.org>
diff --git a/Build/source/texk/web2c/lib/usage.c b/Build/source/texk/web2c/lib/usage.c
index 4c6bc5bbe0a..bec11054615 100644
--- a/Build/source/texk/web2c/lib/usage.c
+++ b/Build/source/texk/web2c/lib/usage.c
@@ -5,8 +5,8 @@
#include <w2c/config.h>
-/* Call usage if the program exits with an "usage error". STR is supposed
- to be the program name. */
+/* Print a message about trying --help with program name STR and exit
+ with bad status. */
void
usage (const_string str)
@@ -15,21 +15,39 @@ usage (const_string str)
uexit (1);
}
-/* Call usage if the program exits by printing the help message.
- MESSAGE is a NULL-terminated array of strings which make up the
- help message. Each string is printed on a separate line.
- We use arrays instead of a single string to work around compiler
- limitations (sigh).
-*/
+
+/* Print MESSAGE, a NULL-terminated array of strings which make up the
+ help message, and exit successfully. Each string is printed on a
+ separate line. We use arrays instead of a single string to work
+ around compiler limitations (sigh). Then print a line about sending
+ bug reports to BUG_EMAIL, which defaults to tex-k@tug.org if passed
+ NULL. If BUG_EMAIL is @tug.org, also output a url to the mailing list. */
+
void
usagehelp (const_string *message, const_string bug_email)
{
- if (!bug_email)
- bug_email = "tex-k@tug.org";
+ if (!bug_email) {
+ bug_email = "tex-k@tug.org";
+ }
+
while (*message) {
- printf("%s\n", *message);
- ++message;
+ printf ("%s\n", *message);
+ ++message;
+ }
+
+ printf ("\nEmail bug reports to %s", bug_email);
+ if (strlen (bug_email) > 9) {
+ const_string domain = strchr (bug_email, '@');
+ if (domain && strcmp (domain, "@tug.org") == 0) {
+ const_string ptr;
+
+ printf (" (https://lists.tug.org/");
+ for (ptr = bug_email; ptr < domain; ptr++) {
+ putchar (*ptr);
+ }
+ printf (")");
+ }
}
- printf("\nEmail bug reports to %s.\n", bug_email);
- uexit(0);
+ puts (".");
+ uexit (0);
}