md5: Ignore files in string and passthrough mode.

MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43871
This commit is contained in:
Dag-Erling Smørgrav 2024-02-16 13:37:04 +01:00
parent 72ee91fed4
commit 5b44edb405
3 changed files with 5 additions and 1 deletions

View file

@ -129,6 +129,7 @@ option, the calculated digest is printed in addition to the exit status being se
.Pq Note that this option is not yet useful if multiple files are specified.
.It Fl p , -passthrough
Echo stdin to stdout and append the checksum to stdout.
In this mode, any files specified on the command line are silently ignored.
.It Fl q , -quiet
Quiet mode \(em only the checksum is printed out.
Overrides the
@ -146,6 +147,7 @@ options.
.It Fl s Ar string , Fl -string= Ns Ar string
Print a checksum of the given
.Ar string .
In this mode, any files specified on the command line are silently ignored.
.It Fl t , Fl -time-trial
Run a built-in time trial.
For the

View file

@ -606,7 +606,7 @@ main(int argc, char *argv[])
err(1, "Unable to enter capability mode");
#endif
if (*argv) {
if (*argv && !pflag && string == NULL) {
do {
const char *filename = *argv;
const char *filemode = "rb";

View file

@ -204,6 +204,8 @@ bsd_${alg}_vec${i}_body() {
for opt in -q -qr -rq ; do
atf_check -o inline:\"\$out_${i}_${alg}\n\" ${alg} \${opt} in
done
atf_check -o inline:\"\$inp_${i}\$out_${i}_${alg}\n\" ${alg} -p <in
atf_check -o inline:\"\$out_${i}_${alg}\n\" ${alg} -s \"\$inp_${i}\"
}
"
eval "