Loading ...
Sorry, an error occurred while loading the content.
 

[bugfix] RE: Patch 6.1.421 (extra)

Expand Messages
  • Vince Negri
    ... Maynard) ... I just noticed that this patch breaks the build if FEAT_MBYTE is not enabled. This fixes it:
    Message 1 of 2 , Apr 2, 2003
      > Patch 6.1.421 (extra, depends on 6.1.354)
      > Problem: MS-Windows 9x: When putting text on the clipboard it can be in
      > the wrong encoding.
      > Solution: Convert text to the active codepage for CF_TEXT. (Glenn
      Maynard)
      > Files: src/os_mswin.c

      I just noticed that this patch breaks the build if FEAT_MBYTE is
      not enabled.

      This fixes it:


      ===================================================================
      RCS file: /cvsroot/vim/vim/src/os_mswin.c,v
      retrieving revision 1.42
      diff -c -5 -r1.42 os_mswin.c
      *** os_mswin.c 27 Mar 2003 00:23:22 -0000 1.42
      --- os_mswin.c 2 Apr 2003 08:00:01 -0000
      ***************
      *** 1101,1110 ****
      --- 1101,1111 ----
      for (str_size = 0; str_size < maxlen; ++str_size)
      if (str[str_size] == NUL)
      break;
      }

      + #ifdef FEAT_MBYTE
      /* The text is now in the active codepage. Convert to
      'encoding',
      * going through UCS-2. */
      maxlen = MultiByteToWideChar(CP_ACP, 0, str, str_size, NULL, 0);
      to_free = alloc((unsigned)(maxlen * sizeof(WCHAR)));
      if (to_free != NULL)
      ***************
      *** 1117,1126 ****
      --- 1118,1128 ----
      {
      vim_free(to_free);
      to_free = str;
      }
      }
      + #endif
      }
      }

      if (str != NULL && *str != NUL)
      {


      Vince



      Legal Disclaimer: Any views expressed by the sender of this message are
      not necessarily those of Application Solutions Ltd. Information in this
      e-mail may be confidential and is for the use of the intended recipient
      only, no mistake in transmission is intended to waive or compromise such
      privilege. Please advise the sender if you receive this e-mail by mistake.
    • Bram Moolenaar
      ... Right. This should probably also check for WIN3264 , I don t think MultiByteToWideChar() is available in MS-Windows 3.1. -- GUARD #1: What -- a swallow
      Message 2 of 2 , Apr 2, 2003
        Vince Negri wrote:

        > > Patch 6.1.421 (extra, depends on 6.1.354)
        > > Problem: MS-Windows 9x: When putting text on the clipboard it can be in
        > > the wrong encoding.
        > > Solution: Convert text to the active codepage for CF_TEXT. (Glenn Maynard)
        > > Files: src/os_mswin.c
        >
        > I just noticed that this patch breaks the build if FEAT_MBYTE is
        > not enabled.
        >
        > This fixes it:

        Right. This should probably also check for "WIN3264", I don't think
        MultiByteToWideChar() is available in MS-Windows 3.1.

        --
        GUARD #1: What -- a swallow carrying a coconut?
        ARTHUR: It could grip it by the husk!
        GUARD #1: It's not a question of where he grips it! It's a simple question
        of weight ratios! A five ounce bird could not carry a 1 pound
        coconut.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      Your message has been successfully submitted and would be delivered to recipients shortly.