readline patches for broken plugins (vdr-1.3.36)
Commit Message
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.
Comments
C.Y.M wrote:
> I noticed that several plugins that were using the MAXPARSEBUFFER macros have
> broke for vdr-1.3.36. The following plugins have been affected:
>
>
Why not simply re-add this macro?
regards,
gunnar
Gunnar Roth wrote:
> C.Y.M wrote:
>
>> I noticed that several plugins that were using the MAXPARSEBUFFER
>> macros have
>> broke for vdr-1.3.36. The following plugins have been affected:
>>
>>
>
> Why not simply re-add this macro?
Sure, re-adding the macro is an option. I thought the point though was to
deprecate that macro? I dont really know what the proper fix should look like.
I was just trying to make a quick hack so it would build again. :) If anyone
has a better method, I would be happy to try it.
Best Regards,
C.Y.M wrote:
> I noticed that several plugins that were using the MAXPARSEBUFFER macros have
> broke for vdr-1.3.36. The following plugins have been affected:
>
> mplayercluster-0.0.1a (with Udo's latest patchset)
> streamplayer-0.1.1
Both are online in a new version. http://urichter.cjb.net/vdr/?l=en
The attached fixes return a locally allocated buffer, thus may crash
deadly. Instead, use the updated versions.
Since the bug is in the forward compatibility emulation layer, I decided
to chicken out and continue to use the static 10k buffer.
Cheers,
Udo
On Monday 07 November 2005 00:00, C.Y.M wrote:
> I noticed that several plugins that were using the MAXPARSEBUFFER macros
> have broke for vdr-1.3.36. The following plugins have been affected:
>
> text2skin.cvs
A patch for text2skin has been committed to cvs already.
Greetings,
Sascha
@@ -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)