Debian Bug report logs - #62771
SLsmg_refresh trashes wrong lines

version graph

Package: slang1; Maintainer for slang1 is (unknown);

Reported by: Klaus Weide <kweide@enteract.com>

Date: Thu, 20 Apr 2000 22:03:16 UTC

Severity: normal

Found in version 1.3.9-1

Done: Jim Mintha <jim@ic.uva.nl>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Jim Mintha <jmintha@debian.org>:
Bug#62771; Package slang1. (full text, mbox, link).


Acknowledgement sent to Klaus Weide <kweide@enteract.com>:
New Bug report received and forwarded. Copy sent to Jim Mintha <jmintha@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Klaus Weide <kweide@enteract.com>
To: submit@bugs.debian.org
Cc: davis@space.mit.edu
Subject: SLsmg_refresh trashes wrong lines
Date: Thu, 20 Apr 2000 16:38:37 -0500 (CDT)
Package: slang1
Version: 1.3.9-1

Consider this for demonstration:
-------------------- snip ------------------------
#include <slang.h>
int main (void)
{
    SLtt_get_terminfo();
    SLsmg_init_smg();

    SLsmg_gotorc(8, 0);
    SLsmg_write_string("foo foo foo foo foo foo");
    SLsmg_gotorc(9, 0);
    SLsmg_write_string("- statusline -");
    SLsmg_refresh();

    sleep(2);

    SLsmg_gotorc(8, 0);
    SLsmg_write_string("bar bar bar");
    SLsmg_gotorc(9, 0);
    SLsmg_erase_eol();
    SLsmg_write_string("hmm..");
    SLsmg_touch_lines(9, 1);
    SLsmg_refresh();

    sleep(2);

    SLsmg_reset_smg();
}
-------------------- snip ------------------------

1) shown after the first refresh:

foo foo foo foo foo foo
- statusline -

2a) expected after the second refresh:

bar bar bar foo foo foo
hmm..

2b) actually shown after the second refresh:

bar bar bar
hmm..tusline -


- Removing the SLsmg_touch_lines() call produces 2a).
- Applying the patch below also produces 2a).
  (This actually just reverts to code, with some (proper?) adjustments,
  that I found in some early pre-1.0 version of slsmg.c.)

