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

2013-04-09 Thread Felix
From: Peter Bex Subject: Re: [Chicken-hackers] [patch] utils: qs not escaping pipes Date: Tue, 2 Apr 2013 23:22:38 +0200 > On Sun, Feb 17, 2013 at 03:53:42PM +0100, Peter Bex wrote: >> Could someone more knowledgeable about Windows please take a look at >> the version for that

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

2013-04-05 Thread Peter Bex
On Fri, Apr 05, 2013 at 10:52:34PM +0200, Felix wrote: > > Thanks. The patch is severely broken (you char=? delim which is a string, > and some other things), Ugh, serves me right for trying to make last-minute modifications at night :( > but I was able to test a modified version > on Windows. I

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

2013-04-05 Thread Felix
From: Peter Bex Subject: Re: [Chicken-hackers] [patch] utils: qs not escaping pipes Date: Tue, 2 Apr 2013 23:22:38 +0200 > On Sun, Feb 17, 2013 at 03:53:42PM +0100, Peter Bex wrote: >> Could someone more knowledgeable about Windows please take a look at >> the version for that

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

2013-04-02 Thread Peter Bex
On Sun, Feb 17, 2013 at 03:53:42PM +0100, Peter Bex wrote: > Could someone more knowledgeable about Windows please take a look at > the version for that platform? That implementation does not look correct > at all. It would be great if we could have a correct version for Windows > as well. Here'

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

2013-02-26 Thread Peter Bex
On Mon, Feb 25, 2013 at 02:53:10PM +0100, Michele La Monaca wrote: > On Mon, Feb 25, 2013 at 9:10 AM, Peter Bex wrote: > > > Do you have a reference where we can read up on this "caret escaping"? > > I think you already provided one: > http://technet.microsoft.com/en-us/library/cc723564.aspx I

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

2013-02-25 Thread Michele La Monaca
On Mon, Feb 25, 2013 at 9:10 AM, Peter Bex wrote: > Do you have a reference where we can read up on this "caret escaping"? I think you already provided one: http://technet.microsoft.com/en-us/library/cc723564.aspx > If it's context-dependent it seems like it would be impossible to decide > gene

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

2013-02-25 Thread John Cowan
Peter Bex scripsit: > > 2) removed the charater '%'. I don't see a good reason to escape it. Am I > > wrong? Percent must be escaped in .BAT and .CMD files because %FOO% is how you say $FOO. -- John Cowan co...@ccil.orghttp://ccil.org/~cowan No man is an island, entire of itself; every ma

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

2013-02-25 Thread Peter Bex
On Sun, Feb 24, 2013 at 06:00:17PM +0100, Michele La Monaca wrote: > While backslash-escaping is equivalent to its corresponding quoting, > the same is not true for caret-escaping. Depending on the context one > is more appropriate than the other. AFAICT the "general" rule is to > use double-quotin

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

2013-02-24 Thread Michele La Monaca
The provided patch is my attempt at improving qs. The new backward-compatible signature is: (define (qs str #!optional (platform (build-platform)) (escape-mode #f)) If escape-mode is false (default) qs acts in "quote-mode": double-quotes for mingw32, single-quotes for other platforms. > (display

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

2013-02-19 Thread Michele La Monaca
On Tue, Feb 19, 2013 at 10:09 PM, Peter Bex wrote: > Why? What does it buy us? The only reason 'qs' is available is to > safely escape arbitrary strings for the shell. Suppose you want to implement some kind of command-line completion. In this case backslash-escaping is a better fit, I think.

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

2013-02-19 Thread Peter Bex
On Tue, Feb 19, 2013 at 10:03:34PM +0100, Michele La Monaca wrote: > While I agree that the proposed patch is the safest approach and > should be the default behavior, I would retain the backslash-based > escaping as an option if possible. Backslash-based escaping is quite > common and should be av

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

2013-02-19 Thread Michele La Monaca
On Sun, Feb 17, 2013 at 3:22 PM, Florian Zumbiehl wrote: > Hi, > > I noticed that qs doesn't escape pipe characters. It doesn't escape '=' neither. Shell escaping, as strange as it sounds, is position dependent. Suppose you have a program named 'l=s' in your PATH. While e.g. you can delete it wit

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

2013-02-18 Thread Felix
> Seems to be pretty straightforward BASIC-style quotation: use double > quotes to quote strings, and repeat any embedded double quotes. > This looks somehow consistent with your mention of having to wrap a > complete command string in double quotes in some situations. Could > you verify this is h

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

2013-02-18 Thread Felix
>> >> I found qs very helpful. > > Me too. But if we can't get it to work correctly, it's a danger. I think that is a bit of an exaggeration. >> csc does this double-wrapping, as does setup-api (see "$system" - for >> some unknown reason the god of consistency has made sure these >> functions

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

2013-02-17 Thread Aleksej Saushev
Felix writes: > 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 > ...

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

2013-02-17 Thread Peter Bex
On Sun, Feb 17, 2013 at 09:13:16PM +0100, Felix wrote: > There is no correct version for Windows. Using double-quotes is as > good as one can get. Note that using double quotes for the > command-part of a qs'd shell command requires wrapping the whole > command string into yet another pair of doubl

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

2013-02-17 Thread Peter Bex
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? >

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

2013-02-17 Thread Felix
> *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. > > Does this "double wrap" requirem

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

2013-02-17 Thread Peter Bex
On Sun, Feb 17, 2013 at 09:13:16PM +0100, Felix wrote: > > Could someone more knowledgeable about Windows please take a look at > > the version for that platform? That implementation does not look correct > > at all. It would be great if we could have a correct version for Windows > > as well. >

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

2013-02-17 Thread Felix
> > Could someone more knowledgeable about Windows please take a look at > the version for that platform? That implementation does not look correct > at all. It would be great if we could have a correct version for Windows > as well. There is no correct version for Windows. Using double-quotes

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

2013-02-17 Thread Peter Bex
On Sun, Feb 17, 2013 at 03:53:42PM +0100, Peter Bex wrote: > Could someone more knowledgeable about Windows please take a look at > the version for that platform? That implementation does not look correct > at all. It would be great if we could have a correct version for Windows > as well. PS: T

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

2013-02-17 Thread Peter Bex
On Sun, Feb 17, 2013 at 03:22:48PM +0100, Florian Zumbiehl wrote: > Hi, > > I noticed that qs doesn't escape pipe characters. I suggest the patch > below, which not only makes it so that pipes get escaped, but it also > switches away from the blacklist approach, which invariably doesn't > work ;-)

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

2013-02-17 Thread Florian Zumbiehl
Hi, I noticed that qs doesn't escape pipe characters. I suggest the patch below, which not only makes it so that pipes get escaped, but it also switches away from the blacklist approach, which invariably doesn't work ;-) Regards, Florian --