| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
for each call separately and update check files to reflect changed
behaviour due to a fix to related calls.
|
|
Regen addstr2.chk after fix for the line-hash bug in libcurses.
Now, all t_curses tests successfully pass on all platforms I have tried.
Thanks blymn@ for kind advice!
|
|
- Reorganize logic to reduce indent levels significantly.
- Use ``for'' rather than ``while''.
|
|
|
|
|
|
|
|
|
|
There's currently no test for that function, therefore no functional
change.
|
|
|
|
No functional change.
|
|
|
|
No functional change.
|
|
|
|
Since all arguments are processed in increasing order, there is no need
to add the redundant argument numbers. Most of the curses functions
have less than 5 arguments, which makes it easy enough to count the ARG
macros.
Changes to curses_commands.c:
* replace ^(\tARG_\w+\()\d(?:, |) with $1
* replace (define ARG_\w+\()i,\s with $1
* replace args\[i\] with *args++
* replace \(i\) with ()
* replace \(void\)0 with args++
The wrong argument count in cmd_mvwget_wch is still detected by
lint.lua, as it was before. There is no test yet that covers this
function.
|
|
|
|
No functional change.
|
|
Non-default values of ESCDELAY may result in unexpected test failures.
|
|
* Added extra testing to the addstr test to demonstrate bug described
in PR#56224 and validate case when scrolling enabled still works.
* Fixed slk test, the slk_init output changed due to corrected wrapping,
slk_restore no longer returns ERR probably due to addwchar no longer
returning ERR when an implicit scroll was attempted when scrolling
disabled. Commented out the slk_wset test, this is now returning ERR
instead of misbehaving, needs investigation.
|
|
|
|
together because they are not really related.
|
|
|
|
* disable blind clearing of /tmp. The comment says this is needed for getwin/putwin
those tests need to be looked at to correct this.
* remove invalid -I option from director arguments for now.
* fix paths to executables so debug_test will work with installed versions by default
the previous version was using the src tree locations but basedir was wrong for that.
|
|
The test 'mvscanw' reported that it would send '%s' as 'numeric', which
was rather suspicious.
|
|
The previous "table" was an insult to any reader. It was unsorted,
listed the functions shuffled, and was not even formatted consistently.
No functional change.
|
|
|
|
were merged...
http://www.nerv.org/netbsd/?q=id:20200620T075016Z.3584036ccf31f69ee76ea4a02e9be30ff081df21
> Fix false positive for mvscanw tests on big endian machines.
>
> When conversion specifier is not a derivative form of "%s", retrieve
> input as 32bit integer, and then convert to string literal. Then we
> can avoid interpretation from ASCII code to integer, which is
> apparently byte-order depended.
|
|
Let's ignore the 2nd result for this case.
|
|
|
|
Just to ensure that addch and addstr behave the same, after the recent
fix for handling '\t'.
|
|
|
|
Writing *(p+1) is needlessly confusing, even though it adds a little
symmetry between *p and *(p+1). Still, one of these expressions has
parentheses, the other doesn't, which breaks the symmetry.
Wrap overly long code line.
It's confusing to refer to the digits after the backslash once with
index 0 to 2, and the other time with index 1 to 3.
|
|
No functional change.
|
|
Just to ensure that the recent fix for '\t' handling in addstr/addch
didn't introduce another bug.
|
|
Before, '\b' was interpreted as a simple 'b', which is confusing for C
programmers. Same for '\a'. There is absolutely no reason to escape
letters, so fail early in these cases.
The '\h' in the test addchstr was obviously a typo that was easy to
detect, if only the compiler had been strict enough from the very
beginning.
The code is wider than 80 characters, same as the code that parses octal
escape sequences a few lines above it. This code will be refactored to
use less indentation in a follow-up commit.
|
|
|
|
These errors are unrelated to errno. The scanf family of functions also
does not set errno.
|
|
Verified by installing all versions of libcurses from 2012 to 2021 and
running a simple test program on them:
#include <stdio.h>
#include <curses.h>
int
main(int argc, char **argv)
{
int xstr, ystr, xch, ych;
initscr();
addstr("\t");
xstr = getcurx(stdscr);
addstr("\n");
ystr = getcury(stdscr);
addch('\t');
xch = getcurx(stdscr);
addch('\n');
ych = getcury(stdscr);
endwin();
fprintf(stderr, "%s\t%d,%d\t%d,%d\n",
argv[1], ystr, xstr, ych, xch);
}
Some selected outputs:
...
2016.11.24.14.49.08 1,0 2,8
2016.11.28.18.25.26 1,8 2,8
...
2019.05.12.02.29.00 1,8 2,8
2019.05.20.22.17.41 1,8 2,16
...
2021.02.13.10.37.00 1,8 2,16
2021.02.13.14.30.37 1,8 2,8
|
|
https://mail-index.netbsd.org/source-changes-d/2021/02/13/msg013199.html
|
|
The previous code only errored out if a write failed completely. If it
was partially written, the program continued without writing the rest of
it.
Extract the common code into a few functions that write raw data to the
parent process.
|
|
|
|
|
|
This provides space to see each capability on its own, instead of having
to search them in the blob of text.
|
|
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.
|
|
Having code indented so far to the right that each word gets its own
line is ridiculous. Fix that.
While here, remove the cargo-cult realloc pattern, which is not needed
if the process exits immediately on error.
While here, reduce the indentation of the code by returning early.
No functional change.
|
|
In case of a short read, processing the incomplete data invoked
undefined behavior.
|
|
The child process needs to be properly controlled by the parent process.
Otherwise it is not possible to get code coverage data from it using
gcov since that requires the child process to exit normally. Previously
the child process had been killed because its parent had exited.
|