History log of /netbsd-src/lib/libcurses/addbytes.c (Results 1 – 25 of 70)
Revision Date Author Comments
# 6348e3f3 23-Dec-2024 blymn <blymn@NetBSD.org>

Sprinkle about some cycle wasting checks for the win pointer being
null. Unfortunately, ncurses does this and there is some sloppy code
out there that relies on the check resulting in segfaults in
N

Sprinkle about some cycle wasting checks for the win pointer being
null. Unfortunately, ncurses does this and there is some sloppy code
out there that relies on the check resulting in segfaults in
NetBSD curses which then, of course, gets blamed for the error.

show more ...


# 95dcd6ac 05-Oct-2023 blymn <blymn@NetBSD.org>

Fix for install/56467

Set x to 0 before calling scroll based on a proposed fix by RVP (thanks!)


# 9c6a0e32 20-Dec-2022 blymn <blymn@NetBSD.org>

Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label i

Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.

show more ...


# 7c304c7f 12-Dec-2022 blymn <blymn@NetBSD.org>

Default the character width to 1 if wcwidth fails.


# b34dd075 07-Nov-2022 blymn <blymn@NetBSD.org>

Count character widths not number of bytes when calculating number
of characters to add. Fixes an error detected by slk tests where
a label containing wide characters was not correctly printed.


# ee6c5161 19-Oct-2022 blymn <blymn@NetBSD.org>

Fixes for lib/56926 amongst other things:
- plod now correctly accounts for wide characters when plodding
- use erase line when in color mode if the terminal has the capability
- ensure that the C

Fixes for lib/56926 amongst other things:
- plod now correctly accounts for wide characters when plodding
- use erase line when in color mode if the terminal has the capability
- ensure that the CA_CONTINUATION flag is applied consistently to the
subsequent characters in a wide character.
- fix a bunch of refresh bugs that caused inconsistent placement of
wide characters.

show more ...


# 7b4e98e7 19-May-2022 blymn <blymn@NetBSD.org>

Set the last change pointer after adding a character at the bottom right
of a window. This fixes the character missing in the LR of a window.
Thanks to uwe@ for pointing this out.


# a7d2c216 03-May-2022 blymn <blymn@NetBSD.org>

* Don't redraw the background if the new background character is the
same as the old one. This prevents excessive redraws in some
applications.

* Fix bug introduced when wbkgrndset was fixed

* Don't redraw the background if the new background character is the
same as the old one. This prevents excessive redraws in some
applications.

* Fix bug introduced when wbkgrndset was fixed, we cannot blindly
replace any instance of the old background character with the new one
because some of those characters were put there by the application
leading to display corruption. So flag characters as background when
they are erased and only update the flagged characters when setting
the background.

show more ...


# 301bf8cc 12-Apr-2022 blymn <blymn@NetBSD.org>

Make the default colour pair be pair 0 which appears to match other
curses implementations.


# f1942931 25-Jan-2022 blymn <blymn@NetBSD.org>

Correct (hopefully) the handling of wide characters.

* Remove the WCOL family of macros, these were "stealing" the upper bits
of a character attribute to store the column width of a character. No

Correct (hopefully) the handling of wide characters.

* Remove the WCOL family of macros, these were "stealing" the upper bits
of a character attribute to store the column width of a character. No
warning was given about this in curses.h which meant it was easy to
accidentally reuse the bits in use by the WCOL macros (we already did).
Add couple of 16bit ints to the character structure iff HAVE_WCHAR is
true to hold the display width and wide char related flags (just
continuation at the moment)
* Convert all instances of WCOL macros to just reference the column width
in the char structure so it is not obfuscated.
* Fix cursor positioning so placing a cursor in the middle of a wide char
actually does just that.
* Fix plod so it understands that if the cursor is going to be positioned
in the middle of a wide char it cannot just reprint the char to get there.
* Fix plodput so it correctly counts the number of output characters for
wide characters.
* Fix slk routines to properly size the wctomb() buffer.

show more ...


# 7af2475f 16-Jan-2022 rillig <rillig@NetBSD.org>

libcurses: remove unreachable statements

Found by lint.

No binary change.


# b09154d5 06-Sep-2021 rin <rin@NetBSD.org>

Style fixes most for __CTRACE().


# e149a100 06-Sep-2021 rin <rin@NetBSD.org>

Unifdef DEBUG for CTRACE().


# 73328adf 22-Jun-2021 blymn <blymn@NetBSD.org>

