ZyX wrote:

> Try the following code:
> 
>     echo "echomsg 42" > '$HOME'
>     vim -u NONE -i NONE -S '$HOME'
> 
> . It will show “E484: Can't open file /home/zyx”, while it should just
> echo 42. Worse things will happen if file happens to contain pipe: as
> `-S …` is translated to `so …` without escaping anything this will run
> some commands.
> 
> I think that instead `do_source` needs to be called directly on `-S`,
> with another boolean value to disable expansion of anything.

The order of execution is important, calling do_source() directly
probably changes it.

We could escape special characters in the argument, but that's easy to
get wrong.  Perhaps it's time we add a command modifier that disables
any wildcard expansion?  So it would be ":nowild so $HOME".

Note that on MS-Windows we do have to expand wildcards, since the shell
doesn't do that for us.

-- 
Experience is what you get when you don't get what you want.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui