summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2008-10-28 16:56:23 +0000
committerCosimo Cecchi <cosimoc@src.gnome.org>2008-10-28 16:56:23 +0000
commit58f70c9f5c10f0cc708dee27e9fde01f20948b06 (patch)
treeed1548a4a239276125d72954edeb5d2e4f80a088 /daemon
parent965978b95114a43039d09931dbba53d39e8e22b0 (diff)
downloadgvfs-58f70c9f5c10f0cc708dee27e9fde01f20948b06.tar.gz
Convert stuct tm from what ParseFTPList gives to what mktime expects.
2008-10-28 Cosimo Cecchi <cosimoc@gnome.org> * daemon/gvfsbackendftp.c: (dir_default_iter_process): Convert stuct tm from what ParseFTPList gives to what mktime expects. Fixes wrong date/time parsing for FTP files. Patch by Andreas Henriksson (#550837). svn path=/trunk/; revision=2079
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackendftp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 7bfc2525..a07a16e2 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1096,6 +1096,13 @@ dir_default_iter_process (gpointer iter,
g_free (s);
g_free (name);
+ /* Workaround:
+ * result.fetime.tm_year contains actual year instead of offset-from-1900,
+ * which mktime expects.
+ */
+ if (result.fe_time.tm_year >= 1900)
+ result.fe_time.tm_year -= 1900;
+
tv.tv_sec = mktime (&result.fe_time);
if (tv.tv_sec != -1)
g_file_info_set_modification_time (info, &tv);