From babolo@links.ru  Fri Feb  9 15:16:18 2001
Return-Path: <babolo@links.ru>
Received: from aaz.links.ru (aaz.links.ru [193.125.152.37])
	by hub.freebsd.org (Postfix) with ESMTP id 9460737B65D
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Feb 2001 15:16:17 -0800 (PST)
Received: (from babolo@localhost)
	by aaz.links.ru (8.9.3/8.9.3) id CAA13564;
	Sat, 10 Feb 2001 02:16:16 +0300 (MSK)
Message-Id: <200102092316.CAA13564@aaz.links.ru>
Date: Sat, 10 Feb 2001 02:16:16 +0300 (MSK)
From: .@babolo.ru
Reply-To: .@babolo.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: fetch: noice in quiet mode (fix)
X-Send-Pr-Version: 3.2

>Number:         24977
>Category:       bin
>Synopsis:       fetch issues warning in quiet mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 09 15:20:01 PST 2001
>Closed-Date:    Sat Feb 10 08:07:07 PST 2001
>Last-Modified:  Sat Feb 10 08:10:01 PST 2001
>Originator:     Aleksandr A. Babaylov
>Release:        FreeBSD 4.2-STABLE
>Organization:
home
>Environment:
This bug was introduced something beetween 4.2-RELEASE and 2001 Jan 16

>Description:
Example:

0grimble~(9)>fetch -q -o - http://www.rbc.ru/ > /dev/null
fetch: -: size of remote file is not known

This is not desirable in scripts

>How-To-Repeat:
See example above

>Fix:
--- usr.bin/fetch/fetch.c	Wed Dec 27 19:42:09 2000
+++ usr.bin/fetch/fetch.c	Sat Feb 10 01:56:06 2001
@@ -305,8 +305,6 @@
 	goto success;
     }
 
-    if (us.size == -1)
-	warnx("%s: size of remote file is not known", path);
     if (v_level > 1) {
 	if (sb.st_size != -1)
 	    fprintf(stderr, "local size / mtime: %lld / %ld\n",
@@ -314,6 +312,8 @@
 	if (us.size != -1)
 	    fprintf(stderr, "remote size / mtime: %lld / %ld\n",
 		    us.size, us.mtime);
+	else
+	    warnx("%s: size of remote file is not known", path);
     }
     
     /* open output file */


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Sat Feb 10 08:07:07 PST 2001 
State-Changed-Why:  
Not a bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24977 

From: Dag-Erling Smorgrav <des@ofug.org>
To: .@babolo.ru
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/24977: fetch: noice in quiet mode (fix)
Date: 10 Feb 2001 17:06:49 +0100

 .@babolo.ru writes:
 > This bug was introduced something beetween 4.2-RELEASE and 2001 Jan 16
 
 It's not a bug, it's a feature. Not knowing the size of the remote
 file can cause fetch(1) to operate incorrectly in some cases, so the
 user must be made aware that the size is not known.
 
 DES
 -- 
 Dag-Erling Smorgrav - des@ofug.org
 
>Unformatted:
