From patchwork Tue May 30 13:22:11 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 12326 Received: from mail-out.m-online.net ([212.18.0.9]) by www.linuxtv.org with esmtp (Exim 4.50) id 1Fl4An-0002kO-Vy for vdr@linuxtv.org; Tue, 30 May 2006 15:22:14 +0200 Received: from mail01.m-online.net (svr21.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 9874170B79 for ; Tue, 30 May 2006 15:22:13 +0200 (CEST) Received: from gauss.x.fun (DSL01.83.171.162.101.NEFkom.net [83.171.162.101]) by mail.nefkom.net (Postfix) with ESMTP id 7C60D91119 for ; Tue, 30 May 2006 15:22:13 +0200 (CEST) Received: from gateway (gateway [192.168.42.1]) by gauss.x.fun (Postfix) with ESMTP id CF54D10E8D4C for ; Tue, 30 May 2006 15:22:12 +0200 (CEST) From: Matthias Schwarzott To: vdr@linuxtv.org Date: Tue, 30 May 2006 15:22:11 +0200 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Message-Id: <200605301522.12083.zzam@gentoo.org> Subject: [vdr] reelchannelscan-0.3.0 with complete empty channels.conf before X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 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: Tue, 30 May 2006 13:22:14 -0000 Status: O X-Status: X-Keywords: X-UID: 9654 Hi! With this patch applied reelchannelscan will no longer crash if the channels.conf file was completely empty before scanning. Btw. why I am able to start vdr with a completely empty channels.conf, but not when the file is missing. I thinks this should be changed, vdr should create the file if necessary. Matthias diff -ru reelchannelscan-0.3.0-orig/csmenu.c reelchannelscan-0.3.0/csmenu.c --- reelchannelscan-0.3.0-orig/csmenu.c 2006-05-30 15:01:08.000000000 +0200 +++ reelchannelscan-0.3.0/csmenu.c 2006-05-30 15:11:02.000000000 +0200 @@ -100,7 +100,11 @@ // CurrentChannel has to be greater than 0! CurrentChannelNr = CurrentChannelNr == 0 ? 1 : CurrentChannelNr; cChannel *channel = Channels.GetByNumber(CurrentChannelNr); - source = channel->Source(); + if (channel) { + source = channel->Source(); + } else { + source = cSource::FromString("S19.2E"); + } currentChannel = CurrentChannelNr; scanActiveMenu = false; // timer for loop mode