Fixed bug #149 : parsing of subsequent non-printable characters

git-svn-id: svn://kolibrios.org@9978 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2024-02-23 16:55:00 +00:00
parent a772f5b96f
commit 32b5aca57d
2 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; IRC client for KolibriOS ;; ;; IRC client for KolibriOS ;;
@ -13,7 +13,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.34' version equ '0.35'
; connection status ; connection status
STATUS_DISCONNECTED = 0 STATUS_DISCONNECTED = 0

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;
@ -319,6 +319,8 @@ draw_channel_text:
push eax push eax
.line: .line:
cmp byte[edx], 0x20
jae .printable
cmp byte[edx], 0 cmp byte[edx], 0
je .end_of_text je .end_of_text
cmp byte[edx], 13 cmp byte[edx], 13
@ -330,22 +332,27 @@ draw_channel_text:
jne .no_colors jne .no_colors
inc edx inc edx
call dec_to_esi call dec_to_esi
jz .no_colors jz .line
mov ecx, [irc_colors + 4*esi] mov ecx, [irc_colors + 4*esi]
or ecx, 0x30000000 or ecx, 0x30000000
cmp byte[edx], ',' ; background color? cmp byte[edx], ',' ; background color?
jne .no_colors jne .line
inc edx inc edx
call dec_to_esi call dec_to_esi
jz .no_colors jz .line
mov edi, [irc_colors + 4*esi] mov edi, [irc_colors + 4*esi]
or ecx, 0x40000000 or ecx, 0x40000000
.no_colors: .no_colors:
; Some non-printable, just skip it
inc edx
jmp .line
;------------------------------------------- ;-------------------------------------------
; Count characters until 0, 10, 13 or 3 byte ; Count characters until 0, 10, 13 or 3 byte
.printable:
push edx push edx
xor esi, esi xor esi, esi
dec esi dec esi
@ -354,8 +361,8 @@ draw_channel_text:
cmp esi, [textbox_width] cmp esi, [textbox_width]
je .cnt_done je .cnt_done
mov al, byte[edx] mov al, byte[edx]
cmp al, 13 cmp al, 0x20
jbe .cnt_done jb .cnt_done
inc edx inc edx
test al, 10000000b test al, 10000000b