lcd wrote:

>     The easy way to describe this is by an example:
> 
>         :echo system('printf "a\0b\n"')
> 
> prints "a".  The output of "system(command)" is truncated at the first
> NUL character in command's output.
> 
>     This affects all functions calling get_cmd_output(), including
> "make", "grep", and friends, and that's particularly annoying since some
> compilers (f.i. ghc-mod Haskell compiler) include NULs in their error
> messages.
> 
>     Now, looking at get_cmd_output() it's pretty clear why this happens.
> It isn't obvious how to fix that though, since once we're out of the
> said function we lose all information about the real length of command's
> output.

I suppose truncation is never useful.  How about changing the NUL (0x00)
into SOH (0x01)?  SOH hardly ever appears, thus it can still be
recognized as probably having been a NUL.

-- 
A fine is a tax for doing wrong.  A tax is a fine for doing well.

 /// 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/groups/opt_out.


Raspunde prin e-mail lui