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

Joey Parrish joey at nicewarrior.org
Sun Aug 7 19:19:28 CEST 2005


On Sun, Aug 07, 2005 at 06:11:43AM +0300, Oded Shimon wrote:
> On Sat, Aug 06, 2005 at 06:59:47PM -0500, Joey Parrish wrote:
> > Hello,
> > 
> > Attached is a patch to allow escaping of suboptions.
> > The biggest reason for this is that without this patch, I keep wanting
> > to do this:
> >   $ mencoder -info "title=Star Trek: The Next Generation"
> > With this patch, you can say:
> >   $ mencoder -info "title=Star Trek\\: The Next Generation"
> > One escape shown above is for the shell, one is for mencoder.
> > 
> > I've also attached a second patch with an alternative implementation.
> > Please comment on the concept, and then one which patch you prefer.
> > 
> > I'd like to commit this soon.
> 
> I don't really like this patch. maybe m_option should chnage to behavior 
> like subopt - %len%string .

The subopt way is no good.  If I am shell scripting a rip, I don't want
to take title as a param, count the characters in the string, and then
add %len% to the start.  That's counter-intuitive to shell escaping.  In
my opinion, shell escaping with a \ is far more sensible.

> As is this patch is no good anyway. What if I want a literal '\'?

Then you use \\.  Just like you would expect.  Try it, it works.
How does your system deal with a string that begins with %?  IIRC,
I would have to encode "%98" as "%3%%98".

--Joey

-- 
"Indeed do many things come to pass."
  HBT; The Book of Predictions, Chap. 19




More information about the MPlayer-dev-eng mailing list