~ubuntu-branches/ubuntu/precise/mutt/precise

« back to all changes in this revision

Viewing changes to browser.c

  • Committer: Package Import Robot
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2010-12-17 14:28:28 UTC
  • mfrom: (16.2.3 experimental)
  • Revision ID: package-import@ubuntu.com-20101217142828-ve8yy0xf1zomtnx9
Tags: 1.5.21-1ubuntu1
* Merge with Debian experimental (LP: #691512), remaining changes:
  + debian/control, debian/patches/debian-specific/build_doc_adjustments.diff:
    Use w3m (main) instead of elinks (universe) for generating documentation.
  + Drop libtokyocabinet-dev (universe) from Build-Depends, use always
    libgdbm-dev and also use gdbm for the header cache backend. (lp: #607448)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include <unistd.h>
41
41
#include <sys/stat.h>
42
42
#include <errno.h>
 
43
#include <locale.h>
43
44
 
44
45
static struct mapping_t FolderHelp[] = {
45
46
  { N_("Exit"),  OP_EXIT },
161
162
      break;
162
163
      
163
164
    case 'd':
 
165
    case 'D':
164
166
      if (folder->ff->st != NULL)
165
167
      {
166
 
        tnow = time (NULL);
167
 
        t_fmt = tnow - folder->ff->st->st_mtime < 31536000 ? "%b %d %H:%M" : "%b %d  %Y";
 
168
        int do_locales = TRUE;
 
169
 
 
170
        if (op == 'D') {
 
171
          t_fmt = NONULL(DateFmt);
 
172
          if (*t_fmt == '!') {
 
173
            ++t_fmt;
 
174
            do_locales = FALSE;
 
175
          }
 
176
        } else {
 
177
          tnow = time (NULL);
 
178
          t_fmt = tnow - folder->ff->st->st_mtime < 31536000 ? "%b %d %H:%M" : "%b %d  %Y";
 
179
        }
 
180
        if (do_locales)
 
181
          setlocale(LC_TIME, NONULL (Locale)); /* use environment if $locale is not set */
 
182
        else
 
183
          setlocale(LC_TIME, "C");
168
184
        strftime (date, sizeof (date), t_fmt, localtime (&folder->ff->st->st_mtime));
 
185
 
169
186
        mutt_format_s (dest, destlen, fmt, date);
170
187
      }
171
188
      else
1068
1085
          if ((err = REGCOMP (rx, s, REG_NOSUB)) != 0)
1069
1086
          {
1070
1087
            regerror (err, rx, buf, sizeof (buf));
1071
 
            regfree (rx);
1072
1088
            FREE (&rx);
1073
1089
            mutt_error ("%s", buf);
1074
1090
          }