allow relative /etc/localtime links
Costa Tsaousis (ktsaou) committed
Oct 9, 2017 at 01:13 UTC
9e17125b63554c6acbafa0ef6698ec8ab8f791ae
1 file changed
+3
-2
src/main.c
+3
-2
@@ -526,8 +526,9 @@ static void get_system_timezone(void) {
526
char *cmp = "/usr/share/zoneinfo/";
527
size_t cmp_len = strlen(cmp);
528
529
- if(!strncmp(buffer, cmp, cmp_len) && buffer[cmp_len]) {
530
- timezone = &buffer[cmp_len];
529
+ char *s = strstr(buffer, cmp);
530
+ if(s && s[cmp_len]) {
531
+ timezone = &s[cmp_len];
532
// info("TIMEZONE: using the link of /etc/localtime: '%s'", timezone);
533
}
534
}