Rework the fix for lib/56224.
Move the scroll check to _cursesi_addwchar
Perform the scroll check before updating the cursor location when
processing \n.


# 98f6983f 15-Jun-2021 blymn <blymn@NetBSD.org>

Correct a previous fix for PR lib/56224.
Use wdwitch to determine the width of a wide character on the screen not
the number from mbrtowc which is the number of bytes in the character.
Thanks to Mich

Correct a previous fix for PR lib/56224.
Use wdwitch to determine the width of a wide character on the screen not
the number from mbrtowc which is the number of bytes in the character.
Thanks to Michael Forney for spotting this.

show more ...


# 7a398f9f 06-Jun-2021 blymn <blymn@NetBSD.org>

Fix for PR lib/56224
Correct addstr behaviour so it truncates the string in the case where
a string is added on the bottom line of a window where scrolling is
disabled as per the SUSv2 specification.


# 609d11bc 13-Feb-2021 rillig <rillig@NetBSD.org>

libcurses: fix wrong tab width for addch

In sysinst, the installation screen is indented with tabs. Sysinst uses
msgc, which brings its own text layout engine. This engine does not use
addbytes bu

libcurses: fix wrong tab width for addch

In sysinst, the installation screen is indented with tabs. Sysinst uses
msgc, which brings its own text layout engine. This engine does not use
addbytes but addch. In addch, the x position for each tab was advanced
twice as much as needed. The menu items were thus not indented by 8
spaces but by 16, which caused an ugly line break in the German
translation.

This bug largely went unnoticed because most other applications use
addbytes instead, which worked fine all the time. It had been
introduced somewhere between NetBSD 8.0 and NetBSD 9.0.

The code around this bug used aliased variables for win->curx and
win->cury a lot. Getting this right is difficult and needs a thorough
test suite. Even though libcurses has 201 tests, that is not nearly
enough to cover all the relations between the various functions in
libcurses that call each other, crossing API boundaries from internal
to external, doing character conversions on the way and juggling around
4 different types of characters (char, wchar_t, chtype, cchar_t).

The simplest fix was to remove all this aliasing, while keeping the
API the same. If _cursesi_waddbytes is not considered part of the API,
it would be possible to replace px with win->curx in all places, same
for py and win->cury.

The complicated code with the aliasing may have been meant for
performance reasons, but it's hard to see any advantage if both points
of truth need to be synchronized all the time.

Libcurses can be built in 2 modes: with wide character support or
without (-DDISABLE_WCHAR). The test suite only covers the variant with
wide characters. The single-byte variant has to be tested manually.
Running sysinst with the single-byte libcurses produces the correct
layout.

show more ...


# ae30211b 06-Feb-2021 rillig <rillig@NetBSD.org>

libcurses: fix spelling in comment


# 2a780e62 09-Jun-2019 blymn <blymn@NetBSD.org>

Rework previous fix for getch cursor position when cursor is moved
without refresh. If the window is not dirty but the window cursor
position does not match curscr then move the cursor. This fixes

Rework previous fix for getch cursor position when cursor is moved
without refresh. If the window is not dirty but the window cursor
position does not match curscr then move the cursor. This fixes
the issues seen in PR lib/54263.

show more ...


# e2cfd49c 20-May-2019 blymn <blymn@NetBSD.org>

Back out incorrect fix for PR 53617 and fix it in a different way.
Keep track of the cursor location, if getch is called without a refresh
and without pending updates (dirty windows) then move the cu

Back out incorrect fix for PR 53617 and fix it in a different way.
Keep track of the cursor location, if getch is called without a refresh
and without pending updates (dirty windows) then move the cursor to the
correct location directly. Doing this prevents unnecessary refreshes.

show more ...


# 652cdcd2 12-May-2019 blymn <blymn@NetBSD.org>

Fix _cursesi_addwchar so that it performs line wrap. SUSv2 says
add_wch line wraps and updates position. Since wrap is done we are
not past EOL.


# 540f2c17 15-Nov-2018 uwe <uwe@NetBSD.org>

_cursesi_addbyte - fix function comment after what looks like an
editing accident.


# e6a7f880 08-Aug-2018 simonb <simonb@NetBSD.org>

Avoid curx going beyond end of window when adding a wide character to the
last column.

OK @blymn.


# 84fe414e 06-Jan-2017 roy <roy@NetBSD.org>

KNF


# 91804696 06-Jan-2017 roy <roy@NetBSD.org>

KNF


123