Mercurial > gftp.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
358:28a50fb598ed | 359:52c5ee1fa455 |
---|---|
1170 if (strchr (str, ':') != NULL) | 1170 if (strchr (str, ':') != NULL) |
1171 { | 1171 { |
1172 tmppos = strptime (str, "%h %d %H:%M", &curtime); | 1172 tmppos = strptime (str, "%h %d %H:%M", &curtime); |
1173 t = time (NULL); | 1173 t = time (NULL); |
1174 loctime = localtime (&t); | 1174 loctime = localtime (&t); |
1175 curtime.tm_year = loctime->tm_year; | 1175 |
1176 if (curtime.tm_mon > loctime->tm_mon) | |
1177 curtime.tm_year = loctime->tm_year - 1; | |
1178 else | |
1179 curtime.tm_year = loctime->tm_year; | |
1176 } | 1180 } |
1177 else | 1181 else |
1178 tmppos = strptime (str, "%h %d %Y", &curtime); | 1182 tmppos = strptime (str, "%h %d %Y", &curtime); |
1179 } | 1183 } |
1180 | 1184 |