From patchwork Sun Nov 6 23:00:58 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "C.Y.M" X-Patchwork-Id: 12082 Received: from c-24-10-6-146.hsd1.ca.comcast.net ([24.10.6.146] helo=nofear.bounceme.net) by www.linuxtv.org with esmtp (Exim 4.50) id 1EYtUT-0005vW-78 for vdr@linuxtv.org; Sun, 06 Nov 2005 23:59:57 +0100 Received: from [10.1.1.66] (hades [10.1.1.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by nofear.bounceme.net (Postfix) with ESMTP id 1F3DD73546 for ; Sun, 6 Nov 2005 14:59:20 -0800 (PST) Message-ID: <436E8B2A.1050704@syphir.sytes.net> Date: Sun, 06 Nov 2005 15:00:58 -0800 From: "C.Y.M" Organization: CooLNeT User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vdr X-Enigmail-Version: 0.92.1.0 Subject: [vdr] readline patches for broken plugins (vdr-1.3.36) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syphir@syphir.sytes.net, VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2005 22:59:57 -0000 Status: O X-Status: X-Keywords: X-UID: 5958 I noticed that several plugins that were using the MAXPARSEBUFFER macros have broke for vdr-1.3.36. The following plugins have been affected: autotimer-0.1.7 mplayercluster-0.0.1a (with Udo's latest patchset) playlist-0.0.2 streamplayer-0.1.1 text2skin.cvs undelete-0.0.3 Here is my attempt at fixing the compile. I'm not much of a programmer, so please be gentle. :) I would appreciate any criticism. BTW, these patches are not backwards compatible with older versions of vdr, so you have been warned. :) Thanks. diff -ru undelete-0.0.3.orig/undelete.c undelete-0.0.3/undelete.c --- undelete-0.0.3.orig/undelete.c 2005-10-04 05:35:15.000000000 -0700 +++ undelete-0.0.3/undelete.c 2005-11-06 14:40:33.000000000 -0800 @@ -305,10 +305,11 @@ asprintf(&p, "%s%s%s", q, *(q + strlen(q) - 1) == '/' ? "" : "/", undeleteconfigfile.u); if (!access(undeleteconfigfile.u, F_OK) && !access(undeleteconfigfile.u, R_OK) || !access(p, F_OK) && !access(p, R_OK)) { + char *s; #define MAXARGS 100 int fargc = 1; char *fargv[MAXARGS]; - char buffer[MAXPARSEBUFFER]; + cReadLine ReadLine; bool done; FILE *f; @@ -332,9 +333,9 @@ esyslog("%s: ERROR: cannot open config file: [%s]%s", plugin_name, ConfigDirectory(""), undeleteconfigfile.u); return false; } - while (fgets(buffer, sizeof(buffer), f) > 0) + while ((s = ReadLine.Read(f)) != NULL) { - p = skipspace(stripspace(buffer)); + p = skipspace(stripspace(s)); q = NULL; done = false; while (!done)