Message ID | df3234b05734d0debc0ca20e63f6b9d9@imap.embl.de |
---|---|
State | New |
Headers |
Received: from mail.embl-heidelberg.de ([194.94.44.200] helo=newmail.EMBL-Heidelberg.DE) by mail.linuxtv.org with esmtp (Exim 4.69) (envelope-from <martinez@embl.de>) id 1N8Jwx-0006A7-Jm for vdr@linuxtv.org; Wed, 11 Nov 2009 21:37:56 +0100 Received: (qmail 14212 invoked by uid 501); 11 Nov 2009 20:37:51 -0000 Received: from 10.1.1.228 by lxmail03.embl.de (envelope-from <martinez@embl.de>, uid 107) with qmail-scanner-2.06 (clamdscan: 0.94.2/10012. spamassassin: 3.2.5. Clear:RC:1(10.1.1.228):. Processed in 0.010154 secs); 11 Nov 2009 20:37:51 -0000 Received: from unknown (HELO webmail.embl.de) (10.1.1.228) by lxmail03.embl.de with SMTP; 11 Nov 2009 20:37:51 -0000 MIME-Version: 1.0 Date: Wed, 11 Nov 2009 21:40:17 +0100 From: <martinez@embl.de> To: <vdr@linuxtv.org> Message-ID: <df3234b05734d0debc0ca20e63f6b9d9@imap.embl.de> X-Sender: martinez@embl.de User-Agent: RoundCube Webmail/0.3-stable Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=AWL=0.105, BAYES_00=-2.599 autolearn=ham Subject: [vdr] rotor plugin puzzling question X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/options/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Wed, 11 Nov 2009 20:37:56 -0000 Status: O X-Status: X-Keywords: X-UID: 21577 |
Commit Message
martinez@embl.de
Nov. 11, 2009, 8:40 p.m. UTC
Is it just me or the newly released rotor plugin for vdr 1.7.9 needs the following patch to the plugin itself in order to run (although it compiles fine without it) If the author reads these lines I would love to know why... while (c = strchr(c, '[')) { char *e = strchr(++c, ']'); @@ -131,7 +132,7 @@ break; } } - free(c); + free(commandstring); } cRotorPos *p = RotorPositions.GetfromSource(source->Code()); if (p==RotorPositions.First())
Comments
Hello, ACK: this was clearly a bug ;-) martinez@embl.de a écrit : > Is it just me or the newly released rotor plugin for vdr 1.7.9 needs the > following patch to the plugin itself in order to run (although it compiles > fine without it) > If the author reads these lines I would love to know why... > > --- rotor.c.old 2006-06-14 23:44:27.000000000 +0200 > +++ rotor.c 2006-06-14 23:46:43.000000000 +0200 > @@ -96,7 +96,8 @@ > continue; > if ((diseqc=Diseqcs.Get(source->Code(),12000,'h')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'l')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'r'))) > { > - char *c=strdup(diseqc->Commands()); > + char *commandstring=strdup(diseqc->Commands()); > + char *c=commandstring; > while (c = strchr(c, '[')) > { > char *e = strchr(++c, ']'); > @@ -131,7 +132,7 @@ > break; > } > } > - free(c); > + free(commandstring); > I am not the author (nor even a user) but you are absolutely right. You must free the pointer as returned by strdup; not one that you have modified or incremented :( So you need to keep a virgin copy of the pointer as you have done. Cheers, Chris
I couldn't apply a patch /usr/src/vdr/PLUGINS/src/rotor-0.1.5# cat patch1 | patch -p0 --dry-run patching file rotor.c patch: **** malformed patch at line 6: (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || any clue ? > Is it just me or the newly released rotor plugin for vdr 1.7.9 needs the > following patch to the plugin itself in order to run (although it compiles > fine without it) > If the author reads these lines I would love to know why... > > --- rotor.c.old 2006-06-14 23:44:27.000000000 +0200 > +++ rotor.c 2006-06-14 23:46:43.000000000 +0200 > @@ -96,7 +96,8 @@ > continue; > if ((diseqc=Diseqcs.Get(source->Code(),12000,'h')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'l')) || > (diseqc=Diseqcs.Get(source->Code(),12000,'r'))) > { > - char *c=strdup(diseqc->Commands()); > + char *commandstring=strdup(diseqc->Commands()); > + char *c=commandstring; > while (c = strchr(c, '[')) > { > char *e = strchr(++c, ']'); > @@ -131,7 +132,7 @@ > break; > } > } > - free(c); > + free(commandstring); > } > cRotorPos *p = RotorPositions.GetfromSource(source->Code()); > if (p==RotorPositions.First())
Goga777 wrote: > I couldn't apply a patch > > > /usr/src/vdr/PLUGINS/src/rotor-0.1.5# cat patch1 | patch -p0 --dry-run > patching file rotor.c > patch: **** malformed patch at line 6: (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || >> if ((diseqc=Diseqcs.Get(source->Code(),12000,'h')) || >> (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || >> (diseqc=Diseqcs.Get(source->Code(),12000,'l')) || >> (diseqc=Diseqcs.Get(source->Code(),12000,'r'))) There only one line and it wrapped to 4 parts. You should join these parts to one line.
--- rotor.c.old 2006-06-14 23:44:27.000000000 +0200 +++ rotor.c 2006-06-14 23:46:43.000000000 +0200 @@ -96,7 +96,8 @@ continue; if ((diseqc=Diseqcs.Get(source->Code(),12000,'h')) || (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || (diseqc=Diseqcs.Get(source->Code(),12000,'l')) || (diseqc=Diseqcs.Get(source->Code(),12000,'r'))) { - char *c=strdup(diseqc->Commands()); + char *commandstring=strdup(diseqc->Commands()); + char *c=commandstring;