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

Problem with :cd solved

Expand Messages
  • Bram Moolenaar
    Valery Kondakoff wrote about :cd %:p:h not working when the path has Russian characters. I have fixed that problem, see the patch below. This only applies
    Message 1 of 1 , Sep 5, 2004
    • 0 Attachment
      Valery Kondakoff wrote about ":cd %:p:h" not working when the path has
      Russian characters. I have fixed that problem, see the patch below.

      This only applies to the Win32 version, when 'encoding' is set
      differently from the active codepage.

      Please try this out with various compilers. I'm not sure the _wchdir()
      function is available everywhere.


      --- os_mswin.c 29 Jul 2004 08:41:12 -0000 1.3
      +++ os_mswin.c 5 Sep 2004 19:24:16 -0000
      @@ -624,6 +628,23 @@
      if (*path == NUL) /* drive name only */
      return 0;

      +#ifdef FEAT_MBYTE
      + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
      + {
      + WCHAR *p = enc_to_ucs2(path, NULL);
      + int n;
      +
      + if (p != NULL)
      + {
      + n = _wchdir(p);
      + vim_free(p);
      + if (n == 0)
      + return 0;
      + /* Retry with non-wide function (for Windows 98). */
      + }
      + }
      +#endif
      +
      return chdir(path); /* let the normal chdir() do the rest */
      }



      --
      LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
      hacks him to the floor. Blood. Swashbuckling music (perhaps).
      LAUNCELOT races through into the castle screaming.
      SECOND SENTRY: Hey!
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.