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

vim56 - "|" in trail byte in ex command

Expand Messages
  • ASAI Kenichi
    Dear Vim developpers, Vim Version: vim 5.6 + patch 1-14 + macpatch 01 Environment: MacOS J1-8.1 Compile : +multi_byte Problem description: When multibyte
    Message 1 of 2 , Apr 3, 2000
      Dear Vim developpers,

      Vim Version: vim 5.6 + patch 1-14 + macpatch 01
      Environment: MacOS J1-8.1
      Compile : +multi_byte

      Problem description:

      When multibyte charcters are used in ex command such as

      set guifont=<font name using multibyte>

      and if the multibyte contains "|" (0x7c) in its trail byte, this "|"
      is mistakenly interpreted as the separation of ex commands.

      Patch:

      (I made this patch through "diff -c original-file new-file". If this
      is wrong, please let me know the correct way of making patch files.)

      --- cut here -------------------------------------------------------
      *** ../orig/ex_docmd.c Sat Mar 25 17:27:24 2000
      --- ex_docmd.c Tue Mar 28 14:01:48 2000
      ***************
      *** 3622,3627 ****
      --- 3622,3631 ----
      break;
      }
      }
      + #ifdef MULTI_BYTE
      + if (is_dbcs && IsLeadByte(*p))
      + ++p;
      + #endif
      }
      if (!(eap->argt & NOTRLCOM)) /* remove trailing spaces */
      del_trailing_spaces(eap->arg);
      --- cut here -------------------------------------------------------

      This patch does not take care of the malicious case where the line
      ends with only a leading byte. So you might want to add

      if (*p == NUL) break;

      after

      if (is_dbcs && IsLeadByte(*p))
      ++p;

      Sincerely,

      ---
      Kenichi Asai
    Your message has been successfully submitted and would be delivered to recipients shortly.