g_date_fill_parse_tokens accepts too much nonsense; g_date_prepare_to_parse is broken
Submitted by Morten Welinder
Link to original bug (#328628)
Description
-
This uses g_ascii_isdigit. Why ascii and not unichar?
-
If a number is too big, the behaviour of atoi is undefined. Think core dump or abort. The code needs to use something like strtol with error check.
-
It should be checked that month names identified are not in the middle of words. Right now the parser accepts "Maybe 1, maybe 2".
This might even fail for valid input if you had a language in which one month's name was a prefix of another month's name.
Be careful not to break "Dec2000" which just might be on purpose.
-
One month name is plenty. "100 days from May to December" is not a date.
Version: 2.9.x