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.
pull/1831/head
John Ralls 2 years ago
parent c07e0890f2
commit 92de074e49

@ -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;

Loading…
Cancel
Save