[INTERPRETER]

* BUG: Val() correctly detect dates now, when the date or the time 
  separator is a space character.


git-svn-id: svn://localhost/gambas/trunk@7326 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-09-19 22:55:43 +00:00
parent 0a2fc05ba5
commit dc46e9d20b

View file

@ -481,7 +481,17 @@ bool DATE_from_string(const char *str, int len, VALUE *val, bool local)
c = COMMON_get_unicode_char();
if ((c < 0) || isspace(c))
if (c == info->date_sep)
{
set_date(&date, info->date_order[0], nbr);
set_date(&date, info->date_order[1], nbr2);
if (read_integer(&nbr))
return TRUE;
set_date(&date, info->date_order[2], nbr);
}
else if ((c < 0) || isspace(c))
{
i = 0;
@ -493,16 +503,6 @@ bool DATE_from_string(const char *str, int len, VALUE *val, bool local)
if (info->date_order[i] == LO_YEAR) i++;
set_date(&date, info->date_order[i], nbr2);
}
else if (c == info->date_sep)
{
set_date(&date, info->date_order[0], nbr);
set_date(&date, info->date_order[1], nbr2);
if (read_integer(&nbr))
return TRUE;
set_date(&date, info->date_order[2], nbr);
}
jump_space();
@ -525,17 +525,7 @@ bool DATE_from_string(const char *str, int len, VALUE *val, bool local)
c = COMMON_get_unicode_char();
if ((c < 0) || isspace(c))
{
i = 0;
if (info->time_order[i] == LO_SECOND) i++;
set_time(&date, info->time_order[i], nbr); i++;
if (info->time_order[i] == LO_SECOND) i++;
set_time(&date, info->time_order[i], nbr2);
}
else if (c == info->time_sep)
if (c == info->time_sep)
{
set_time(&date, info->time_order[0], nbr);
set_time(&date, info->time_order[1], nbr2);
@ -553,6 +543,16 @@ bool DATE_from_string(const char *str, int len, VALUE *val, bool local)
date.msec = nbr;
}
}
else if ((c < 0) || isspace(c))
{
i = 0;
if (info->time_order[i] == LO_SECOND) i++;
set_time(&date, info->time_order[i], nbr); i++;
if (info->time_order[i] == LO_SECOND) i++;
set_time(&date, info->time_order[i], nbr2);
}
c = get_char();
if ((c < 0) || isspace(c))