summary refs log tree commit diff
path: root/pkgs/development/libraries/libical
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2015-06-11 15:46:50 +0200
committerLuca Bruno <lucabru@src.gnome.org>2015-06-11 15:49:29 +0200
commitfbfdc71e1ffd555fe47eff8ff28688308feaac99 (patch)
treee400f1b0cd0e4c81a907311171e7c25a5aecfa74 /pkgs/development/libraries/libical
parente1683eeff1a3bffa7837a162b58fda648ff95c08 (diff)
downloadnixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar.gz
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar.bz2
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar.lz
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar.xz
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.tar.zst
nixpkgs-fbfdc71e1ffd555fe47eff8ff28688308feaac99.zip
libical: fix crash when TZDIR is empty, and add non-nixos zoneinfo paths. Closes #8285
Diffstat (limited to 'pkgs/development/libraries/libical')
-rw-r--r--pkgs/development/libraries/libical/respect-env-tzdir.patch15
1 files changed, 6 insertions, 9 deletions
diff --git a/pkgs/development/libraries/libical/respect-env-tzdir.patch b/pkgs/development/libraries/libical/respect-env-tzdir.patch
index 980a0d5c71a..fad78c2fb8a 100644
--- a/pkgs/development/libraries/libical/respect-env-tzdir.patch
+++ b/pkgs/development/libraries/libical/respect-env-tzdir.patch
@@ -1,28 +1,25 @@
-diff --git a/src/libical/icaltz-util.c b/src/libical/icaltz-util.c
-index fe984c9..22ba0a1 100644
---- a/src/libical/icaltz-util.c
-+++ b/src/libical/icaltz-util.c
-@@ -107,7 +107,7 @@ typedef struct
+--- a/src/libical/icaltz-util.c	2015-06-11 15:40:58.843138630 +0200
++++ b/src/libical/icaltz-util.c	2015-06-11 15:43:12.722046252 +0200
+@@ -107,7 +107,7 @@
  	char	charcnt[4];			
  } tzinfo; 
  
 -static char *search_paths [] = {"/usr/share/zoneinfo","/usr/lib/zoneinfo","/etc/zoneinfo","/usr/share/lib/zoneinfo"};
-+static char *search_paths [] = {"/etc/zoneinfo"};
++static char *search_paths [] = {"/etc/zoneinfo","/usr/share/zoneinfo","/usr/lib/zoneinfo","/usr/share/lib/zoneinfo"};
  static char *zdir = NULL;
  
  #define NUM_SEARCH_PATHS (sizeof (search_paths)/ sizeof (search_paths [0]))
-@@ -194,6 +194,16 @@ set_zonedir (void)
+@@ -194,6 +194,15 @@
  	const char *fname = ZONES_TAB_SYSTEM_FILENAME;
  	unsigned int i;
  
-+	const char *env_tzdir = strdup (getenv ("TZDIR"));
++	const char *env_tzdir = getenv ("TZDIR");
 +	if (env_tzdir) {
 +		sprintf (file_path, "%s/%s", env_tzdir, fname);
 +		if (!access (file_path, F_OK|R_OK)) {
 +			zdir = env_tzdir;
 +			return;
 +		}
-+		free (env_tzdir);
 +	}
 +
  	for (i = 0; i < NUM_SEARCH_PATHS; i++) {