summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorK. Handa <handa@gnu.org>2016-06-05 20:49:55 +0900
committerK. Handa <handa@gnu.org>2016-06-05 20:49:55 +0900
commit4ffe265b5192fd93137cd49fb204efdc4bda2887 (patch)
tree054528efc2f8deb55396df2c871d093ae270be5d /src
parent096d1347654803ee04771516c58701ddf210d898 (diff)
parent75de3640f147fad8bf1c4a7e393c8e294b9851f6 (diff)
downloademacs-4ffe265b5192fd93137cd49fb204efdc4bda2887.tar.gz
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/w32.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 442ce79b23c..71a38b91946 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -2505,6 +2505,35 @@ sys_putenv (char *str)
return unsetenv (str);
}
+ if (strncmp (str, "TZ=<", 4) == 0)
+ {
+ /* MS-Windows does not support POSIX.1-2001 angle-bracket TZ
+ abbreviation syntax. Convert to POSIX.1-1988 syntax if possible,
+ and to the undocumented placeholder "ZZZ" otherwise. */
+ bool supported_abbr = true;
+ for (char *p = str + 4; *p; p++)
+ {
+ if (('0' <= *p && *p <= '9') || *p == '-' || *p == '+')
+ supported_abbr = false;
+ else if (*p == '>')
+ {
+ ptrdiff_t abbrlen;
+ if (supported_abbr)
+ {
+ abbrlen = p - (str + 4);
+ memmove (str + 3, str + 4, abbrlen);
+ }
+ else
+ {
+ abbrlen = 3;
+ memset (str + 3, 'Z', abbrlen);
+ }
+ memmove (str + 3 + abbrlen, p + 1, strlen (p));
+ break;
+ }
+ }
+ }
+
return _putenv (str);
}