From gnb@itga.com.au  Sun Jan 13 18:32:57 2002
Return-Path: <gnb@itga.com.au>
Received: from ns.itga.com.au (ns.itga.com.au [202.53.40.210])
	by hub.freebsd.org (Postfix) with ESMTP id BFFFB37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Jan 2002 18:32:56 -0800 (PST)
Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20])
	by ns.itga.com.au (8.9.3/8.9.3) with ESMTP id NAA23075
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jan 2002 13:32:55 +1100 (EST)
	(envelope-from gnb@itga.com.au)
Received: from hellcat.itga.com.au (hellcat.itga.com.au [192.168.71.163])
	by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id NAA08121;
	Mon, 14 Jan 2002 13:32:55 +1100 (EST)
Received: (from gnb@localhost)
	by hellcat.itga.com.au (8.11.6/8.11.6) id g0E2Wsc08009;
	Mon, 14 Jan 2002 13:32:54 +1100 (EST)
	(envelope-from gnb)
Message-Id: <200201140232.g0E2Wsc08009@hellcat.itga.com.au>
Date: Mon, 14 Jan 2002 13:32:54 +1100 (EST)
From: Gregory Bond <gnb@itga.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: "fetch -o" gives bogus error message
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         33856
>Category:       bin
>Synopsis:       "fetch -o" gives bogus error message
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 13 18:40:00 PST 2002
>Closed-Date:    Wed Dec 04 02:32:40 PST 2002
>Last-Modified:  Wed Dec 04 02:32:40 PST 2002
>Originator:     Gregory Bond
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
ITG Australia Limited
>Environment:
System: FreeBSD hellcat.itga.com.au 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #41: Fri Jan 4 09:32:06 EST 2002 root@:/usr/obj/usr/src/sys/Hellcat i386


>Description:

A command like
	fetch -o /existing/dir ftp:/non/existent/file
will give the bogus error message
	fetch: /existing/dir/file: Not Found

This is bogus (or at least highly misleading) because it is not
the local file that is not found, but the remote one.

Without the -o file, then it gives a more reasonable message:
	$ fetch ftp://ftp.freeBSD.org/pub/FreeBSD/not-here
	fetch: not-here: Not Found
	$

>How-To-Repeat:

$ fetch -o /tmp ftp://ftp.freeBSD.org/pub/FreeBSD/not-here
fetch: /tmp/not-here: Not Found
$ 

[NB: I'm using an HTTP_PROXY environment variable if that makes any difference.]
>Fix:

Unknown.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: cjc 
Responsible-Changed-When: Mon Jan 14 00:46:23 PST 2002 
Responsible-Changed-Why:  
Over to fetch(1) maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33856 

From: Dan Peterson <danp@danp.net>
To: freebsd-gnats-submit@FreeBSD.org, gnb@itga.com.au
Cc:  
Subject: Re: bin/33856: "fetch -o" gives bogus error message
Date: Sun, 3 Feb 2002 15:08:08 -0700

 This patch fixes the problem for me:
 
 Index: fetch.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/fetch/fetch.c,v
 retrieving revision 1.10.2.17
 diff -u -r1.10.2.17 fetch.c
 --- fetch.c	2001/12/18 09:48:09	1.10.2.17
 +++ fetch.c	2002/02/03 22:05:17
 @@ -359,7 +359,7 @@
  
  	/* start the transfer */
  	if ((f = fetchXGet(url, &us, flags)) == NULL) {
 -		warnx("%s: %s", path, fetchLastErrString);
 +		warnx("%s: %s", URL, fetchLastErrString);
  		goto failure;
  	}
  	if (sigint)
 
 Example:
 
 $ ./fetch -o /tmp ftp://ftp.freebsd.org/pub/FreeBSD/not-here
 fetch: ftp://ftp.freebsd.org/pub/FreeBSD/not-here: File unavailable (e.g., file not found, no access)
 
 -- 
 Dan Peterson <danp@danp.net> http://danp.net

From: Dan Peterson <danp@danp.net>
To: freebsd-gnats-submit@FreeBSD.org, gnb@itga.com.au
Cc:  
Subject: Re: bin/33856: "fetch -o" gives bogus error message
Date: Sun, 3 Feb 2002 15:30:53 -0700

 Ahh, perhaps I was too hasty. fetch likes to tell you the final component of
 a URL had problems. Example:
 
 $ /usr/bin/fetch ftp://ftp.freebsd.org/pub/FreeBSD/not-here
 fetch: not-here: File unavailable (e.g., file not found, no access)
 $ /usr/bin/fetch -o /tmp/foo ftp://ftp.freebsd.org/pub/FreeBSD/not-here
 fetch: /tmp/foo: File unavailable (e.g., file not found, no access)
 
 The final component is the default value for the "path" variable used in
 warnx() if fetchXGet() returns NULL, but it gets set to the full filename of
 the outfile if used with -o. It would be nice if it used the final component
 of the URL in either case but perhaps it's intended behavior that it
 doesn't.
 
 -- 
 Dan Peterson <danp@danp.net> http://danp.net
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Wed Dec 4 02:32:37 PST 2002 
State-Changed-Why:  
MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=33856 
>Unformatted:
