Bug 27780

Summary: [PATCH] fetch(1): don't divide by zero when fetching an empty file
Product: Base System Reporter: Craig Leres <leres>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me CC: leres
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   
Description Flags
file.diff none

Description Craig Leres freebsd_committer 2001-05-30 23:10:01 UTC
	If you try to grab a zero length file, fetch(1) prints garbage
	for the "percent done."

Fix: The appended context diff checks for zero length size.

*** fetch.c	2001/05/30 21:54:09	1.1
--- fetch.c	2001/05/30 21:54:54
	% fetch http://www-nrg.ee.lbl.gov/leres/a
	Receiving a (0 bytes): -2147483648%
	0 bytes transferred in 0.0 seconds (0.00 Bps)
Comment 1 dd freebsd_committer 2001-06-01 04:59:27 UTC
Responsible Changed
From-To: freebsd-bugs->des

Over to fetch maintainer.
Comment 2 Dag-Erling Smørgrav freebsd_committer 2001-06-01 11:25:36 UTC
State Changed
From-To: open->feedback

Fixed in -CURRENT, awaiting MFC.
Comment 3 Dag-Erling Smørgrav freebsd_committer 2001-06-11 19:06:37 UTC
State Changed
From-To: feedback->closed