ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
Short: terminal_colour() revisited
From: Christian 'Chameloid' Kirschbaum <chrissy@cs.tu-berlin.de>
Date: Tue, 9 Feb 1999 19:51:47 +0100 (MET)
Type: Bug
State: Fixed.

---------- Forwarded message ----------
Date: Mon, 8 Feb 1999 21:19:40 +0100 (MET)
From: Christian 'Chameloid' Kirschbaum <chrissy@cs.tu-berlin.de>
To: amylaar-users@nightfall.org
Subject: terminal_colour() revisited

Hi Lars et al.,

After a memory problem in terminal_colour() has been found (it left
strings unreferenced), I'd like to point out another dysfunction IMO
of this very recently introduced new efun, that being the indentation
not working properly under certain circumstances.  The syntax of
terminal_colour() is given as


        varargs string terminal_colour( string str, mapping map,
                                        int wrap, int indent )


with 'str' being the string to work on, 'map' being the color-key
mapping, 'wrap' denoting the column to linewrap the string at, and
'indent' denoting the number of blanks with which to indent wrapped
lines.  As long as 'wrap' is smaller or greater than the length of
'str' minus 1, everything works fine:


        terminal_color("foobar bla",([ ]),7,2)
        --
        "foobar\n  bla"

        terminal_color("foobar bla",([ ]),10,2)
        --
        "foobar bla"

        terminal_color("foobar bla",([ ]),12,2)
        --
        "foobar bla"


However, if 'wrap' equals the length of 'str' minus 1, the following
is the outcome:


        terminal_color("foobar bla",([ ]),9,2)
        --
        "foobar\nbla"


As you can see, the one wrapped line does not get indented.  This
behavior seems independent of whatever 'indent' is.  I played a little
more with special characters such as '\n', and the following happens:


        terminal_color("foobar bla\n",([ ]),9,2)
        --
        "foobar\n  bla"


And no problem here although 'wrap' equals the length of 'str' minus 1:


        terminal_color("foobar bla\n",([ ]),10,2)
        --
        "foobar bla\n"


I think this behavior (non-indentation of the one wrapped line when
'wrap' equals the length of 'str' minus 1 and the last character is
not a special character such as '\n') is not desired and should be
fixed, which - I'm sure - is easy to do.


Cheers,
Chris a.k.a. Chameloid@Tubmud.