The documentation discourages using SLsmg_touch_lines(), but it is
useful in Lynx's code when dealing with UTF-8 (or similar multibyte)
output.  (In the simple example above it's pointless, of course.)

   Klaus


--- src/slsmg.c.~1~	Thu Sep 23 02:26:01 1999
+++ src/slsmg.c	Wed Apr 19 23:22:12 2000
@@ -874,7 +874,12 @@
 	  {
 	     int color = This_Color;
 
-	     if (Cls_Flag == 0) (*tt_del_eol) ();
+	     if (Cls_Flag == 0)
+		 {
+		     (*tt_goto_rc) (i, -1); /* Force cursor to move */
+		     (*tt_goto_rc) (i, 0);
+		     (*tt_del_eol) ();
+		 }
 	     This_Color = 0;
 	     blank_line (SL_Screen[i].old, Screen_Cols, ' ');
 	     This_Color = color;



Information forwarded to debian-bugs-dist@lists.debian.org, Jim Mintha <jmintha@debian.org>:
Bug#62771; Package slang1. (full text, mbox, link).


Acknowledgement sent to Klaus Weide <kweide@enteract.com>:
Extra info received and forwarded to list. Copy sent to Jim Mintha <jmintha@debian.org>. (full text, mbox, link).


Message #10 received at 62771@bugs.debian.org (full text, mbox, reply):

From: Klaus Weide <kweide@enteract.com>
To: "John E. Davis" <davis@space.mit.edu>
Cc: 62771@bugs.debian.org
Subject: Re: SLsmg_refresh trashes wrong lines
Date: Fri, 21 Apr 2000 10:18:56 -0500 (CDT)
On Thu, 20 Apr 2000, John E. Davis wrote:

> On Thu, 20 Apr 2000 16:38:37 -0500 (CDT), Klaus Weide <kweide@enteract.com> said:
> >The documentation discourages using SLsmg_touch_lines(), but it is
> >useful in Lynx's code when dealing with UTF-8 (or similar multibyte)
> >output.  (In the simple example above it's pointless, of course.)
> 
> Someone else also reported this bug a few weeks ago.  My solution was
> similar, except that I did not use the line:
> 
> 	     (*tt_goto_rc) (i, -1); /* Force cursor to move */
> 
> Is this line necessary?

I am not sure that it is - it's basically copied (with the comment) from
a pre 1.0 version of slsmg.c I had lying around.  I just checked that
passing -1 to SLtt_goto_rc() still has the intended effect of unsetting
Cursor_Set, and it looked like a good idea to use it - if the line
contents is regarded as 'trashed', the real cursor position might also
be out of whack (especially when thinking about UTF-8 output).

> slang v2.0 will have native support for UTF-8.

That's very good news.

I would be interested in how this changes/adds to the interface
(only interested in the C interface).  Will there be functions
that take UCS (wide character) arguments, or just (char *) as before?
I asssume that functions like SLsmg_get_column() will keep track of
(and return) the real cursor position, rather than one that comes
from just counting character bytes.  How will UTF-8 interpretation
of strings be turned on and off?

If you have anything written up about this, I would appreciate a
pointer.

   Klaus



Information forwarded to debian-bugs-dist@lists.debian.org, Jim Mintha <jmintha@debian.org>:
Bug#62771; Package slang1. (full text, mbox, link).


Acknowledgement sent to Jim Mintha <jim@ic.uva.nl>:
Extra info received and forwarded to list. Copy sent to Jim Mintha <jmintha@debian.org>. (full text, mbox, link).


Message #15 received at submit@bugs.debian.org (full text, mbox, reply):

From: Jim Mintha <jim@ic.uva.nl>
To: Klaus Weide <kweide@enteract.com>, 62771@bugs.debian.org
Cc: submit@bugs.debian.org, davis@space.mit.edu
Subject: Re: Bug#62771: SLsmg_refresh trashes wrong lines
Date: Mon, 1 May 2000 02:18:23 +0200
On Thu, Apr 20, 2000 at 04:38:37PM -0500, Klaus Weide wrote:
> Package: slang1
> Version: 1.3.9-1
> 
> Consider this for demonstration:
> -------------------- snip ------------------------
...

> - Removing the SLsmg_touch_lines() call produces 2a).
> - Applying the patch below also produces 2a).
>   (This actually just reverts to code, with some (proper?) adjustments,
>   that I found in some early pre-1.0 version of slsmg.c.)
> 
> The documentation discourages using SLsmg_touch_lines(), but it is
> useful in Lynx's code when dealing with UTF-8 (or similar multibyte)
> output.  (In the simple example above it's pointless, of course.)

confirmed.  I just took a look at the new version (1.4.1 - I will
upload it soon to woody) and it has almost the same patch (without the
(i, -1) line.  But it seems to work (at least for your test program)

I will close the bug after I upload the new version.

Jim

-- 
Jim Mintha                                       Email: jim@ic.uva.nl
System Administrator                              Work: +31 20 525-4919
Informatiseringscentrum                      	  Home: +31 20 662-3892
University of Amsterdam               Debian GNU/Linux: jmintha@debian.org
_There are always Possibilities_                 http://jim.ultralinux.org


Information forwarded to debian-bugs-dist@lists.debian.org, Jim Mintha <jmintha@debian.org>:
Bug#62771; Package slang1. (full text, mbox, link).


Acknowledgement sent to Jim Mintha <jim@ic.uva.nl>:
Extra info received and forwarded to list. Copy sent to Jim Mintha <jmintha@debian.org>. (full text, mbox, link).


Reply sent to Jim Mintha <jim@ic.uva.nl>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Klaus Weide <kweide@enteract.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #25 received at 62771-done@bugs.debian.org (full text, mbox, reply):

From: Jim Mintha <jim@ic.uva.nl>
To: 62771-done@bugs.debian.org
Subject: Re: SLsmg_refresh trashes wrong lines
Date: Tue, 25 Jul 2000 21:09:08 +0200
fixed in new version


--
Jim Mintha                                       Email: jim@ic.uva.nl
System Administrator                              Work: +31 20 525-4919
Informatiseringscentrum                      	  Home: +31 20 662-3892
University of Amsterdam               Debian GNU/Linux: jmintha@debian.org
_There are always Possibilities_                 http://jim.ultralinux.org



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Mar 29 11:51:30 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.