| Summary: | "fetch -o" gives bogus error message | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Gregory Bond <gnb> |
| Component: | bin | Assignee: | Dag-Erling Smørgrav <des> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.5-PRERELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Gregory Bond
2002-01-14 02:40:00 UTC
Responsible Changed From-To: freebsd-bugs->des Over to fetch(1) maintainer. 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
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 MFCed. |