From: Bruno Haible Date: Fri, 23 Mar 2001 20:49:23 +0000 (+0000) Subject: Fix command line option handling. X-Git-Tag: v0.10.36~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54662e5eec768002f941cff2ee45507a5b22e85a;p=thirdparty%2Fgettext.git Fix command line option handling. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6ba24674d..bd02633e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2001-03-23 Bruno Haible + + * msgcomm.c (main): Don't give an error message if there are "too few" + messages in the input files. Do sanity checking before reading the + input files. Make --add-location the default, even if --omit-header + is specified. + 2001-03-22 Bruno Haible * xgettext.c (construct_header): Replace ENCODING with 8-bit. diff --git a/src/msgcomm.c b/src/msgcomm.c index d31d80440..28b1aed5c 100644 --- a/src/msgcomm.c +++ b/src/msgcomm.c @@ -160,7 +160,6 @@ main (argc, argv) textdomain (PACKAGE); /* Set initial value of variables. */ - line_comment = -1; default_domain = MESSAGE_DOMAIN_DEFAULT; while ((optchar = getopt_long (argc, argv, @@ -263,10 +262,7 @@ main (argc, argv) /* NOTREACHED */ } - /* Normalize selected options. */ - if (omit_header != 0 && line_comment < 0) - line_comment = 0; - + /* Verify selected options. */ if (!line_comment && sort_by_file) error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"), "--no-location", "--sort-by-file"); @@ -328,24 +324,24 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ usage (EXIT_FAILURE); } - /* Allocate a message list to remember all the messages. */ - mlp = message_list_alloc (); - - /* Process all input files. */ - for (cnt = 0; cnt < file_list->nitems; ++cnt) - read_po_file (file_list->item[cnt], mlp); - string_list_free (file_list); - /* Default the message selection criteria, and check them for sanity. */ if (more_than < 0) more_than = (less_than < 0 ? 1 : 0); if (less_than < 0) less_than = INT_MAX; - if (more_than >= less_than || less_than < 2 || more_than >= mlp->nitems) + if (more_than >= less_than || less_than < 2) error (EXIT_FAILURE, 0, _("impossible selection criteria specified (%d < n < %d)"), more_than, less_than); + /* Allocate a message list to remember all the messages. */ + mlp = message_list_alloc (); + + /* Process all input files. */ + for (cnt = 0; cnt < file_list->nitems; ++cnt) + read_po_file (file_list->item[cnt], mlp); + string_list_free (file_list); + /* Remove messages which do not fit the criteria. */ j = 0; while (j < mlp->nitems)