chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [patch] utils: qs not escaping pipes


From: Peter Bex
Subject: Re: [Chicken-hackers] [patch] utils: qs not escaping pipes
Date: Sun, 17 Feb 2013 21:47:28 +0100
User-agent: Mutt/1.4.2.3i

On Sun, Feb 17, 2013 at 09:37:14PM +0100, Felix wrote:
> > *shakes head in disbelief*.  If that's really true this should be
> > made _very explicit_ in the manual, so people know what to expect.
> > Perhaps point out the "process" interfaces as an alternative.
> > Maybe deprecate "qs" entirely?
> 
> I found qs very helpful. 

Me too.  But if we can't get it to work correctly, it's a danger.

> > Does this "double wrap" requirement mean my change to setup-api will
> > cause breakage on Windows?  If the change is *not* made, the patch for
> > qs breaks on UNIX.
> 
> csc does this double-wrapping, as does setup-api (see "$system" - for
> some unknown reason the god of consistency has made sure these
> functions do actually roughly the same thing). I darkly recall that
> '...' was not sufficient for quoting everything but apparently that
> was wrong. Weird.

I'm not sure if this is an answer to my question.  Or maybe I don't
understand the answer :)

> One question, though: how can I escape the tick (#\') itself? My
> attempts at the bash prompt using various combinations of ' and \
> don't seem to work. Actually, the more I try, the more I realize that
> the situation with bash isn't much better than it with with Windows
> ...

First off, it's POSIX (bourne) shell we're targeting, not specifically
bash (which has stupid additional idiosyncracies).

What the patch does is to quote a string like "it's a dark, rainy night"
as 'it'\''s a dark, rainy night'

In other words, it leaves the quoted string and escapes the quote
outside.  Then it re-enters the string.  It needs to be done like
this because the backslash loses its special meaning inside single
quotes (which is why it doesn't need to be special-cased in this
new version).

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]