[libgsf] GsfOutputGzip: modtime support.



commit add6ada32441e5e75a48b336f978ef41f55bf921
Author: Morten Welinder <terra gnome org>
Date:   Mon Mar 4 15:32:22 2013 -0500

    GsfOutputGzip: modtime support.

 NEWS                  |    2 +-
 gsf/gsf-output-gzip.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6dce201..35575f3 100644
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,7 @@ Morten:
        * Fix uncompress problem with bzip'd files.
        * Add modtime support for GsfInput, GsfInputStdio, GsfInputGzip.
        * Add modtime support for GsfInfileZip, GsfInfileTar.
-       * Add modtime support for GsfOutput, GsfOutputStdio.
+       * Add modtime support for GsfOutput, GsfOutputStdio, GsfOutputGzip.
        * Enhance gsf tool to print modtime.
 
 --------------------------------------------------------------------------
diff --git a/gsf/gsf-output-gzip.c b/gsf/gsf-output-gzip.c
index e182f2f..5459084 100644
--- a/gsf/gsf-output-gzip.c
+++ b/gsf/gsf-output-gzip.c
@@ -83,7 +83,8 @@ gzip_output_header (GsfOutputGZip *gzip)
 {
        guint8 buf[3 + 1 + 4 + 2];
        static guint8 const gzip_signature[] = { 0x1f, 0x8b, 0x08 } ;
-       time_t mtime = time (NULL);
+       GDateTime *modtime = gsf_output_get_modtime (GSF_OUTPUT (gzip));
+       time_t mtime = modtime ? g_date_time_to_unix (modtime) : 0;
        char const *name = gsf_output_name (gzip->sink);
        /* FIXME: What to do about gz extension ... ? */
        int nlen = 0;  /* name ? strlen (name) : 0; */


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