]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/parse_conf.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / lib / parse_conf.c
index 217a4d50e626c85c572e0b8c112afe699dfb5c4b..2c3ac1b43e3c0941b811c02427d695f284453cef 100755 (executable)
@@ -284,7 +284,7 @@ static void scan_types(LEX *lc, MSGS *msg, int dest_code, char *where, char *cmd
         str = &lc->str[0];
       }
       for (i=0; msg_types[i].name; i++) {
-        if (strcmp(str, msg_types[i].name) == 0) {
+        if (strcasecmp(str, msg_types[i].name) == 0) {
            msg_type = msg_types[i].token;
            found = TRUE;
            break;
@@ -485,6 +485,7 @@ void store_time(LEX *lc, struct res_items *item, int index, int pass)
 {
    int token; 
    utime_t utime;
+   char period[500];
 
    token = lex_get_token(lc, T_ALL);
    errno = 0;
@@ -492,8 +493,18 @@ void store_time(LEX *lc, struct res_items *item, int index, int pass)
    case T_NUMBER:
    case T_IDENTIFIER:
    case T_UNQUOTED_STRING:
-      if (!duration_to_utime(lc->str, &utime)) {
-         scan_err1(lc, "expected a time period, got: %s", lc->str);
+      bstrncpy(period, lc->str, sizeof(period));
+      if (lc->ch == ' ') {
+        token = lex_get_token(lc, T_ALL);
+        switch (token) {
+        case T_IDENTIFIER:
+        case T_UNQUOTED_STRING:
+           bstrncat(period, lc->str, sizeof(period));
+           break;
+        }
+      }
+      if (!duration_to_utime(period, &utime)) {
+         scan_err1(lc, "expected a time period, got: %s", period);
       }
       *(utime_t *)(item->value) = utime;
       break;
@@ -501,7 +512,9 @@ void store_time(LEX *lc, struct res_items *item, int index, int pass)
       scan_err1(lc, "expected a time period, got: %s", lc->str);
       break;
    }
-   scan_to_eol(lc);
+   if (token != T_EOL) {
+      scan_to_eol(lc);
+   }
    set_bit(index, res_all.hdr.item_present);
 }
 
@@ -665,7 +678,8 @@ parse_config(char *cf)
                     if (i >= 0) {
                         Dmsg2(150, "level=%d id=%s\n", level, lc->str);
                         Dmsg1(150, "Keyword = %s\n", lc->str);
-                        scan_err1(lc, "Keyword \"%s\" not permitted in this resource", lc->str);
+                        scan_err1(lc, "Keyword \"%s\" not permitted in this resource.\n"
+                           "Perhaps you left the trailing brace off of the previous resource.", lc->str);
                        /* NOT REACHED */
                     }
                     break;