slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Better caching in SLtt_set_alt_char_set


Hello!

Sometimes SLtt_set_alt_char_set is called with different non-zero
arguments. While user programs normally care to pass 1 to it, other
functions in sldisply.c itself use SLTT_ALTC_MASK (0x10000000UL)

Now it emits useless Start_Alt_Chars_Str. After the patch it won't.

ChangeLog:
	* src/sldisply.c (SLtt_set_alt_char_set): Bugfix for the
	caching code - do nothing if the argument is non-zero and
	the alt charset is already active.

________________________________
--- src/sldisply.c
+++ src/sldisply.c
@@ -1255,7 +1255,7 @@ void SLtt_set_alt_char_set (int i)
 {
    static int last_i;
    if (SLtt_Has_Alt_Charset == 0) return;
-   if (i == last_i) return;
+   if ((i != 0) == (last_i != 0)) return;
    tt_write_string (i ? Start_Alt_Chars_Str : End_Alt_Chars_Str );
    last_i = i;
 }
________________________________

Regards,
Pavel Roskin


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]