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;
{
int token;
utime_t utime;
+ char period[500];
token = lex_get_token(lc, T_ALL);
errno = 0;
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;
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);
}
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;