Bug 28386

Summary: md5 -p produces 2 lines of numbers
Product: Base System Reporter: Stephen Montgomery-Smith <stephen>
Component: binAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   

Description Stephen Montgomery-Smith 2001-06-24 19:30:01 UTC
md5 -p produces two numbers rather than one number at the end of the output.

Fix: Valentin Nechayev <netch@iv.nn.kiev.ua> came up with this (posting to 
freebsd-stable and freebsd-current).  Since this is copied using cut and
paste from my mail client probably the tabs got messed up, but it is
really easy to apply by hand.

A fix:



This avoids determination of other options, but this does not conflict
directly with man page.

Moreover such exit(0) should be applied not only with -p, but also with
-x, -t and -s: all these options should not gather any input files.
Patch is trivial.--WII4SF1DjZImI9YYTdO50X8Q2hbGMLaxcl3LQFRegBRgkaYX
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- md5.c.orig  Mon Jun  4 00:38:02 2001
+++ md5.c       Sun Jun 24 19:37:13 2001
@@ -65,7 +65,7 @@
                switch (ch) {
                case 'p':
                        MDFilter(1);
-                       break;
+                       exit(0);
                case 'q':
                        qflag = 1;
                        break;
How-To-Repeat: 
md5 -p < any_file
Comment 1 dd freebsd_committer freebsd_triage 2001-06-24 19:35:07 UTC
Responsible Changed
From-To: freebsd-bugs->ru

Ruslan messed around with md5(1)'s argument processing recently.  I don't 
know if that's what broke it, but he should know if this is the right fix.
Comment 2 ru freebsd_committer freebsd_triage 2001-06-25 09:54:54 UTC
State Changed
From-To: open->closed

Fixed, thanks for the report!