[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

incorrect behavior in tparm

From: zreed
Subject: incorrect behavior in tparm
Date: Thu, 16 Jul 2015 16:49:21 -0700


   I've noticed that the ncurses implementation of tparm treat a few of the 
less common operators in ways that don't seem to be correct. In particular:

     * The %O operator is implemented in terms of C's short-circuiting
     || operator (and similarly %A is implemented 
        in terms of &&). As a result the stack is left in differing
        states depending on the inputs. For instance,
        interpreting "%{1}%?%p1%p2%O%t%{0}%+%;%d" with with arguments 0
        and 1 gives the suprising result 
        of "0". The "Termcap and Terminfo" book describes %O as "Pop the
        top two values and push TRUE if either is
        true, FALSE if both are false". 

     * The %l operator outputs the (stringized) value of the length of
     its operand rather than pushing this value 
        onto the stack. Here, the "Termcap and Terminfo" book says: "Pop
        the top of the stack and push the its 
        string length". Seems like there's a word or two missing there,
        but it seems to agree that the length belongs 
        on the stack.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]