Bill Holler <bill.hol...@sun.com> wrote:

> Hi.
>
> There is a bug in the carlsonj code example.  buf[32] must be buf[34].
> The string "0123456abcdefghijklmnopqrstuvwxyz" is 34 bytes including the '\0'.
> The first strcpy() clobbers some of main()'s stack.
>
> With this error fixed, this example does not produce the bizarre char 
> swapping output.
> Without this buf[34] fix, the example does produce the bizarre char swapping 
> on S10U9.
> My experiment used the SS12 compiler. 
>
> A correct example showing the changed behavior would be very helpful.

I already send the example code that causes the problem......

x1|xterm|vs100|xterm terminal emulator (X Window System):\
        :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:UP=\E[%dA:\
        :al=\E[L:am:\
        :bs:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:co#80:\
        :cs=\E[%i%d;%dr:ct=\E[3k:\
        :dc=\E[P:dl=\E[M:\
        :im=\E[4h:ei=\E[4l:mi:\
        :ho=\E[H:\
        :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
        :rs=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<:\
        :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kb=^H:kd=\EOB:ke=\E[?1l\E>:\
        :kl=\EOD:km:kn#4:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:\
        :li#65:md=\E[1m:me=\E[m:mr=\E[7m:ms:nd=\E[C:pt:\
        :sc=\E7:rc=\E8:sf=\n:so=\E[7m:se=\E[m:sr=\EM:\
        :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:\
        :up=\E[A:us=\E[4m:ue=\E[m:xn:

This text (after it was read by the reader from libxtermcap) causes the problem
with the "AL" capability.

The string backslash newline is completely removed by the reader.
The code from tstrip() gets:

x1|xterm|vs100|xterm terminal emulator (X Window System):       
:AL=\E[%dL:DC=......

and copies str[58] to str[56] and there is a problem after the first %.

The string is allocated as as my libxtermcap/tgetent.c supports long 
capabilties and the related code calls tgetent(NULL, "xterm");

If you like to repeat the problem, fetch

ftp://ftp.berlios.de/pub/schily/schily-2009-12-17.tar.bz2

and call (on SXCE NV 129):

cd psmake
./MAKE-all
cd ..
psmake/smake CCOM=cc
psmake/smake CCOM=cc64

Then install the .termcap file from the archive bsh/dotfiles.tar.bz2
to your home directory. The problem happens with "bsh" and "termcap"

Call e.g. TERM=xterm termcap/OBJ/i386-sunos5-cc64/termcap
and check the parser warnings. Compare with:

TERM=xterm termcap/OBJ/i386-sunos5-cc/termcap

which does not cause problems.

Jörg

-- 
 EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       j...@cs.tu-berlin.de                (uni)  
       joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to