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



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