From b2dd2289d31b3dadaf95aeabad852bfbbfca00f4 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sat, 6 Jan 2018 22:23:35 +0000 Subject: [PATCH] Allow decimal comma separator for times expressed as decimals. Some locales use a comma to separate a decimal whole from its fractional part, so allow either a decimal stop or a decimal comma. --- src/load_service.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/load_service.cc b/src/load_service.cc index 740ba76..5c211b1 100644 --- a/src/load_service.cc +++ b/src/load_service.cc @@ -307,6 +307,8 @@ static gid_t parse_gid_param(const std::string ¶m, const std::string &servic return grent->gr_gid; } +// Parse a time, specified as a decimal number of seconds (with optional fractional component after decimal +// point or decimal comma). static void parse_timespec(const std::string ¶mval, const std::string &servicename, const char * paramname, timespec &ts) { @@ -317,7 +319,7 @@ static void parse_timespec(const std::string ¶mval, const std::string &servi decltype(len) i; for (i = 0; i < len; i++) { char ch = paramval[i]; - if (ch == '.') { + if (ch == '.' || ch == ',') { i++; break; } -- 2.25.1