mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 799144 - Date Completion is broken after 5.4 upgrade
strptime will reasonable return false for an incomplete date but it still fills in the parts of the struct tm that it understands, so bail out of qof_scan_date_internal when it fails only if all three fields are present.
This commit is contained in:
@@ -756,11 +756,11 @@ qof_scan_date_internal (const char *buff, int *day, int *month, int *year,
|
||||
char *strv = strptime (buff, normalize_format(GNC_D_FMT).c_str(),
|
||||
&thetime);
|
||||
|
||||
if (!strv) // Parse failed, continuing gives the wrong result.
|
||||
return FALSE;
|
||||
|
||||
if (third_field)
|
||||
{
|
||||
if (!strv) // Parse failed, continuing gives the wrong result.
|
||||
return FALSE;
|
||||
|
||||
/* Easy. All three values were parsed. */
|
||||
iyear = thetime.tm_year + 1900;
|
||||
iday = thetime.tm_mday;
|
||||
|
||||
Reference in New Issue
Block a user