From patchwork Sat Jun 6 14:09:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12737 Received: from crow.cadsoft.de ([217.86.189.86] helo=raven.cadsoft.de) by mail.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1MCwaB-0001Hy-G1 for vdr@linuxtv.org; Sat, 06 Jun 2009 16:09:17 +0200 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.14.3/8.14.3) with ESMTP id n56E9B76010705 for ; Sat, 6 Jun 2009 16:09:11 +0200 Message-ID: <4A2A7886.80801@cadsoft.de> Date: Sat, 06 Jun 2009 16:09:10 +0200 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: vdr@linuxtv.org References: <200902272124.38328.ville.skytta@iki.fi> <200904142312.16137.ville.skytta@iki.fi> <200906040912.01927.ludwig.nussel@suse.de> In-Reply-To: <200906040912.01927.ludwig.nussel@suse.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (raven.cadsoft.de [192.168.1.1]); Sat, 06 Jun 2009 16:09:11 +0200 (CEST) X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=AWL=0.008, BAYES_00=-2.599 autolearn=ham Subject: Re: [vdr] Build failures with gcc 4.4 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 14:09:17 -0000 Status: O X-Status: X-Keywords: X-UID: 20737 On 04.06.2009 09:12, Ludwig Nussel wrote: > ... > So gcc 4.4 finally hit openSUSE as well. I use the attached patch to > make vdr compile. Seems to work fine too. The code that requires > those const casts is really ugly though. How about the attached change? Should apply to VDR 1.6 just as well. Klaus --- svdrp.c 2009/06/06 13:42:52 2.4 +++ svdrp.c 2009/06/06 14:03:55 @@ -798,16 +798,17 @@ char RealFileName[PATH_MAX]; if (FileName) { if (grabImageDir) { - cString s; - char *slash = strrchr(FileName, '/'); + cString s(FileName); + FileName = s; + const char *slash = strrchr(FileName, '/'); if (!slash) { s = AddDirectory(grabImageDir, FileName); FileName = s; } slash = strrchr(FileName, '/'); // there definitely is one - *slash = 0; - char *r = realpath(FileName, RealFileName); - *slash = '/'; + cString t(s); + t.Truncate(slash - FileName); + char *r = realpath(t, RealFileName); if (!r) { LOG_ERROR_STR(FileName); Reply(501, "Invalid file name \"%s\"", FileName);