diff options
author | phk <phk@FreeBSD.org> | 2001-12-19 21:19:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-12-19 21:19:43 +0000 |
commit | 551ea08f0f87088f86af940cfa8a858ab92dddf3 (patch) | |
tree | 842b78d03e12696568035b2773c54dcbacfee786 /sbin/md5 | |
parent | 158bdd6afb54949bab82b2a3d402dbfccd19ac01 (diff) | |
download | FreeBSD-src-551ea08f0f87088f86af940cfa8a858ab92dddf3.zip FreeBSD-src-551ea08f0f87088f86af940cfa8a858ab92dddf3.tar.gz |
Fix
md5 -q -s foo
to not expect input on stdin after hashing the string.
MFC after: 1 week
Diffstat (limited to 'sbin/md5')
-rw-r--r-- | sbin/md5/md5.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index 5e3c9cb..bd8a398 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -39,6 +39,7 @@ static const char rcsid[] = int qflag; int rflag; +int sflag; static void MDString(const char *); static void MDTimeTrial(void); @@ -74,6 +75,7 @@ main(int argc, char *argv[]) rflag = 1; break; case 's': + sflag = 1; MDString(optarg); break; case 't': @@ -101,7 +103,7 @@ main(int argc, char *argv[]) else printf("MD5 (%s) = %s\n", *argv, p); } while (*++argv); - } else if (optind == 1 || qflag || rflag) + } else if (!sflag && (optind == 1 || qflag || rflag)) MDFilter(0); return (0); |