]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug 325 -- conversion of 12:30pm to 24hour time.
authorKern Sibbald <kern@sibbald.com>
Thu, 26 May 2005 06:49:23 +0000 (06:49 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 26 May 2005 06:49:23 +0000 (06:49 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2088 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kes-1.37
bacula/src/dird/run_conf.c

index 9c3760766a871b3c24125098f79bd78ed8365680..edd1500e03957fa74696e9e560dbf429d7c56b9b 100644 (file)
@@ -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.
index 23f5956dc24676b8f4f843499f67a826e25a2417..ff6a9112cbb84e6c9ad40a8960ce3a444ddacb21 100644 (file)
    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;