Re: Minor vim-mingw bug
- Bram Moolenaar <Bram@...> wrote:
> Mike Steed wrote:
> > Here is an interesting bug in gvim built with the mingw32 tools.
> > The symptom is that if I run "gvim -" to capture stdin, I get a dialog
> > that says
> > Argument not supported: "-register"; Use the OLE version.
> > (And in fact, any cmdline args that start with '-' will produce this
> > behavior, which disables most of the useful ones!)
> [useful explanation removed]
> Good point. This way of implementing toupper() and tolower() was to avoid
> very slow variants of them in MS Visual C. They need to be fast for Vim.out
> A simple and reliable solution is to move the initialization of the tables
> of mch_check_win() into a separate function, which is called early fromand
> main(). I'll make a patch for that.
> > This happens with the mingw32 tools because in os_win32.h, HAVE_STRICMP
> > HAVE_STRNICMP are not defined if __GNUC__ is defined.that
> This looks strange, perhaps it was meant to be the other way around, so
> the tables are used for MS VC? Anyway, it's a bit risky to change this now,I
> rather make a safe change. Unless someone knows why this was made as itis.
Currently, toupper() and tolower() always use the tables under Windows --
regardless of the compiler (see globals.h line ~612 and mch_check_win() in
The #ifndef __GNUC__ affects only the implementation of stricmp() and
strnicmp() (Vim's implementation or the C lib implementation). Perhaps this
reduces the risk sufficiently? An added bonus is that it reduces the size of
the executable by 500 bytes. :-)
Get free email and a permanent address at http://www.netaddress.com/?N=1