From 852900278cf379a4e79016fbf3036478edac2079 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 23 Jun 2015 18:04:35 +0900 Subject: [PATCH] build: Fix build failure on Solaris * gettext-tools/src/cldr-plurals.c: Include "basename.h". (main): Place optind on the right hand side of the expression, to work around build failure on Solaris. Reported by Dagobert Michelsen in: . --- gettext-tools/src/ChangeLog | 6 ++++++ gettext-tools/src/cldr-plurals.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 45d04646c..70215e1ce 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,9 @@ +2015-06-23 Daiki Ueno + + * cldr-plurals.c: Include "basename.h". + (main): Place optind on the right hand side of the expression, to + work around build failure on Solaris. + 2015-06-23 Daiki Ueno * Makefile.am (uninstall-local): Remove cldr-plurals. diff --git a/gettext-tools/src/cldr-plurals.c b/gettext-tools/src/cldr-plurals.c index c4a655e10..3bd3d542f 100644 --- a/gettext-tools/src/cldr-plurals.c +++ b/gettext-tools/src/cldr-plurals.c @@ -20,6 +20,7 @@ # include #endif +#include "basename.h" #include "cldr-plural-exp.h" #include "c-ctype.h" #include @@ -418,7 +419,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ if (do_help) usage (EXIT_SUCCESS); - if (argc - optind == 2) + if (argc == optind + 2) { /* Two arguments: Read CLDR rules from a file. */ #if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT @@ -458,7 +459,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ #endif } } - else if (argc - optind == 0) + else if (argc == optind) { /* No argument: Read CLDR rules from standard input. */ char *line = NULL; -- 2.47.2