diff options
author | Jan Kara <jack@suse.cz> | 2011-10-20 15:56:34 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-20 15:58:13 +0200 |
commit | c6109efaa165518439c3bf624a77a4bd20a22c6e (patch) | |
tree | cb7851b85170adac77c907daa263a4d561d7c1ae | |
parent | 1b9b075a221a4a7025d6267fdeaa18e8acdd3dd4 (diff) | |
download | linuxquota-c6109efaa165518439c3bf624a77a4bd20a22c6e.tar.gz |
edquota: Fix localication of time units
Time units were localized when printing (e.g. individual grace times) to file
for editing but were not localized when parsing them back. Fix it.
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | quotaops.c | 2 | ||||
-rw-r--r-- | quotasys.c | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -396,7 +396,7 @@ int writeindividualtimes(struct dquot *qlist, int outfd, char *name, int quotaty else if (q->dq_dqb.dqb_btime <= now) strcpy(btimestr, _("0seconds")); else - sprintf(btimestr, "%useconds", (unsigned)(q->dq_dqb.dqb_btime - now)); + sprintf(btimestr, _("%useconds"), (unsigned)(q->dq_dqb.dqb_btime - now)); if (!q->dq_dqb.dqb_itime) strcpy(itimestr, _("unset")); else if (q->dq_dqb.dqb_itime <= now) @@ -332,13 +332,13 @@ void time2str(time_t seconds, char *buf, int flags) */ int str2timeunits(time_t num, char *unit, time_t *res) { - if (memcmp(unit, "second", 6) == 0) + if (!strcmp(unit, _("second")) || !strcmp(unit, _("seconds"))) *res = num; - else if (memcmp(unit, "minute", 6) == 0) + else if (!strcmp(unit, _("minute")) || !strcmp(unit, _("minutes"))) *res = num * 60; - else if (memcmp(unit, "hour", 4) == 0) + else if (!strcmp(unit, _("hour")) || !strcmp(unit, _("hours"))) *res = num * 60 * 60; - else if (memcmp(unit, "day", 3) == 0) + else if (!strcmp(unit, _("day")) || !strcmp(unit, _("days"))) *res = num * 24 * 60 * 60; else return -1; |