After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627892 - g_time_val_from_iso8601 rejects valid date
g_time_val_from_iso8601 rejects valid date
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 632121 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-08-24 21:19 UTC by Jens Georg
Modified: 2010-10-14 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix issue (880 bytes, patch)
2010-08-24 21:19 UTC, Jens Georg
none Details | Review
Fix issue, v2 (2.30 KB, patch)
2010-08-24 21:41 UTC, Jens Georg
accepted-commit_now Details | Review
Fix issue, v3 (2.26 KB, patch)
2010-08-24 22:08 UTC, Jens Georg
accepted-commit_now Details | Review

Description Jens Georg 2010-08-24 21:19:39 UTC
Created attachment 168685 [details] [review]
Fix issue

assertion failed: (g_time_val_from_iso8601 ("2009-08-02", &tv))

While checking this, I also noticed that "2009-08-02T" is considered a valid iso8601 which - if I understood wikipedia correctly - isn't. Attached patch fixes both issues
Comment 1 Jens Georg 2010-08-24 21:41:21 UTC
Created attachment 168688 [details] [review]
Fix issue, v2

Fix original patch and add tests for the cases fixed.
Comment 2 Emmanuele Bassi (:ebassi) 2010-08-24 21:51:05 UTC
Review of attachment 168688 [details] [review]:

looks okay to me.

::: glib/gtimer.c
@@ +443,3 @@
+  if (!g_ascii_isdigit (*iso_date))
+    {
+      return FALSE;

minor style issue: no need to use curly brackets for a single statement.
Comment 3 Jens Georg 2010-08-24 22:08:36 UTC
Created attachment 168689 [details] [review]
Fix issue, v3

Style fix
Comment 4 Emmanuele Bassi (:ebassi) 2010-08-26 11:20:22 UTC
Review of attachment 168689 [details] [review]:

again, looks good.
Comment 5 Emmanuele Bassi (:ebassi) 2010-08-26 11:23:17 UTC
Review of attachment 168689 [details] [review]:

again, looks good.
Comment 6 Jens Georg 2010-08-26 15:24:09 UTC
pushed

commit db7ddcc19529a101b820347e8cca419fb37f6a02
Author: Jens Georg <mail@jensge.org>
Date:   Wed Aug 25 00:18:23 2010 +0300

    Improve parsing of date-only iso8601 strings
Comment 7 Zeeshan Ali 2010-10-14 11:23:02 UTC
*** Bug 632121 has been marked as a duplicate of this bug. ***