[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16782: Insensitive behavior in date when given invalid fomatting str
bug#16782: Insensitive behavior in date when given invalid fomatting string
Mon, 17 Feb 2014 18:42:01 +0100
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
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
$ date +%Y%#05
$ date +x%7
$ date "+%7 xyz"
$ date "+%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.
Description: Digital signature
|[Prev in Thread]
||[Next in Thread]|
- bug#16782: Insensitive behavior in date when given invalid fomatting string,