tech-userlevel archive

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

Re: namespace pollution by curses



On 2019/03/12 10:11, Brett Lymn wrote:
(sorry for the top post...)

I am happy with either the rename of the static definition or including the state variable in _cursesi_screen which already holds the tty information anyway.  Mind you, if you put the state variable into _cursesi_screen then you may get the situation that someone swtiches screens part way through a multi-character key sequence which will result in a partial escape sequence being delivered to the new screen which is unlikely but undesirable.  If we stick with the static variable then the worst that happens is the assembled key code will be delivered to the new screen.

To be honest, I think the screen switching scenario is so unlikely that putting the variable there would be fine.

My memory is pretty creaky as to why the variable was shared between the narrow and wchar versions of inkey - I am pretty sure it was for reasons of code sharing and to allow both narrow and wide inkey functions to be called interchangably which may be a bit specious...

BTW: Congratulations on nailing this bug, it has been around for years and I did spend many hours chasing around in circles trying to work out why aspell was crashing without success.  Many thanks!

Thank you very much for your kind explanation!

Well, putting state and wstate into __cursesi_screen can result in
inconsistent states. I guess it is serious with stateful encodings
like ISO-2022-JP. Isn't it?

I incline to think it better to rename static variable, which is not
elegant but safest choice. I would like to the original patch if it
is OK for you all.

Thanks,
rin


Home | Main Index | Thread Index | Old Index