HomeFreeBSD

sbin/md5.c: fix -q -c for BSD style versions

Description

sbin/md5.c: fix -q -c for BSD style versions

The BSD style commands (with names not ending in "sum") ignored the -c
options and the passed digest value when invoked with -q.

The man page stated that -q causes only the calculated digest to be
printed, but did not consider the case of both the -q and -c being
used in combination.

Since there is no warning that -c will be ignored when the -q option
is used, users night (and did) expect that the exit code would reflect
the matching of the calculated digest and the argument passed with -c.

This update implements and documents this expected behavior.

PR: 265461
Reported by: Dmitrij <bugs.freebsd@1fff.net>
MFC after: 2 weeks

Details

Provenance
seAuthored on Jul 26 2022, 9:04 PM
Parents
rG08604a023dc1: Auto-create bmake/unit-tests objdir if appropriate
Branches
Unknown
Tags
Unknown