From 3130abc7b886dbb5dcdb2f20ea2d52bd0637c527 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 26 May 2005 06:49:23 +0000 Subject: [PATCH] Fix bug 325 -- conversion of 12:30pm to 24hour time. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2088 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kes-1.37 | 1 + bacula/src/dird/run_conf.c | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 9c3760766a..edd1500e03 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -7,6 +7,7 @@ Changes to 1.37.19: 26May05 - Fix compile problem of ua_restore.c on broken compilers. - Apply patch from bug 326 to permit bacula status by any user. +- Fix bug 325 -- conversion of 12:30pm to 24hour time. 25May05 - Put Dmsg() on inside if() to avoid calling subroutine. - Make restore.bsr have unique name. diff --git a/bacula/src/dird/run_conf.c b/bacula/src/dird/run_conf.c index 23f5956dc2..ff6a9112cb 100644 --- a/bacula/src/dird/run_conf.c +++ b/bacula/src/dird/run_conf.c @@ -11,19 +11,14 @@ Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as ammended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -422,7 +417,7 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) /* NOT REACHED */ } *p++ = 0; /* separate two halves */ - code = atoi(lc->str); + code = atoi(lc->str); /* pick up hour */ len = strlen(p); if (len > 2 && p[len-1] == 'm') { if (p[len-2] == 'a') { @@ -436,15 +431,19 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) } else { pm = 0; } - code2 = atoi(p); + code2 = atoi(p); /* pick up minutes */ if (pm) { - code += 12; + /* Convert to 24 hour time */ + if (code == 12) { + code -= 12; + } else { + code += 12; + } } if (code < 0 || code > 23 || code2 < 0 || code2 > 59) { scan_err0(lc, _("Bad time specification.")); /* NOT REACHED */ } - /****FIXME**** convert to UTC */ set_bit(code, lrun.hour); lrun.minute = code2; have_hour = true; -- 2.39.5