aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-09-14 04:00:49 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-09-14 04:00:49 +0000
commit7695365a0e6ffada25b74e1ac8fa0a54bc5aa32d (patch)
tree2a7c528bb80bb87795062f60a7c6b9106deaba76
parenta97c5c7ecd9800e86882af4476e2dc6098b78cfb (diff)
downloadlcd4linux-7695365a0e6ffada25b74e1ac8fa0a54bc5aa32d.tar.gz
strftime_tz patch from Bernhard Walle
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@894 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--plugin_time.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin_time.c b/plugin_time.c
index bae321c..a9cca8f 100644
--- a/plugin_time.c
+++ b/plugin_time.c
@@ -68,6 +68,15 @@ static void my_stftime_tz(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT
char *old_tz;
old_tz = getenv("TZ");
+
+ /*
+ * because the next setenv() call may overwrite that string, we
+ * duplicate it here
+ */
+ if (old_tz) {
+ old_tz = strdup(old_tz);
+ }
+
setenv("TZ", tz, 1);
tzset();
@@ -80,6 +89,8 @@ static void my_stftime_tz(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT
}
tzset();
+ free(old_tz);
+
SetResult(&result, R_STRING, value);
}
512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9 No changes required