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

630Re: clear_next don't work correctly.

Expand Messages
  • Yasuhiro Matsumoto
    Apr 18 3:26 AM
    • 0 Attachment
      >I don't see how this can go wrong, unless the mb_off2cells() call gives
      >a wrong result. I guess that might happen when it's called with an
      >offset that points to the right halve of a double-wide character. At
      >least for DBCS characters this does not appear to be checked and an
      >invalid result might be returned.
      >
      >I think we should attempt to fix the cause of the problem and not work
      >around it. mb_off2cells() appears to be used in several places where we
      >don't know if we are looking at a single-byte character, the head byte
      >or the tail byte of a double-byte character. Can this be fixed?

      Hmm, I guess that the patch should be included.
      if leadbyte erase by single-width character,
      double-width character will be broken.
      Then, the trailbyte and leadbyte of next character might become DBCS.

      For example, putting ' ' on '[][]'.

      [][] : clear_next_cell will be TRUE
      v
      ][] : set ptr = " ", but mbyte_cells become 2.
      v
      [] : thus, set ptr = " " again.
      v
      ] : repeat ....
      v
      : repeat ....

      Thanks.


      _________________________________________________________________
      Chat with friends online, try MSN Messenger: http://messenger.msn.com
    • Show all 10 messages in this topic