Dominique Pelle wrote:

> > Your solution depends on strtok() changing the space after the command to
> > a NUL.  What if there are several spaces:  ":cs find   e a"?  I don't
> > think it is defined what strtok() does with the extra spaces.  They
> > could be replaced with NUL or not.
> >
> > Another solution, which is not clean either, is to store the length of
> > eap->arg in a global variable, before the first call to strtok().
> 
> Yes. That assumption bothered me a bit too. Changing eap->arg
> after call to strtok(eap->arg, " ") may be asking for trouble.  But
> information is just missing in cs_find() to implement a fix without
> either:
> - passing an extra parameter to the function (but it's used
>   as function pointer, so we'd need to change other functions
>   too (so I don't like it)
> - adding a field in exarg_T with length of eap->arg, but type
>   is used in tons of other places (so I don't like it)
> - using a global static variable as you suggest to store length
>   of eap->arg (maybe not clean, but most pragmatic solution)
> 
> So I attach a patch which uses a global static variable.
> It is more portable and also simpler than my previous patch.

Thanks for continuing to improve the patch.  It think this is the best
solution.  I'll include it now.

- Bram

-- 
hundred-and-one symptoms of being an internet addict:
203. You're an active member of more than 20 newsgroups.

 /// 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    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui