]> granicus.if.org Git - postgresql/commitdiff
Fix DecodeInterval to handle '-0.1' sanely, per gripe from Tilo Schwarz.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Dec 2003 21:45:51 +0000 (21:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Dec 2003 21:45:51 +0000 (21:45 +0000)
src/backend/utils/adt/datetime.c

index ff1421a985d86306d5b88340900f5b870d1e5248..52b212f602f34c54da4875e57c8c7da9148244b0 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.118.2.1 2003/11/16 20:29:34 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.118.2.2 2003/12/17 21:45:51 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3005,7 +3005,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
                                        if (*cp != '\0')
                                                return DTERR_BAD_FORMAT;
 
-                                       if (val < 0)
+                                       if (*field[i] == '-')
                                                fval = -(fval);
                                }
                                else if (*cp == '\0')