From nobody Sat Sep 9 03:53:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RjJxD51X3z4sq0s; Sat, 9 Sep 2023 03:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RjJxD4NgBz3R27; Sat, 9 Sep 2023 03:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694231616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nUG7w4mUKCKpEOfeWaHZrHxHIYDXSSrRwKeouCYJqHU=; b=JLVOAiuTQNRjdvPNvQQH5NYtOm55qwLyjsxzb/kfYkn6lk7UsPJlVF7xPo6jHnDbgqVYy0 xv+nxTqtTncrWAtkGUaD0Y7KvWtzt+FRT0aOw3cKAq+uPKl/TPHyidXNLD8De3EFbHDq6Q bXj1ddGEQmDrZJg9TFAl3HkRc0yfjxgFqiI/SMO6GrX5WDn6zeQrdb94Wm6QHZVVYNJfwZ dKdNO88RjbcPy4L7DCyAEw0B6ojJU+j6+zLiaq1EZTSDMD6yxspA+0qOOrafuJtJpgN1P7 Wb0KyBjZhntVRSGaOxFIIIs+fDDqRUgxdQ+yCs1A2MubWLcVfz/dyVcmn4jIVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694231616; a=rsa-sha256; cv=none; b=hvXU6HTrBantXuXNjaTY4YCI73a/z7xauA9XdmIGrtZz7x8lNDfFvQrt/cBaJMZ/h+gE81 TPNR17TvjKEAzmNUmylULfnuGCWR1aZM0xodsUHjqGj4l3XK8mlckTG6955T525KGP7C1Y rfTkmxMGon+b7/uPL9iQRlML/Gt3hhYaXIzed2EgCU7Vv1kPGfyt0tDof+VkkPR+7KRtN1 4rXGjdytB09WOpewb71IrW7eF/aSZN3TsgC67415jT0RlJxQfC3KNOsbgniLZwq8q7oqC3 hmJhc9Y2tlWEHNRKmRyp+fNMYBc5CvZ77NlO+YgS3QkMNAQCLxhysFPpT+NhBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694231616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nUG7w4mUKCKpEOfeWaHZrHxHIYDXSSrRwKeouCYJqHU=; b=qbzTzF4/3XA/ghbUnlUOrC2rOKXzPaePn7vAXu2+NMmuFd+qThvXxqcfkKwmS+lpgza8O4 v6rOJkZad4eeJ5Gjs8t5hgc4RNoTxIKKSSmCvvK50w4ggWCNq5BsrYak4/JiCEtIfUYXU6 3vireIGFX/2+3nLtqHN0+Tpe8lCEdD8/cK2gpDfeeTYBLywn3XBZWV/OVSj6EgfP3WwMlS qKbyFqZzrlyuMs+IBYUyp8i5o40NdtD2oXbrowCGqOWZ+yGWtCsQrPvJOOuBxUjF9Suk2c vuUUkP8sE40Kx4X137prwfuSyttl9U7YMiCTmYvl+qxFpOKWqxgOjN8k3PYC4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RjJxD3H9fz189c; Sat, 9 Sep 2023 03:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3893rabF003345; Sat, 9 Sep 2023 03:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3893raI3003342; Sat, 9 Sep 2023 03:53:36 GMT (envelope-from git) Date: Sat, 9 Sep 2023 03:53:36 GMT Message-Id: <202309090353.3893raI3003342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: dc8ee27074d4 - stable/14 - localedef: add newlines to error messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dc8ee27074d4060549c6ecdc88eeec386691b479 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=dc8ee27074d4060549c6ecdc88eeec386691b479 commit dc8ee27074d4060549c6ecdc88eeec386691b479 Author: Kyle Evans AuthorDate: 2023-09-02 06:24:34 +0000 Commit: Kyle Evans CommitDate: 2023-09-09 03:52:58 +0000 localedef: add newlines to error messages These won't be added elsewhere, so add a little bit of room to make these messages a little easier to read. The existing set is a mixed bag, there are somewhere in the ballpark of 45, 46 printfs to stderr and 19 of those had newlines. Reviewed by: yuripv Sponsored by: Klara, Inc. (cherry picked from commit 3141e51d2e38fa7b9e6d81477dfa860d087c514d) --- usr.bin/localedef/collate.c | 34 +++++++++++++++++----------------- usr.bin/localedef/localedef.c | 4 ++-- usr.bin/localedef/localedef.h | 2 +- usr.bin/localedef/monetary.c | 4 ++-- usr.bin/localedef/numeric.c | 2 +- usr.bin/localedef/time.c | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index d76c2c2c08b2..2a080773a95e 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -272,7 +272,7 @@ new_pri(void) maxpri = maxpri ? maxpri * 2 : 1024; prilist = realloc(prilist, sizeof (collpri_t) * maxpri); if (prilist == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return (-1); } for (i = numpri; i < maxpri; i++) { @@ -333,7 +333,7 @@ resolve_pri(int32_t ref) if (pri->pass == pass) { /* report a line with the circular symbol */ lineno = pri->lineno; - fprintf(stderr,"circular reference in order list"); + fprintf(stderr,"circular reference in order list\n"); return (-1); } if ((pri->pri < 0) || (pri->pri >= numpri)) { @@ -494,7 +494,7 @@ define_collsym(char *name) collsym_t *sym; if ((sym = calloc(1, sizeof(*sym))) == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return; } sym->name = name; @@ -541,7 +541,7 @@ get_collundef(char *name) if ((ud = RB_FIND(collundefs, &collundefs, &srch)) == NULL) { if (((ud = calloc(1, sizeof(*ud))) == NULL) || ((ud->name = strdup(name)) == NULL)) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); free(ud); return (NULL); } @@ -565,7 +565,7 @@ get_collchar(wchar_t wc, int create) cc = RB_FIND(collchars, &collchars, &srch); if ((cc == NULL) && create) { if ((cc = calloc(1, sizeof(*cc))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return (NULL); } for (i = 0; i < NUM_WT; i++) { @@ -687,7 +687,7 @@ start_order(int type) /* this is used to protect ELLIPSIS processing */ if ((lastorder == T_ELLIPSIS) && (type != T_CHAR)) { - fprintf(stderr, "character value expected"); + fprintf(stderr, "character value expected\n"); } for (i = 0; i < COLL_WEIGHTS_MAX; i++) { @@ -728,7 +728,7 @@ start_order_char(wchar_t wc) int i; if (wc < ellipsis_start) { - fprintf(stderr, "malformed range!"); + fprintf(stderr, "malformed range!\n"); return; } while (ellipsis_start < wc) { @@ -776,7 +776,7 @@ start_order_ellipsis(void) start_order(T_ELLIPSIS); if (lastorder != T_CHAR) { - fprintf(stderr, "illegal starting point for range"); + fprintf(stderr, "illegal starting point for range\n"); return; } @@ -792,12 +792,12 @@ define_collelem(char *name, wchar_t *wcs) int i; if (wcslen(wcs) >= COLLATE_STR_LEN) { - fprintf(stderr,"expanded collation element too long"); + fprintf(stderr,"expanded collation element too long\n"); return; } if ((e = calloc(1, sizeof(*e))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } e->expand = wcs; @@ -816,7 +816,7 @@ define_collelem(char *name, wchar_t *wcs) /* A character sequence can only reduce to one element. */ if ((RB_FIND(elem_by_symbol, &elem_by_symbol, e) != NULL) || (RB_FIND(elem_by_expand, &elem_by_expand, e) != NULL)) { - fprintf(stderr, "duplicate collating element definition"); + fprintf(stderr, "duplicate collating element definition\n"); free(e); return; } @@ -932,7 +932,7 @@ add_order_subst(void) if (s == NULL) { if ((s = calloc(1, sizeof(*s))) == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return; } s->key = new_pri(); @@ -976,7 +976,7 @@ static void add_subst_pri(int32_t ref) { if (curr_subst >= COLLATE_STR_LEN) { - fprintf(stderr,"substitution string is too long"); + fprintf(stderr,"substitution string is too long\n"); return; } subst_weights[curr_subst] = ref; @@ -1040,7 +1040,7 @@ add_weight(int32_t ref, int pass) return; if ((w = calloc(1, sizeof(*w))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } w->pri = srch.pri; @@ -1214,7 +1214,7 @@ dump_collate(void) RB_COUNT(temp, substs, &substs[i], n); subst_count[i] = n; if ((st = calloc(n, sizeof(collate_subst_t))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } n = 0; @@ -1245,7 +1245,7 @@ dump_collate(void) RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, chain_count); chain = calloc(chain_count, sizeof(collate_chain_t)); if (chain == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } n = 0; @@ -1265,7 +1265,7 @@ dump_collate(void) RB_NUMNODES(collchar_t, collchars, &collchars, n); large = calloc(n, sizeof(collate_large_t)); if (large == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } diff --git a/usr.bin/localedef/localedef.c b/usr.bin/localedef/localedef.c index ae0bd052b40c..5ff146d6f655 100644 --- a/usr.bin/localedef/localedef.c +++ b/usr.bin/localedef/localedef.c @@ -167,7 +167,7 @@ copy_category(char *src) } if (rv != 0) { - fprintf(stderr,"source locale data unavailable: %s", src); + fprintf(stderr,"source locale data unavailable: %s\n", src); return; } @@ -182,7 +182,7 @@ copy_category(char *src) (void) mkdir(dirname(category_file()), 0755); if (link(srcpath, category_file()) != 0) { - fprintf(stderr,"unable to copy locale data: %s", + fprintf(stderr,"unable to copy locale data: %s\n", strerror(errno)); return; } diff --git a/usr.bin/localedef/localedef.h b/usr.bin/localedef/localedef.h index 2aece1543d5b..4b141ac8dc09 100644 --- a/usr.bin/localedef/localedef.h +++ b/usr.bin/localedef/localedef.h @@ -174,4 +174,4 @@ const char *get_wide_encoding(void); int max_wide(void); //#define _(x) gettext(x) -#define INTERR fprintf(stderr,"internal fault (%s:%d)", __FILE__, __LINE__) +#define INTERR fprintf(stderr,"internal fault (%s:%d)\n", __FILE__, __LINE__) diff --git a/usr.bin/localedef/monetary.c b/usr.bin/localedef/monetary.c index 659c495a71fe..7a77ac7e256c 100644 --- a/usr.bin/localedef/monetary.c +++ b/usr.bin/localedef/monetary.c @@ -93,7 +93,7 @@ add_monetary_num(int n) (void) asprintf(&str, "%d", n); if (str == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } @@ -167,7 +167,7 @@ add_monetary_group(int n) (void) asprintf(&s, "%s;%d", mon.mon_grouping, n); } if (s == NULL) - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); free((char *)mon.mon_grouping); mon.mon_grouping = s; diff --git a/usr.bin/localedef/numeric.c b/usr.bin/localedef/numeric.c index 358355fe96ae..5533b7c10e1a 100644 --- a/usr.bin/localedef/numeric.c +++ b/usr.bin/localedef/numeric.c @@ -93,7 +93,7 @@ add_numeric_group(int n) (void) asprintf(&s, "%s;%d", numeric.grouping, n); } if (s == NULL) - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); free((char *)numeric.grouping); numeric.grouping = s; diff --git a/usr.bin/localedef/time.c b/usr.bin/localedef/time.c index 2de922a8eb12..7a56e244c921 100644 --- a/usr.bin/localedef/time.c +++ b/usr.bin/localedef/time.c @@ -104,7 +104,7 @@ add_list(const char *ptr[], char *str, int limit) return; } } - fprintf(stderr,"too many list elements"); + fprintf(stderr,"too many list elements\n"); } void @@ -137,7 +137,7 @@ add_time_list(wchar_t *wcs) } else if (tm.pm == NULL) { tm.pm = str; } else { - fprintf(stderr,"too many list elements"); + fprintf(stderr,"too many list elements\n"); free(str); } break; @@ -180,11 +180,11 @@ check_time_list(void) case T_ALT_DIGITS: return; default: - fprintf(stderr,"unknown list"); + fprintf(stderr,"unknown list\n"); break; } - fprintf(stderr,"too few items in list (%d)", last_kw); + fprintf(stderr,"too few items in list (%d)\n", last_kw); } void