Alexey I. Froloff wrote:

> * Bram Moolenaar <Bram@> [060808 22:52]:
> > !   call system(a:cmd . " '" . nmt . "'")
> This patch is evil (>:-E~~~).  Better add shellescape() function
> to Vim and properly escape argument.

Well, at least it's a lot better than what it was.  I know it wasn't
perfect.

> Patch attached.  I'm not sure if I handle WIN/UNIX defines
> properly, also I don't know how to shell-escape string on DOS/WIN
> platforms, algorithm was borrowed from php's escapeshellarg()
> function.  This function will do nothing on "nonsupported"
> platforms.
> 
> P.S. In UNIX string is surrounded by single quotes and all single
> quotes in string replaced with quote-backslash-quote-quote.  On
> DOS/WIN it surrounds string with double quotes and replaces
> doublequotes and percents to space.

Makes sense for Unix.  I don't know about MS-DOS/WIN, may depend on the
$SHELL used.  Perhaps 'shellslash' may also need to be considered.

A patch for the documentation is missing, this is required to see what
the intention of shellescape() is.

-- 
We are the Borg of GNU GPL.  We will assimilate your source code.
Resistance is futile.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to