HomeFreeBSD

sh(1): fix history file write checking

Description

sh(1): fix history file write checking

We cannot just compare histsizeval() against 0, since that returns
a string pointer, which is always non-zero (non-null). The logic
in sethistsize() initializes the history size to 100 with values
that are non-number, and an empty string counts as that. Therefore,
the only time we want to not write into history with HISTSIZE val
set is when it's explicitly 0.

MFC after: 2 weeks

Details

Provenance
daniel_octaforge.orgAuthored on Mar 20 2023, 4:42 PM
baptCommitted on Mar 20 2023, 4:56 PM
Parents
rGa6719858a480: pf tests: try to trigger locking issues in pfsync_timeout()
Branches
Unknown
Tags
Unknown