From 100696650460b832667a337a8e8826fe56aadf0d Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 29 Jan 2010 13:36:01 +0000 Subject: [PATCH] Fixup for postgres change git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@29442 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Postgres.m | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05ff64b..1ff06ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-29 Richard Frith-Macdonald + + * Postgres.m: Fix to cope with a new date format in recent postgres. + 2009-11-18 Richard Frith-Macdonald Many tweaks to build under OSX snow leopard. diff --git a/Postgres.m b/Postgres.m index 3fb42a3..2830c6a 100644 --- a/Postgres.m +++ b/Postgres.m @@ -688,14 +688,16 @@ static unsigned int trim(char *str) { int e; - /* If it's a simple date (YYYY-MM-DD) append time for start of day. */ - if (l == 10) + i = l; + /* Convert +/-HH:SS timezone to +/-HHSS + */ + if (i > 5 && b[i-3] == ':' && (b[i-6] == '+' || b[i-6] == '-')) { - strcat(b, " 00:00:00 +0000"); - l += 15; + b[i-3] = b[i-2]; + b[i-2] = b[i-1]; + b[--i] = '\0'; } - i = l; while (i-- > 0) { if (b[i] == '+' || b[i] == '-')