Skip to content

Commit b7a0af7

Browse files
author
Thomas G. Lockhart
committed
Check a bit more carefully for preceeding ISO field tags
when decoding date fields.
1 parent dd0279b commit b7a0af7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.83 2001/12/29 18:31:29 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.84 2001/12/29 18:40:58 thomas Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -959,18 +959,18 @@ DecodeDateTime(char **field, int *ftype, int nf,
959959
if (tzp == NULL)
960960
return -1;
961961

962-
if (ptype != 0)
963-
{
964-
/* Sanity check; should not fail this test */
965-
if (ptype != DTK_TIME)
966-
return -1;
967-
ptype = 0;
968-
}
969-
970-
if (isdigit(*field[i]))
962+
if ((isdigit(*field[i]) || (ptype != 0))
971963
{
972964
char *cp;
973965

966+
if (ptype != 0)
967+
{
968+
/* Sanity check; should not fail this test */
969+
if (ptype != DTK_TIME)
970+
return -1;
971+
ptype = 0;
972+
}
973+
974974
/* Starts with a digit but we already have a time field?
975975
* Then we are in trouble with a date and time already...
976976
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy