GNU bug report logs -
#16782
date: reject invalid %[X] format characters
Previous Next
Reported by: fuz <at> fuz.su
Date: Mon, 17 Feb 2014 17:46:02 UTC
Severity: wishlist
To reply to this bug, email your comments to 16782 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#16782
; Package
coreutils
.
(Mon, 17 Feb 2014 17:46:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
fuz <at> fuz.su
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Mon, 17 Feb 2014 17:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Consider the following set of date invocations:
$ date --version
date (GNU coreutils) 8.20
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
$ date +%05
00%05
$ date +%Y%#05
20140%#05
$ date +x%7
x %7
$ date "+%7 xyz"
%7 xyz
$ date "+%7q xyz"
%7q xyz
GNU date behaves strangely when given an invalid formatting string. GNU date
does not inform the user about the invalid formatting string; instead it outputs
padding as if the flags and field-width, flags and E/O modifier were the whole
formatting string, then the unchanged formatting string. This behavior is not
incorrect as of POSIX.1-2008, as the standard does not specify the behavior of
date in case of an invalid format string, yet it is highly unexpected and weird.
I suggest changing GNU date to output incorrect parts of a formatting string
as-is (as done by the date shipped with Solaris) and possibly exiting with a
non-zero exit status.
Yours sincerely,
Robert Clausecker
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#16782
; Package
coreutils
.
(Sun, 21 Oct 2018 21:32:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 16782 <at> debbugs.gnu.org (full text, mbox):
severity 16782 wishlist
retitle 16782 date: reject invalid %[X] format characters
stop
(triaging old bugs)
Hello,
On 17/02/14 10:42 AM, fuz <at> fuz.su wrote:
> Consider the following set of date invocations:
>
> $ date +%05
> 00%05
> $ date +%Y%#05
> 20140%#05
> $ date +x%7
> x %7
> $ date "+%7 xyz"
> %7 xyz
> $ date "+%7q xyz"
> %7q xyz
>
> GNU date behaves strangely when given an invalid formatting string. GNU date
> does not inform the user about the invalid formatting string; instead it outputs
> padding as if the flags and field-width
It seems your message was never replied to. Sorry about that.
Indeed, this would be a nice improvement, contrast:
$ printf "+%7 xyz"
-bash: printf: ` ': invalid format character
$ /src/printf "+%7 xyz"
+./src/printf: %7 : invalid conversion specification
$ ./src/printf "+%7q xyz"
+./src/printf: %7q: invalid conversion specification
Marking this as a "wishlist" item.
-assaf
Severity set to 'wishlist' from 'normal'
Request was from
Assaf Gordon <assafgordon <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 21 Oct 2018 21:32:02 GMT)
Full text and
rfc822 format available.
Changed bug title to 'date: reject invalid %[X] format characters' from 'Insensitive behavior in date when given invalid fomatting string'
Request was from
Assaf Gordon <assafgordon <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 21 Oct 2018 21:32:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 187 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.