[MPlayer-dev-eng] [PATCH] suboption escaping

Joey Parrish joey at nicewarrior.org
Thu Aug 18 23:21:21 CEST 2005


On Wed, Aug 17, 2005 at 09:10:11AM +0200, Reimar Döffinger wrote:
> Hi,
> On Tue, Aug 16, 2005 at 11:59:26PM -0500, Joey Parrish wrote:
> > On Tue, Aug 16, 2005 at 11:05:11AM +0200, Reimar Döffinger wrote:
> > > I'd really like not to have yet another way of escaping. But if you
> > > think it really, absolutely is necessary, at least document it!
> > 
> > Well, it's not yet another.  The reason for this patch is because there
> > is NO SUCH METHOD in the option parser.  The subopt helper has the %len%
> > method, but that does not help.  If I am mistaken, please correct me.

> I think it is yet another, because it does not work exactly like any of
> the other methods, e.g. it doesn't support escaping via "" (like the
> normal option parser),

I don't believe this method via "" exists.  Try this:
$ mencoder -info 'artist="Something: Something else"'

You'll get:
  Option info: Unknown suboption  Something else"

Can you elaborate on this method?

> and also it won't work (from what I can tell) for
> specifying an option ending in \ (important for e.g. windows) - unless
> you make it the last option and add two \.

A simple change to make.

> I also think that your patch makes it impossible to specify an option
> value that contains a '='?

Was that not already the case?  How do you propose to change the sscanf
format?

> I am also unhappy about the fact that so many place must be changed, but
> that probably isn't your patches fault :-(.

It's not so many places!  The second version encapsulates it all in our
own strtok.  Outside of that function, we change _3_ lines of code.  The
sscanf format, and the strtok calls.

> I'd like this to be fixed, but IMHO this way is even more a hack than my
> %len% method is (and I am still not entirely happy about that one, it is
> only really useful for GUIs).

I disagree strongly, because escaping using a backslash is a very common
and expected Unix way to do things.  %len% is something I had never
heard of before I saw it proposed on this list.

--Joey

-- 
"Ours is not to question why, 'cause if we did,
  our heads would explode." --Megan




More information about the MPlayer-dev-eng mailing list