Factorize timestamp parsing to be coherent with command line format in configuration file.

This commit is contained in:
Sylvain LAFRASSE 2022-03-30 16:50:38 +02:00
parent 1ec39d1c7b
commit a543fbd7ef
6 changed files with 99 additions and 39 deletions

View file

@ -34,6 +34,7 @@
#include <unistd.h>
#include <regex.h>
#include <ini.h>
#include "options.h"
#include "configfile.h"
#include "misc.h"
#include "options.h"
@ -135,7 +136,7 @@ static int data_handler(void *user, const char *section, const char *name,
}
else if (!strcmp(name, "timestamp"))
{
option.timestamp = atoi(value);
option.timestamp = timestamp_option_parse(value);
}
else if (!strcmp(name, "log-filename"))
{
@ -260,3 +261,11 @@ void config_exit(void)
free(c);
}
void config_file_print()
{
tio_printf("INI:");
tio_printf(" path: %s", c->path);
tio_printf(" searched section: %s", c->user);
tio_printf(" found section: %s", c->section_name);
}