diff options
author | Jim Meyering <meyering@redhat.com> | 2012-01-09 22:56:54 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-01-11 09:27:50 +0100 |
commit | d3227eeb90c8308abd1e6bf08ee253b7a4e78d1d (patch) | |
tree | 3ccee2bcd24ae57b9c9b539cd964b103a5271f4a /src/tr.c | |
parent | bfe711db1c07e73a5806647a637f609eb8c1773d (diff) | |
download | coreutils-d3227eeb90c8308abd1e6bf08ee253b7a4e78d1d.tar.xz |
maint: adjust formatting of certain continued strings
Add a rule to ding any source file that has a continued string
with a word in the first column of the following line.
Those tend to trigger malfunction in tools that try to map an
arbitrary line number to an enclosing function name. Of course,
very many strings do precisely this, *when they are part of the
usage function*. So we exempt the body of each usage function.
* src/dircolors.c (main): Separate a long, continued string
into two separately-quoted parts.
* src/od.c (decode_one_format): Likewise.
(decode_one_format, main): Move a space from end of
preceding line to the beginning of the continued line.
* src/tr.c (unquote, string2_extend, validate): Likewise.
* src/seq.c (main): Split in two and use string concatenation.
* src/stat.c (default_format): Use a mix of techniques.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): New rule.
Exempt three files in src: system.h, od.c, printf.c.
Diffstat (limited to 'src/tr.c')
-rw-r--r-- | src/tr.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -506,8 +506,8 @@ unquote (char const *s, struct E_string *es) lack of clarity as meaning the resulting behavior is undefined, which means we're allowed to issue a warning. */ - error (0, 0, _("warning: the ambiguous octal escape \ -\\%c%c%c is being\n\tinterpreted as the 2-byte sequence \\0%c%c, %c"), + error (0, 0, _("warning: the ambiguous octal escape\ + \\%c%c%c is being\n\tinterpreted as the 2-byte sequence \\0%c%c, %c"), s[i], s[i + 1], s[i + 2], s[i], s[i + 1], s[i + 2]); } @@ -1417,8 +1417,8 @@ string2_extend (const struct Spec_list *s1, struct Spec_list *s2) That's not portable however, contradicts POSIX and is dependent on your collating sequence. */ error (EXIT_FAILURE, 0, - _("when translating with string1 longer than string2,\n\ -the latter string must not end with a character class")); + _("when translating with string1 longer than string2,\nthe \ + latter string must not end with a character class")); abort (); /* inform gcc that the above use of error never returns. */ break; @@ -1495,15 +1495,15 @@ validate (struct Spec_list *s1, struct Spec_list *s2) if (s2->has_equiv_class) { error (EXIT_FAILURE, 0, - _("[=c=] expressions may not appear in string2 \ -when translating")); + _("[=c=] expressions may not appear in string2\ + when translating")); } if (s2->has_restricted_char_class) { error (EXIT_FAILURE, 0, - _("when translating, the only character classes that may \ -appear in\nstring2 are 'upper' and 'lower'")); + _("when translating, the only character classes that may\ + appear in\nstring2 are 'upper' and 'lower'")); } validate_case_classes (s1, s2); @@ -1535,8 +1535,8 @@ appear in\nstring2 are 'upper' and 'lower'")); { if (s2->n_indefinite_repeats > 0) error (EXIT_FAILURE, 0, - _("the [c*] construct may appear in string2 only \ -when translating")); + _("the [c*] construct may appear in string2 only\ + when translating")); } } } |