Unlike ':ts' and ':tW', the effects of ':U' are visible even after the
modifiers from the nested expression have been applied. These subtle
details, like many others, are not documented in the manual page.
As a preparation for refactoring the code around variable expressions,
there need to be a few tests for indirect variable modifiers since these
were not covered before.
Indirect modifiers may include ':ts' and ':tW', which change the
interpretation of the variable expression in small details. The scope
of these changes is limited to the indirect modifier, any evaluations
outside this indirect modifier are unaffected.
The changes to the .exp file are mostly line number changes, plus a
demonstration of a newly found bug, where an expression is evaluated
successfully despite producing a parse error.
The plan is to have only the "current value" of the expression as a
member, not the "new value". To do this consistently and get the memory
management right, there must be a single place (or two) where the value
of the expression is updated.
No functional change.
The type name ApplyModifiersState was only intended as a working draft,
its name is too long and its scope a little too narrow.
Applying the modifiers is the main part of evaluating a variable
expression, and the scope of that type will be extended to parsing the
name of the expression as well. This will hopefully reduce the number
of parameters, which is currently at 14.
No functional change.
Combining the assignment operator ':=' with the variable modifier ':U'
on the same variable does not work as intended. At the point where the
':U' is evaluated, the variable is guaranteed to be defined because the
code in VarAssign_EvalSubst says so.
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.
the loop in pmap_page_remove() always removes the first pv,
and since the list is managed by _pmap_remove_pv(), pp->pp_pv.pv_next always points to the first.
partition) round the new size up to current alignment.
This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.
Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.
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.
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.
The test mvwin previously expected an endless stream of bytes, by
comparing the actual output with /dev/zero. This didn't make sense as
the curses output does not contain '\0' in any of the test cases.
Compare with /dev/null instead. This is as wrong as before, but the
curses test framework currently ignores this situation, as for many
other test cases. See the numerous "Excess" messages in atf-run.log.
All include commands in the current test suite use relative paths.
Instead of a fixed include path, interpret the included filename
relative to the including file.
The parent process, like the child process, needs only 2 of the 4 pipe
ends.
In verbose mode (now at testlang_parse.y:1151 and :1154), both ends of the
pipe_from_slave were examined. This looked like a typo and has been fixed
to those pipe ends that are relevant to the parent process.