[vdr] [PATCH] MaxThemeName and MaxSkinName limit
Klaus.Schmidinger at tvdr.de
Sun Mar 24 11:00:57 CET 2013
On 24.03.2013 10:49, Lucian Muresan wrote:
> On 23.03.2013 22:50, Klaus Schmidinger wrote:
>> On 23.03.2013 17:14, Lucian Muresan wrote:
>>> thank you Klaus for holding up your release plan for 2.0!
>>> However, I hope this minor patch won't be too much trouble for you, as
>>> it only increases the limit of 16 to theme and skin names, letting them
>>> be NAME_MAX as almost any files, since these names can also be involved
>>> in file names.
>>> Was there a good reason to limit them at 16 only, perhaps the fear that
>>> the name won't fit on the OSD? I don't really think someone would really
>>> make use of as many as 255 characters for this. On the other hand, users
>>> just encountered crashes with plugins which (unfortunately, yet) have
>>> themes of their own, when just adding a new theme with a name longer
>>> than 16 and at the same time the original plugin author relied on
>>> MaxThemeName when allocating the string length.
>> Those are bugs in the plugins and should be fixed there.
>> Or is this something that can also happen in the core VDR?
> So be it, it's quite easy for plugins to ignore MaxThemeName or allocate
> such a string length, say 4*MaxThemeName as long as they mange their own
> I did not test how VDR reacts when it is fed with a theme or a skin with
> a name longer than 16 (seems those are the only 2 places in VDR where
> you use those, on statically allocating the strings holding the theme
> and the skin, which you store to and load from setup...
>>> So, what do you think, easy to adopt?
>> Well, for one, now is definitely not the right time for a change like this!
>> And furthermore, skin and theme names should be short. What sense does it
>> make to call a theme something like "This is the theme that implements a
>> of colors from 400 nanometers to 700 nanometers", when you could just plain
>> simple call it "rainbow"? ;-)
> Not necessary to exaggerate with such an hilarious example, you're
> getting near to sarcastic and missing the point, let's just take your
> short example in a more realistic scenario:
Themes are all about colors - why do they even need to mention resolutions?
Besides, skins should react dynamically on the current OSD size.
> just because there still are plugins having to use skins which are
> resolution-dependent, so those names aren't at all that uncommonly long
> like your example, yet they try to carry some little useful information.
> And still, one of them is already violating the limit (if we do not
> consider the file extension). Of course, you might say, take out the
> '_', or the 'x', I could answer I'd rather take out some letter out of
> "rainbow", and so on, you see what I'm trying to point out, it's hitting
> a limit difficult to argue...
>> So I'd say the limit is there for a reason, and should stay there.
> Could you at least please, name it?
Keeping the names *short* ;-)
This limit has been in there for almost ten years and has apparently
never been a problem (at least not to my knowledge). I can't change that
so close before the release of a major new version - even if it might
look like it won't break anything. You can get back to me with this after
version 2.0.0 is out. Version 2.1.x can pick up such changes again...
More information about the vdr