settings: Allow spaces in time settings before the optional unit
This commit is contained in:
parent
0058e26cb0
commit
a51c48eeaa
|
@ -23,6 +23,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "settings.h"
|
||||
#include "settings_types.h"
|
||||
|
@ -584,6 +585,10 @@ inline u_int32_t settings_value_as_time(char *value, u_int32_t def)
|
|||
}
|
||||
if (errno == 0)
|
||||
{
|
||||
while (isspace(*endptr))
|
||||
{
|
||||
endptr++;
|
||||
}
|
||||
switch (*endptr)
|
||||
{
|
||||
case 'd': /* time in days */
|
||||
|
|
|
@ -373,8 +373,8 @@ START_SETUP(setup_time_config)
|
|||
" key0 = 5\n"
|
||||
" key1 = 5s\n"
|
||||
" key2 = 5m\n"
|
||||
" key3 = 5h\n"
|
||||
" key4 = 5d\n"
|
||||
" key3 = 5 h\n"
|
||||
" key4 = 5\td\n"
|
||||
" empty = \"\"\n"
|
||||
" none = \n"
|
||||
" foo1 = bar\n"
|
||||
|
|
Loading…
Reference in New Issue