NetBSD-Bugs archive

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

Re: lib/48821: libedit EL_SETTY doesn't work



The following reply was made to PR lib/48821; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
yasuoka%iij.ad.jp@localhost
Cc: 
Subject: Re: lib/48821: libedit EL_SETTY doesn't work
Date: Wed, 21 May 2014 09:08:32 -0400

 On May 21,  9:00am, yasuoka%iij.ad.jp@localhost (YASUOKA Masahiko) wrote:
 -- Subject: Re: lib/48821: libedit EL_SETTY doesn't work
 
 |  The code can be simplified like below:
 |  
 |    tcsetattr(&ts);
 |    // ts = the current setting
 |    // ex = last termios for cooked mode
 |    // ed = last termios for rawmode
 |  
 |    if (ts != ex && ts != ed) {// the settings is changed by a 3rd party
 |       ex = ed = ts;    // adapt the change from the 3rd party
 |       ex |= setbits;   // adapt restriction from SETTY
 |       ex &= ~clrbits;  // same as above
 |       ed |= setbits;   // same as above
 |       ed &= ~clrbits;  // same as above
 |    }
 |    tcsetattr(&ed);     // reflect
 |  
 |  My change was to remove the "if (..." condition.  So the removal of
 |  the condition doesn't alter the behavior of "the changes from vi"
 |  case.
 
 Right, now that I think about it, the change is perhaps just an optimization
 (to execute less code if something did not change). It's been such a long
 time since I wrote the code and so many fingers have touched it.
 
 christos
 


Home | Main Index | Thread Index | Old Index