Skip to content

Commit

Permalink
lib-settings: settings_get_time() requires explicit unit now, except …
Browse files Browse the repository at this point in the history
…for 0.

This means that all the time interval settings in dovecot.conf must no
longer be simply a number.
  • Loading branch information
sirainen authored and GitLab committed May 7, 2016
1 parent c001f4b commit 5d1653a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-settings/settings-parser.c
Expand Up @@ -361,6 +361,11 @@ int settings_get_time(const char *str, unsigned int *secs_r,
return -1;
}
while (*p == ' ') p++;
if (*p == '\0' && num != 0) {
*error_r = t_strdup_printf("Time interval '%s' is missing units "
"(add e.g. 's' for seconds): ", str);
return -1;
}
switch (i_toupper(*p)) {
case 'S':
multiply = 1;
Expand Down

0 comments on commit 5d1653a

Please sign in to comment.