bug-ed
[Top][All Lists]
Advanced

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

Re: [Bug-ed] Trailing spaces in filenames


From: Gabriel Farrell
Subject: Re: [Bug-ed] Trailing spaces in filenames
Date: Fri, 12 Dec 2014 20:15:54 +0000

On Fri Dec 12 2014 at 11:24:58 AM Antonio Diaz Diaz <address@hidden> wrote:
I think this is the (correct) behaviour of all editors and commands in
general. I have tried moe, joe and nano, and none of them ignore
trailing, leading or embedded spaces in filenames.

Well, ed currently ignores leading spaces. And vi and ex both ignore leading and trailing. 
 
Not even when the name is specified in the command line:

$ touch a.txt
$ ed "a.txt "
a.txt : No such file or directory
$ rm "a.txt "
rm: cannot remove `a.txt ': No such file or directory
$ rm a.txt
$

The spaces count when you surround the name with quotes or escape them with backslashes, but they are ignored otherwise. That's why the readline library that bash depends on can append a space on tab completion and you don't end up with a bunch of files with trailing spaces in the names.

Then I guess the bug is in rlfe (whatever it is).
 
The ReadLine Front-End is a wrapper around readline. It was originally released by Per Bothner in 1999 and is now distributed with the Gnu Readline library:

http://git.savannah.gnu.org/cgit/readline.git/tree/examples/rlfe/README

Even with this minor issue I really enjoy editing with ed and rlfe. I hope you'll let this small patch in. I'm beginning to understand the test suite and am happy to add a test if that helps.

reply via email to

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