From 974ab3dd887985e3aa347f3c6521f819296396a0 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 16 Feb 2013 14:42:43 +0000 Subject: Imported Upstream version 8.21 --- src/fmt.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/fmt.c') diff --git a/src/fmt.c b/src/fmt.c index 308b6455..d3f53690 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -1,5 +1,5 @@ /* GNU fmt -- simple text formatter. - Copyright (C) 1994-2012 Free Software Foundation, Inc. + Copyright (C) 1994-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include #include #include +#include /* Redefine. Otherwise, systems (Unicos for one) with headers that define it to be a type get syntax errors for the variable declaration below. */ @@ -270,11 +271,10 @@ usage (int status) fputs (_("\ Reformat each paragraph in the FILE(s), writing to standard output.\n\ The option -WIDTH is an abbreviated form of --width=DIGITS.\n\ -\n\ -"), stdout); - fputs (_("\ -Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); + + emit_mandatory_arg_note (); + fputs (_("\ -c, --crown-margin preserve indentation of first two lines\n\ -p, --prefix=STRING reformat only lines beginning with STRING,\n\ @@ -282,6 +282,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -s, --split-only split long lines, but do not refill\n\ "), stdout); + /* Tell xgettext that the "% o" below is not a printf-style + format string: xgettext:no-c-format */ fputs (_("\ -t, --tagged-paragraph indentation of first line different from second\n\ -u, --uniform-spacing one space between words, two after sentences\n\ @@ -610,6 +612,11 @@ get_paragraph (FILE *f) while (same_para (c) && in_column == other_indent) c = get_line (f, c); } + + /* Tell static analysis tools that using word_limit[-1] is ok. + word_limit is guaranteed to have been incremented by get_line. */ + assert (word < word_limit); + (word_limit - 1)->period = (word_limit - 1)->final = true; next_char = c; return true; -- cgit v1.2.3