From e8f30d450255baa92c1f2abe5d4a2696b6e4ebf0 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 14 Aug 2006 16:15:29 +0000 Subject: Upgraded bunbled SQLite lib to 3.3.7 --- ext/pdo_sqlite/sqlite/src/date.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'ext/pdo_sqlite/sqlite/src/date.c') diff --git a/ext/pdo_sqlite/sqlite/src/date.c b/ext/pdo_sqlite/sqlite/src/date.c index 7d398df489..9146906181 100644 --- a/ext/pdo_sqlite/sqlite/src/date.c +++ b/ext/pdo_sqlite/sqlite/src/date.c @@ -105,18 +105,20 @@ static int getDigits(const char *zDate, ...){ val = 0; while( N-- ){ if( !isdigit(*(u8*)zDate) ){ - return cnt; + goto end_getDigits; } val = val*10 + *zDate - '0'; zDate++; } if( valmax || (nextC!=0 && nextC!=*zDate) ){ - return cnt; + goto end_getDigits; } *pVal = val; zDate++; cnt++; }while( nextC ); +end_getDigits: + va_end(ap); return cnt; } @@ -236,7 +238,7 @@ static void computeJD(DateTime *p){ if( p->validHMS ){ p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0; if( p->validTZ ){ - p->rJD += p->tz*60/86400.0; + p->rJD -= p->tz*60/86400.0; p->validHMS = 0; p->validTZ = 0; } @@ -639,10 +641,10 @@ static int isDate(int argc, sqlite3_value **argv, DateTime *p){ int i; if( argc==0 ) return 1; if( SQLITE_NULL==sqlite3_value_type(argv[0]) || - parseDateOrTime(sqlite3_value_text(argv[0]), p) ) return 1; + parseDateOrTime((char*)sqlite3_value_text(argv[0]), p) ) return 1; for(i=1; i