Branch: Tag:

2019-04-05

2019-04-05 09:30:10 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Calendar.Timezone: Scan time zone files in a deterministic order.

86: Inside #if 1
   if (tz) return tz;    }    +  foreach(({ "/etc/TIMEZONE", // Solaris +  "/etc/sysconfig/clock", // Linux Gentoo +  "/etc/conf.d/clock", // Linux RedHat +  "/etc/localtime", // Linux & BSDs (binary) +  }), string fname) {    // Mapping from file name to variable name. -  foreach(([ "/etc/localtime":0, // Linux & BSDs -  "/etc/sysconfig/clock":"ZONE", // Linux RedHat -  "/etc/TIMEZONE":"TZ", // Solaris -  "/etc/conf.d/clock":"TIMEZONE", // Linux Gentoo -  ]); string fname; string var_name) { +  string var_name = +  ([ "/etc/TIMEZONE":"TZ", +  "/etc/sysconfig/clock":"ZONE", +  "/etc/conf.d/clock":"TIMEZONE", +  "/etc/localtime":0, +  ])[fname];    catch {    if (Stdio.is_file(fname) && (s = Stdio.read_bytes(fname))) {    if (!var_name) {