diff lib/protocols.c @ 359:52c5ee1fa455

2003-1-7 Brian Masney <masneyb@gftp.org> * lib/protocols.c (parse_time) - insert the right year for files that are from last year and the year is not shown in the ls output. (from simon.munton@m5data.com)
author masneyb
date Wed, 07 Jan 2004 12:11:35 +0000
parents 28a50fb598ed
children d5409bf03ff1
line wrap: on
line diff
--- a/lib/protocols.c	Wed Jan 07 11:45:01 2004 +0000
+++ b/lib/protocols.c	Wed Jan 07 12:11:35 2004 +0000
@@ -1172,7 +1172,11 @@
           tmppos = strptime (str, "%h %d %H:%M", &curtime);
           t = time (NULL);
           loctime = localtime (&t);
-          curtime.tm_year = loctime->tm_year;
+
+          if (curtime.tm_mon > loctime->tm_mon)
+            curtime.tm_year = loctime->tm_year - 1;
+          else
+            curtime.tm_year = loctime->tm_year;
         }
       else
         tmppos = strptime (str, "%h %d %Y", &curtime);