Bug 131857 - [patch] devel/libslang2 line drawing characters bug
Summary: [patch] devel/libslang2 line drawing characters bug
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-18 21:50 UTC by szalai.bandi
Modified: 2009-02-21 20:40 UTC (History)
0 users

See Also:


Attachments
src.diff (847 bytes, patch)
2009-02-18 21:50 UTC, szalai.bandi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description szalai.bandi 2009-02-18 21:50:00 UTC
If you execute an application (e.g. mc), which uses devel/libslang2 to
do screen I/O on a non-unicode terminal then the line drawing characters
will appear as spaces.

Fix: I have tracked the problem down to a bug in the slang2 library. In the file
src/sldisply.c there is a function named tt_tgetstr which reads out capability
strings from termcap.

This function calls ncurses' tgetstr which does the real work, however the
buffer for the capability string is a local variable (which will be filled by
tgetstr). But in case of the "ac" capability, tt_tgetstr returns with the
address of this buffer, and therefore it will point to an invalid address.

The attached patch solves this isssue.
How-To-Repeat: 
$ export LANG=en_US.ISO8859-1
$ mc
Comment 1 Edwin Groothuis freebsd_committer 2009-02-18 21:50:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Renato Botelho freebsd_committer 2009-02-19 15:37:26 UTC
S-lang author suggested the following patch, could you test it and let me
know if it's ok?

Thanks

------------------------------------------------------------------------

--- sldisply.c~	2008-08-24 20:14:47.000000000 -0400
+++ sldisply.c	2009-02-19 09:59:08.000000000 -0500
@@ -2233,10 +2233,9 @@
     * this more general.
     */
    /* FIXME: Priority=low; */
-   if (0 == strcmp (cap, "ac"))
-     return s;
+   if (0 != strcmp (cap, "ac"))
+     s = fixup_tgetstr (s);
 
-   s = fixup_tgetstr (s);
 #ifdef USE_TERMCAP
    if ((s >= area_buf) && (s < area_buf + sizeof(area_buf)))
      {

-- 
Renato Botelho <garga @ FreeBSD.org>
               <garga @ freebsdbrasil.com.br>
GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc

If your life was a horse, you'd have to shoot it.
Comment 3 Renato Botelho freebsd_committer 2009-02-20 14:12:03 UTC
State Changed
From-To: open->feedback

Waiting submitter test new patch
Comment 4 szalai.bandi 2009-02-21 10:33:44 UTC
Hi,

On Thu, Feb 19, 2009 at 12:37:26PM -0300, Renato Botelho wrote:

> S-lang author suggested the following patch, could you test it and let me
> know if it's ok?

I have tested the patch and it is working well.

Bye,
andrew
Comment 5 dfilter service freebsd_committer 2009-02-21 20:34:24 UTC
garga       2009-02-21 20:34:13 UTC

  FreeBSD ports repository

  Modified files:
    devel/libslang2      Makefile 
  Added files:
    devel/libslang2/files patch-src__sldisply.c 
  Log:
  - Fix following bug:
  
  If you execute an application (e.g. mc), which uses devel/libslang2 to
  do screen I/O on a non-unicode terminal then the line drawing characters
  will appear as spaces.
  
  PR:             ports/131857
  Submitted by:   Szalai Andras <szalai.bandi@gmail.com>
  Reviewed by:    John E. Davis (author)
  
  Revision  Changes    Path
  1.24      +2 -1      ports/devel/libslang2/Makefile
  1.1       +15 -0     ports/devel/libslang2/files/patch-src__sldisply.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Renato Botelho freebsd_committer 2009-02-21 20:34:33 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!