[glib: 4/6] gtimer: Drop support for negative years from g_time_val_from_iso8601()



commit fdccf5ff34b062c5b4a55fc10544ff0dc67e853b
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Aug 6 13:58:06 2018 +0100

    gtimer: Drop support for negative years from g_time_val_from_iso8601()
    
    It never worked; we’ve always parsed the year with strtoul() (unsigned).
    While negative years are supported by the ISO 8601 standard, they can
    only be used by mutual agreement of the two parties interchanging data.
    Moreover, they are not supported by GTimeVal, which is what we’re
    filling with the results.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 glib/gtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gtimer.c b/glib/gtimer.c
index 348b4befb..76da128c8 100644
--- a/glib/gtimer.c
+++ b/glib/gtimer.c
@@ -372,7 +372,7 @@ g_time_val_from_iso8601 (const gchar *iso_date,
   if (*iso_date == '\0')
     return FALSE;
 
-  if (!g_ascii_isdigit (*iso_date) && *iso_date != '-' && *iso_date != '+')
+  if (!g_ascii_isdigit (*iso_date) && *iso_date != '+')
     return FALSE;
 
   val = strtoul (iso_date, (char **)&iso_date, 10);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]