~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

« back to all changes in this revision

Viewing changes to src/e-date.c

  • Committer: Package Import Robot
  • Author(s): bojo42
  • Date: 2012-03-29 14:17:21 UTC
  • mfrom: (1.3.9) (3.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20120329141721-tbfopcrc5797wxt7
Tags: 1.8.3-0.1ubuntu1
* New upstream release (LP: #290666, #371754, #741543, #716688)
* Merge from Debian unstable (LP: #935147), remaining changes:
* debian/patches:
  - drop gtk-status-icon.patch & notification-append as in upstream
  - drop fix_systray_behavior as mostly upstreamed and rest seems unused
  - 01_ubuntu_feedlists: update & rename, move planets to "Open Source"  
  - add_X-Ubuntu-Gettext-Domain: rebase
  - libunity.patch: rebase, apply before indicator patch (liferea_shell.c)
  - libindicate_increase_version.patch: exclude from libindicate.patch
  - deactivate libindicate.patch, seems partly upstreamed and needs rework
* debian/control: libindicate-dev, libindicate-gtk-dev & libunity-dev
* debian/liferea.indicate & liferea.install: ship indicator desktop file
* debian/rules: enable libindicate

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
#include "e-date.h"
33
33
 
34
 
static size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
35
 
{
36
 
#ifdef HAVE_LKSTRFTIME
37
 
        return strftime(s, max, fmt, tm);
38
 
#else
39
 
        char *c, *ffmt, *ff;
40
 
        size_t ret;
41
 
 
42
 
        ffmt = g_strdup(fmt);
43
 
        ff = ffmt;
44
 
        while ((c = strstr(ff, "%l")) != NULL) {
45
 
                c[1] = 'I';
46
 
                ff = c;
47
 
        }
48
 
 
49
 
        ff = ffmt;
50
 
        while ((c = strstr(ff, "%k")) != NULL) {
51
 
                c[1] = 'H';
52
 
                ff = c;
53
 
        }
54
 
 
55
 
        ret = strftime(s, max, ffmt, tm);
56
 
        g_free(ffmt);
57
 
        return ret;
58
 
#endif
59
 
}
60
 
 
61
34
 
62
35
/**
63
36
 * Function to do a last minute fixup of the AM/PM stuff if the locale
86
59
 
87
60
        if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) {
88
61
                /* No AM/PM involved - can use the fmt string directly */
89
 
                ret=e_strftime(s, max, fmt, tm);
 
62
                ret=strftime(s, max, fmt, tm);
90
63
        } else {
91
64
                /* Get the AM/PM symbol from the locale */
92
 
                e_strftime (buf, 10, "%p", tm);
 
65
                strftime (buf, 10, "%p", tm);
93
66
 
94
67
                if (buf[0]) {
95
68
                        /**
96
69
                         * AM/PM have been defined in the locale
97
70
                         * so we can use the fmt string directly
98
71
                         **/
99
 
                        ret=e_strftime(s, max, fmt, tm);
 
72
                        ret=strftime(s, max, fmt, tm);
100
73
                } else {
101
74
                        /**
102
75
                         * No AM/PM defined by locale
113
86
                        for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) {
114
87
                                sp[1]='H';
115
88
                        }
116
 
                        ret=e_strftime(s, max, ffmt, tm);
 
89
                        ret=strftime(s, max, ffmt, tm);
117
90
                        g_free(ffmt);
118
91
                }
119
92
        }