From 184a22eeddb724c8cb9218bf2c77fd9871ecbe7c Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Sat, 17 Oct 2015 23:01:03 +0200 Subject: [PATCH] Add d/patches/bts801734.patch - thanks to Christian Werner! --- debian/changelog | 2 ++ debian/patches/bts801734.patch | 52 ++++++++++++++++++++++++++++++++++ debian/patches/series | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 debian/patches/bts801734.patch diff --git a/debian/changelog b/debian/changelog index 19ed71f..66a5984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ tclcurl (7.22.0+hg20151017-1) UNRELEASED; urgency=low + Removed all patches, all applied upstream. Thanks Steve. * Remove d/watch. The old download location is no longer available. * Update d/copyright and add the link to Steve Havelkas bitbuck repository. + * Add d/patches/bts801734.patch - thanks to Christian Werner! + (Closes: #801734) -- Sven Hoexter Sat, 17 Oct 2015 22:16:02 +0200 diff --git a/debian/patches/bts801734.patch b/debian/patches/bts801734.patch new file mode 100644 index 0000000..321bd30 --- /dev/null +++ b/debian/patches/bts801734.patch @@ -0,0 +1,52 @@ +Description: close the file handle in time in case -file option is used +Origin: https://www.androwish.org/index.html/vpatch?from=9afc8918cdeec6d7&to=e4864fde820aac71 +Author: Christian Werner +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801734 +Forwarded: yes, email + +Index: b/generic/tclcurl.c +=================================================================== +--- a/generic/tclcurl.c ++++ b/generic/tclcurl.c +@@ -465,6 +465,12 @@ curlSetOpts(Tcl_Interp *interp, struct c + case 1: + Tcl_Free(curlData->outFile); + curlData->outFile=curlstrdup(Tcl_GetString(objv)); ++ if (curlData->outFlag) { ++ if (curlData->outHandle!=NULL) { ++ fclose(curlData->outHandle); ++ curlData->outHandle=NULL; ++ } ++ } + if ((strcmp(curlData->outFile,""))&&(strcmp(curlData->outFile,"stdout"))) { + curlData->outFlag=1; + } else { +@@ -1043,6 +1049,14 @@ curlSetOpts(Tcl_Interp *interp, struct c + case 62: + Tcl_Free(curlData->bodyVarName); + curlData->bodyVarName=curlstrdup(Tcl_GetString(objv)); ++ if (curlData->outFlag) { ++ if (curlData->outHandle!=NULL) { ++ fclose(curlData->outHandle); ++ curlData->outHandle=NULL; ++ } ++ curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,NULL); ++ } ++ curlData->outFlag=0; + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION, + curlBodyReader)) { + return TCL_ERROR; +@@ -1080,6 +1094,13 @@ curlSetOpts(Tcl_Interp *interp, struct c + break; + case 65: + curlData->writeProc=curlstrdup(Tcl_GetString(objv)); ++ if (curlData->outFlag) { ++ if (curlData->outHandle!=NULL) { ++ fclose(curlData->outHandle); ++ curlData->outHandle=NULL; ++ } ++ curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,NULL); ++ } + curlData->outFlag=0; + if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION, + curlWriteProcInvoke)) { diff --git a/debian/patches/series b/debian/patches/series index 8b13789..0c767c3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ - +bts801734.patch -- 2.39.2