mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Stricter tokenization of datetime
This commit is contained in:
@@ -3061,6 +3061,7 @@ int DoCoerce(char type, Value *v)
|
||||
|
||||
case STR_TYPE:
|
||||
s = v->v.str;
|
||||
i=0; /* Avoid compiler warning */
|
||||
if (ParseLiteralTime(&s, &i)) return E_CANT_COERCE;
|
||||
if (*s) return E_CANT_COERCE;
|
||||
v->type = TIME_TYPE;
|
||||
|
||||
@@ -246,7 +246,14 @@ void FindNumericToken(char const *s, Token *t)
|
||||
int dse, tim;
|
||||
r = ParseLiteralDate(&p, &dse, &tim);
|
||||
if (r == OK) {
|
||||
if (*p) return;
|
||||
if (*p) {
|
||||
if (tim == NO_TIME) {
|
||||
t->val = -E_BAD_DATE;
|
||||
} else {
|
||||
t->val = -E_BAD_TIME;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (tim == NO_TIME) {
|
||||
t->type = T_Date;
|
||||
t->val = dse;
|
||||
|
||||
Reference in New Issue
Block a user