Hi Bram!

On Di, 19 Jan 2016, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > take this file:
> > 
> > #v+
> > ~$ cat /tmp/foobar.vim
> > set nocp
> > func! <sid>_dummy_function()
> >         echo 1
> > endfunc
> > au VimEnter * call <sid>_dummy_function()
> > ~$ LC_ALL=tr_TR.UTF-8 vim --noplugins -u /tmp/foobar.vim -N
> > Error detected while processing /tmp/foobar.vim:
> > line    2:
> > E129: Function name required
> > 1
> > line    4:
> > E193: :endfunction not inside a function
> > Press ENTER or type command to continue
> > ~$ LC_ALL=C vim --noplugins -u /tmp/foobar.vim -N -c ':q'
> > ~$
> > #v-
> > 
> > I think from googling around, what is happening is, that in turkish 
> > alphabet the lower case of I is 'ı' and not 'i' which is a totally 
> > different letter. Therefore this check in eval.c eval_fname_script(p) 
> > fails:
> > 
> >     static int
> > eval_fname_script(p)
> >     char_u      *p;
> > {
> >     if (p[0] == '<' && (STRNICMP(p + 1, "SID>", 4) == 0
> >                         || STRNICMP(p + 1, "SNR>", 4) == 0))
> >         return 5;
> >     if (p[0] == 's' && p[1] == ':')
> >         return 2;
> >     return 0;
> > }
> > 
> > A dirty fix is this:
> > diff --git a/src/eval.c b/src/eval.c
> > index dd19492..349c137 100644
> > --- a/src/eval.c
> > +++ b/src/eval.c
> > @@ -23422,7 +23422,8 @@ eval_fname_script(p)
> >      char_u     *p;
> >  {
> >      if (p[0] == '<' && (STRNICMP(p + 1, "SID>", 4) == 0
> > -                                         || STRNICMP(p + 1, "SNR>", 4) == 
> > 0))
> > +                       || STRNICMP(p + 1, "SNR>", 4) == 0
> > +                       || STRNICMP(p + 1, "sid>", 4) == 0))
> >         return 5;
> >      if (p[0] == 's' && p[1] == ':')
> >         return 2;
> > 
> > Not sure, if this is the correct approach, however.
> 
> Yeah, Turkish is probably the only language with this problme.  A better
> solution is to use MB_STRNICMP().
> 
> I cannot reproduce the problem, can you try if MB_STRNICMP() works?

Yes, that works.

Best,
Christian
-- 
Raffiniert ist der Herrgott aber boshaft ist er nicht.
                -- Albert Einstein

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