Modified log_history_cb() to be more portable and less wasteful.
[uzbl-mobile] / uzbl.c
diff --git a/uzbl.c b/uzbl.c
index e1b96ff..5c0a530 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -582,12 +582,14 @@ destroy_cb (GtkWidget* widget, gpointer data) {
 void
 log_history_cb () {
    if (uzbl.behave.history_handler) {
-       time_t rawtime;
-       struct tm * timeinfo;
-       char date [80];
-       time ( &rawtime );
-       timeinfo = localtime ( &rawtime );
-       strftime (date, 80, "\"%Y-%m-%d %H:%M:%S\"", timeinfo);
+       GTimeVal the_time;
+       gchar *date;
+       
+       g_get_current_time(&the_time);
+       /* no need to wrap this string with quotes since it contains no spaces.
+          format is like: 2009-06-26T20:02:05.262864Z */
+       date = g_time_val_to_iso8601(&the_time);
+
        run_handler(uzbl.behave.history_handler, date);
    }
 }