[Pkg-tcltk-commits] r819 - in tk8.5/trunk/debian: . patches

sgolovan-guest at alioth.debian.org sgolovan-guest at alioth.debian.org
Sun Mar 1 08:44:29 UTC 2009


Author: sgolovan-guest
Date: 2009-03-01 08:44:29 +0000 (Sun, 01 Mar 2009)
New Revision: 819

Added:
   tk8.5/trunk/debian/patches/createimageformat.diff
Modified:
   tk8.5/trunk/debian/changelog
   tk8.5/trunk/debian/patches/series
   tk8.5/trunk/debian/tk8.5.prerm
Log:
[tk8.5]
  * Don't remove wish alternative in case of package upgrade because the
    manually installed alternative is also removed which isn't desirable
    (closes: #517182).
  * Added a patch which copies image format name internally and doesn't
    require it to live till the end of thread life (closes: #517159).


Modified: tk8.5/trunk/debian/changelog
===================================================================
--- tk8.5/trunk/debian/changelog	2009-03-01 08:41:32 UTC (rev 818)
+++ tk8.5/trunk/debian/changelog	2009-03-01 08:44:29 UTC (rev 819)
@@ -1,8 +1,12 @@
-tk8.5 (8.5.6-3) UNRELEASED; urgency=low
+tk8.5 (8.5.6-3) unstable; urgency=low
 
-  * NOT RELEASED YET
+  * Don't remove wish alternative in case of package upgrade because the
+    manually installed alternative is also removed which isn't desirable
+    (closes: #517182).
+  * Added a patch which copies image format name internally and doesn't
+    require it to live till the end of thread life (closes: #517159).
 
- -- Sergei Golovan <sgolovan at debian.org>  Wed, 25 Feb 2009 17:03:12 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Sun, 01 Mar 2009 10:38:14 +0300
 
 tk8.5 (8.5.6-2) unstable; urgency=low
 

Added: tk8.5/trunk/debian/patches/createimageformat.diff
===================================================================
--- tk8.5/trunk/debian/patches/createimageformat.diff	                        (rev 0)
+++ tk8.5/trunk/debian/patches/createimageformat.diff	2009-03-01 08:44:29 UTC (rev 819)
@@ -0,0 +1,39 @@
+Patch which reverts changes introduced in 8.5.6 in Tk_CreatePhotoImageFormat().
+Copying format name leads to a bit higher memoty consumption but protects if
+the caller decides to destroy name string
+(see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517159).
+
+--- tk8.5-8.5.6.orig/generic/tkImgPhoto.c
++++ tk8.5-8.5.6/generic/tkImgPhoto.c
+@@ -473,11 +473,13 @@
+     while (tsdPtr->oldFormatList != NULL) {
+ 	freePtr = tsdPtr->oldFormatList;
+ 	tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
++	ckfree((char *) freePtr->name);
+ 	ckfree((char *) freePtr);
+     }
+     while (tsdPtr->formatList != NULL) {
+ 	freePtr = tsdPtr->formatList;
+ 	tsdPtr->formatList = tsdPtr->formatList->nextPtr;
++	ckfree((char *) freePtr->name);
+ 	ckfree((char *) freePtr);
+     }
+ }
+@@ -518,6 +520,8 @@
+     }
+     copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
+     *copyPtr = *formatPtr;
++    copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
++    strcpy(copyPtr->name, formatPtr->name);
+     copyPtr->nextPtr = tsdPtr->oldFormatList;
+     tsdPtr->oldFormatList = copyPtr;
+ }
+@@ -539,6 +543,8 @@
+     }
+     copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
+     *copyPtr = *formatPtr;
++    copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
++    strcpy(copyPtr->name, formatPtr->name);
+     if (isupper((unsigned char) *formatPtr->name)) {
+ 	copyPtr->nextPtr = tsdPtr->oldFormatList;
+ 	tsdPtr->oldFormatList = copyPtr;

Modified: tk8.5/trunk/debian/patches/series
===================================================================
--- tk8.5/trunk/debian/patches/series	2009-03-01 08:41:32 UTC (rev 818)
+++ tk8.5/trunk/debian/patches/series	2009-03-01 08:44:29 UTC (rev 819)
@@ -1,3 +1,4 @@
+createimageformat.diff
 tkport.diff
 tklibrary.diff
 tkprivate.diff

Modified: tk8.5/trunk/debian/tk8.5.prerm
===================================================================
--- tk8.5/trunk/debian/tk8.5.prerm	2009-03-01 08:41:32 UTC (rev 818)
+++ tk8.5/trunk/debian/tk8.5.prerm	2009-03-01 08:44:29 UTC (rev 819)
@@ -2,6 +2,8 @@
 
 set -e
 
-update-alternatives --remove wish /usr/bin/wish8.5
+if [ $1 != "upgrade" ] ; then
+    update-alternatives --remove wish /usr/bin/wish8.5
+fi
 
 #DEBHELPER#




More information about the Pkg-tcltk-commits mailing list