* utilvfs.c (is_year): The range of valid year numbers is

restricted to 1970 .. 2015 to reduce the number of parsing
	errors.
This commit is contained in:
Roland Illig 2006-01-27 22:06:07 +00:00
parent 015ebfc2fe
commit b2e8006823
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-01-27 Roland Illig <roland.illig@gmx.de>
* utilvfs.c (is_year): The range of valid year numbers is
restricted to 1970 .. 2015 to reduce the number of parsing
errors.
2006-01-25 Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
* xdirentry.h (LS_LINEAR_PREOPEN): New macro definition.

View File

@ -399,7 +399,11 @@ is_year (char *str, struct tm *tim)
if (sscanf (str, "%ld", &year) != 1)
return 0;
if (year < 1900 || year > 3000)
/* The range of valid year numbers is quite restricted in order to
* reduce the number of parsing errors due to filenames starting
* with a four-digit string and a space.
*/
if (!(1970 <= year && year <= 2015))
return 0;
tim->tm_year = (int) (year - 1900);