Ticket #1533: test.patch

File test.patch, 1.5 KB (added by winnie, 10 years ago)

Small fix for fixing string issue in mc

  • src/util.c

    diff --git a/src/util.c b/src/util.c
    index 213a286..7ff66b8 100644
    a b  
    5858#include "charsets.h" 
    5959#endif 
    6060 
     61/*In order to use everywhere the same setup  
     62  for the locale we use defines               */ 
     63#define FMTYEAR                 _("%b %e  %Y") 
     64#define FMTTIME                 _("%b %e %H:%M") 
     65 
     66 
    6167int easy_patterns = 1; 
    6268 
    6369extern void str_replace(char *s, char from, char to) 
    i18n_checktimelength (void) 
    623629        char buf [MB_LEN_MAX * MAX_I18NTIMELENGTH + 1]; 
    624630        size_t a, b; 
    625631 
    626         strftime (buf, sizeof(buf) - 1, _("%b %d %H:%M"), lt); 
     632        strftime (buf, sizeof(buf) - 1, FMTTIME, lt); 
    627633        a = str_term_width1 (buf); 
    628         strftime (buf, sizeof(buf) - 1, _("%b %d %Y"), lt); 
     634        strftime (buf, sizeof(buf) - 1, FMTYEAR, lt); 
    629635        b = str_term_width1 (buf); 
    630636 
    631637        length = max (a, b); 
    file_date (time_t when) 
    648654    static const char *fmtyear, *fmttime; 
    649655    const char *fmt; 
    650656 
    651     if (!i18n){ 
    652         /* strftime() format string for old dates */ 
    653         fmtyear = _("%b %e  %Y"); 
    654         /* strftime() format string for recent dates */ 
    655         fmttime = _("%b %e %H:%M"); 
    656         i18n = 1; 
    657     } 
    658  
    659657    if (current_time > when + 6L * 30L * 24L * 60L * 60L /* Old. */ 
    660658        || current_time < when - 60L * 60L) /* In the future. */ 
    661659        /* The file is fairly old or in the future. 
    file_date (time_t when) 
    665663           to allow for NFS server/client clock disagreement. 
    666664           Show the year instead of the time of day.  */ 
    667665 
    668         fmt = fmtyear; 
     666        fmt = FMTYEAR; 
    669667    else 
    670         fmt = fmttime; 
     668        fmt = FMTTIME; 
    671669 
    672670    FMT_LOCALTIME(timebuf, sizeof (timebuf), fmt, when); 
    673671