avoiding https://sourceware.org/PR33245
[bug triggered since coreutils-9.0]
+ 'date' supports specifying multiple named formats with the last taking
+ precedence. Previously multiple specifications would induce an error.
+ [bug introduced in coreutils-5.90]
+
'install -d' now produces the correct diagnostic upon failure
to create a directory. Previously it would have produced
a confusing error about changing permissions.
while ((optc = getopt_long (argc, argv, short_options, long_options, nullptr))
!= -1)
{
- char const *new_format = nullptr;
-
switch (optc)
{
case 'd':
enum Time_spec i =
XARGMATCH ("--rfc-3339", optarg,
time_spec_string + 2, time_spec + 2);
- new_format = rfc_3339_format[i];
+ format = rfc_3339_format[i];
format_in_c_locale = true;
break;
}
(optarg
? XARGMATCH ("--iso-8601", optarg, time_spec_string, time_spec)
: TIME_SPEC_DATE);
- new_format = iso_8601_format[i];
+ format = iso_8601_format[i];
format_in_c_locale = true;
break;
}
reference = optarg;
break;
case 'R':
- new_format = rfc_email_format;
+ format = rfc_email_format;
format_in_c_locale = true;
break;
case 's':
default:
usage (EXIT_FAILURE);
}
-
- if (new_format)
- {
- if (format)
- error (EXIT_FAILURE, 0, _("multiple output formats specified"));
- format = new_format;
- }
}
int option_specified_date = (!!datestr + !!batch_file + !!reference