~ubuntu-branches/ubuntu/trusty/vsftpd/trusty-proposed

« back to all changes in this revision

Viewing changes to ls.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-11-06 13:40:19 UTC
  • mto: (2.4.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20091106134019-yak90a6hqpfszkpm
Tags: upstream-2.2.1
ImportĀ upstreamĀ versionĀ 2.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
static void build_dir_line(struct mystr* p_str,
19
19
                           const struct mystr* p_filename_str,
20
 
                           const struct vsf_sysutil_statbuf* p_stat);
 
20
                           const struct vsf_sysutil_statbuf* p_stat,
 
21
                           long curr_time);
21
22
 
22
23
void
23
24
vsf_ls_populate_dir_list(struct mystr_list* p_list,
36
37
  int t_option;
37
38
  int F_option;
38
39
  int do_stat = 0;
 
40
  long curr_time = 0;
39
41
  loc_result = str_locate_char(p_option_str, 'a');
40
42
  a_option = loc_result.found;
41
43
  loc_result = str_locate_char(p_option_str, 'r');
81
83
  /* If we're going to need to do time comparisions, cache the local time */
82
84
  if (is_verbose)
83
85
  {
84
 
    vsf_sysutil_update_cached_time();
 
86
    curr_time = vsf_sysutil_get_time_sec();
85
87
  }
86
88
  while (1)
87
89
  {
157
159
      {
158
160
        str_append_char(&s_final_file_str, '/');
159
161
      }
160
 
      build_dir_line(&dirline_str, &s_final_file_str, s_p_statbuf);
 
162
      build_dir_line(&dirline_str, &s_final_file_str, s_p_statbuf, curr_time);
161
163
    }
162
164
    else
163
165
    {
358
360
 
359
361
static void
360
362
build_dir_line(struct mystr* p_str, const struct mystr* p_filename_str,
361
 
               const struct vsf_sysutil_statbuf* p_stat)
 
363
               const struct vsf_sysutil_statbuf* p_stat, long curr_time)
362
364
{
363
365
  static struct mystr s_tmp_str;
364
366
  filesize_t size = vsf_sysutil_statbuf_get_size(p_stat);
427
429
  str_append_char(p_str, ' ');
428
430
  /* Date stamp */
429
431
  str_append_text(p_str, vsf_sysutil_statbuf_get_date(p_stat,
430
 
                                                      tunable_use_localtime));
 
432
                                                      tunable_use_localtime,
 
433
                                                      curr_time));
431
434
  str_append_char(p_str, ' ');
432
435
  /* Filename */
433
436
  str_append_str(p_str, p_filename_str);