On Fri Dec 12 2014 at 11:24:58 AM Antonio Diaz Diaz <[email protected]> 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.
_______________________________________________
bug-ed mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to