mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-08 17:51:13 +02:00
(main): Fail when --rfc-822 (-R) is specified along
with a format string. Reported by Jochen Hein.
This commit is contained in:
+10
-1
@@ -1,5 +1,5 @@
|
||||
/* date - print or set the system date and time
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2001 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
|
||||
@@ -355,6 +355,15 @@ argument must be a format string beginning with `+'."),
|
||||
usage (1);
|
||||
}
|
||||
|
||||
/* Simply ignore --rfc-822 if specified when setting the date. */
|
||||
if (rfc_format && !set_date && n_args > 0)
|
||||
{
|
||||
error (0, 0,
|
||||
_("a format string may not be specified when using\
|
||||
the --rfc-822 (-R) option"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (set_date)
|
||||
datestr = set_datestr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user