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

(cherry picked from commit 3ce64010f8ce3accc64eff312f31dc0d3c0fc9d1)

Details

Provenance
daniel_octaforge.orgAuthored on Mar 20 2023, 4:42 PM
baptCommitted on May 19 2023, 8:07 AM
Parents
rG34a0d4cbae16: svc_rpcsec_gss.c: Separate out the non-vnet initialization
Branches
Unknown
Tags
Unknown

Event Timeline