gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Trying out the new escaping version...


From: Jan Hudec
Subject: Re: [Gnu-arch-users] Trying out the new escaping version...
Date: Thu, 18 Mar 2004 14:37:54 +0100
User-agent: Mutt/1.5.5.1+cvs20040105i

On Thu, Mar 18, 2004 at 14:20:26 +0100, address@hidden wrote:
> > On Thu, Mar 18, 2004 at 11:32:38 +0100, address@hidden wrote:
> > > I made the changes i promised:
> > > 
> > >  versionfix-1
> > >   accept escaped filenames on add, delete, move, id, library-file,
> > > file-diffs, commit
> > 
> > Unfortunately this breaks more than fixes, because usualy the filename
> > is NOT from tla. And thus it WON'T be escaped.
> > 
> > In other words I expect this to work:
> > $ mkdir foo\\bar
> > $ tla add foo\\bar
> > But it says:
> > PANIC: Illegal escape sequence!
> 
> Thats by intention. It accepts "foo bar" and "foo\(sp)bar" but it will
> barf on illegal escape sequences (guess why there is a panic() call).
> For the one OS which accepts \ as path limiter the tla implementation
> also accepts /.
> 
> In the rare case that you want filenames with backslashes you have to
> escape them "tla add 'foo\\\\bar'" or "tla add `tla escape 'foo\\bar'`".
> 
> This is the correct and intended behaviour.
> That tla also accepts "foo bar" is a intended side effect.
> 
> > Please, make this behaviour optional, non-default before mergeing
> > anywhere!
> 
> Afaik there is NO catch all solution, either people have to use
> --unesecaped (or --escaped if we implement the other way around) or it
> accepts escaped filenames and people have to escape backslashes. Making
> it optional would require another commandline argument and that is
> exactly what it should not do.
> 
> I think that the solution now supports the needs of most users and is
> easy to handle. I am open to any suggestion how to make impossible
> things happen, just tell me.

Ok, it's probably convenient for users to have it this way, since \ in
filenames will be extremely rare. However, for scripts, it would be nice
to have an option to disable the escape interpretation.

Actualy the fact that tla escape does not add newline is nice, but shell
is nasty and will chomp trailing newlines no matter what:

address@hidden:~/src/tla-bugs$ echo "<`tla escape --unescaped 'foo\(nl)'`>"
<foo>
address@hidden:~/src/tla-bugs$ ash
$ echo "<`tla escape --unescaped 'foo\(nl)'`>"
<foo>
$ echo "<`tla escape --unescaped 'foo\(nl)\(nl)'`>"
<foo>

Fortunately, this does not affect trailing spaces, only trailing
newlines.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>

Attachment: signature.asc
Description: Digital signature


reply via email to

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