--- getopt/trunk/getopt.c 2012/07/17 17:09:37 323 +++ getopt/trunk/getopt.c 2014/11/20 10:43:12 359 @@ -37,6 +37,8 @@ * ) * Version 1.1.4: Mon Nov 7 2005 * Fixed a few type's in the manpage + * Version 1.1.5: Mon Nov 7 2005 + * Sync with util-linux-2.21, fixed build problems, many new translations */ /* Exit codes: @@ -197,7 +199,7 @@ if (longopts[longindex].has_arg) printf(" %s", normalize(optarg ? optarg : "")); } else if (opt == NON_OPT) - printf(" %s", normalize(optarg)); + printf(" %s", normalize(optarg ? optarg : "")); else { printf(" -%c", opt); charptr = strchr(optstr, opt); @@ -222,7 +224,7 @@ static void __attribute__ ((__noreturn__)) parse_error(const char *message) { if (message) - fprintf(stderr, "%s: %s\n", ,program_short_invocation_name, message); + fprintf(stderr, "%s: %s\n", program_invocation_short_name, message); fprintf(stderr, _("Try `%s --help' for more information.\n"), program_invocation_short_name); exit(PARAMETER_EXIT_CODE); @@ -258,7 +260,7 @@ long_options[long_options_nr].flag = NULL; long_options[long_options_nr].val = 0; - if (long_options_nr) { + if (long_options_nr && name) { /* Not for init! */ long_options[long_options_nr - 1].has_arg = has_arg; long_options[long_options_nr - 1].flag = NULL; @@ -362,12 +364,9 @@ {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; -#if WITHOUT_GETTEXT -#else setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); -#endif init_longopt(); getopt_long_fp = getopt_long;