Ignore:
Timestamp:
Oct 5, 2023, 2:30:54 PM (7 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
b67b632
Parents:
bf1cbde
Message:

Support match-failure reporting for string input.

On failed match, assign the empty-string value to the target.
Prior handling did not modify the target,
which in context like char s[10]; sin | exclude("\n", s);,
left s uninitialized, and invalid for strlen, when the input's next character is a newline.
In this case, scanf offers the return value, the count of output arguments written,
to say, "I did not write to your buffer," a feature lost in the pipe abstraction.

Add tests to exercise such cases.

(Prior "leave uninitialized" treatment was discovered by surprise, while debugging a test program for an upcoming commit.)

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.