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

14884Re: Vim can't use filename having MBYTE

Expand Messages
  • mattn@mail.goo.ne.jp
    Aug 3, 2000
      Bram@... wrote:
      > > So how about below solution?
      >
      > It might solve it in some cases, but not when the double-byte character that
      > contains a backslash is followed by an ascii character. I don't think this is
      > reliable enough.

      ---------------------------------------------
      rem_backslash(str)
      char_u *str;
      {
      #ifdef BACKSLASH_IN_FILENAME
      return (str[0] == '\\'
      #ifdef FEAT_MBYTE
      && isascii(str[1])
      #endif
      && (str[1] == ' '
      || (str[1] != NUL
      && str[1] != '*'
      && str[1] != '?'
      && !vim_isfilec(str[1]))));
      #else
      return (str[0] == '\\' && str[1] != NUL);
      #endif
      }
      ---------------------------------------------

      I think eough.
      If I liken multi-byte characters to "[A][B][C][D][E][F]",
      it will work as below.("[B]" and "[C]", [F] contain backslash)

      ex: C:\[A][B]\ [C]\I_love_[D][E][F]s.txt
      (1)
      (2)
      (3)
      (4)
      (5)
      (6)

      In this case, there is six check-point.
      (Your said is (6)?)

      (1) Next character is an ascii, but it is not "*", "?", " ".
      ---> this is not specified backslash.

      (2) Next character is a non-ascii,
      ---> this is not specified backslash.

      (3) Next character is an ascii, and it is " "
      ---> this is specified backslash.

      (4) Next character is an ascii, but it is not "*", "?", " ".
      ---> this is not specified backslash.

      (5) Next character is an ascii, but it is not "*", "?", " ".
      ---> this is not specified backslash.

      (6) Next character is an ascii, but it is not "*", "?", " ".
      ---> this is not specified backslash.
    • Show all 10 messages in this topic