=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.174 retrieving revision 1.175 diff -c -r1.174 -r1.175 *** src/usr.bin/ftp/fetch.c 2019/10/13 15:09:26 1.174 --- src/usr.bin/ftp/fetch.c 2019/10/23 16:47:53 1.175 *************** *** 1,4 **** ! /* $OpenBSD: fetch.c,v 1.174 2019/10/13 15:09:26 jca Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: fetch.c,v 1.175 2019/10/23 16:47:53 deraadt Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- *************** *** 49,54 **** --- 49,55 ---- #include #include #include + #include #include #include #include *************** *** 185,191 **** { char pbuf[NI_MAXSERV], hbuf[NI_MAXHOST], *cp, *portnum, *path, ststr[4]; char *hosttail, *cause = "unknown", *newline, *host, *port, *buf = NULL; ! char *epath, *redirurl, *loctail, *h, *p; int error, i, isftpurl = 0, isfileurl = 0, isredirect = 0, rval = -1; int isunavail = 0, retryafter = -1; struct addrinfo hints, *res0, *res; --- 186,192 ---- { char pbuf[NI_MAXSERV], hbuf[NI_MAXHOST], *cp, *portnum, *path, ststr[4]; char *hosttail, *cause = "unknown", *newline, *host, *port, *buf = NULL; ! char *epath, *redirurl, *loctail, *h, *p, gerror[200]; int error, i, isftpurl = 0, isfileurl = 0, isredirect = 0, rval = -1; int isunavail = 0, retryafter = -1; struct addrinfo hints, *res0, *res; *************** *** 787,793 **** strlcpy(ststr, cp, sizeof(ststr)); status = strtonum(ststr, 200, 503, &errstr); if (errstr) { ! warnx("Error retrieving file: %s", cp); goto cleanup_url_get; } --- 788,795 ---- strlcpy(ststr, cp, sizeof(ststr)); status = strtonum(ststr, 200, 503, &errstr); if (errstr) { ! strnvis(gerror, cp, sizeof gerror, VIS_SAFE); ! warnx("Error retrieving %s: %s", origline, gerror); goto cleanup_url_get; } *************** *** 828,834 **** isunavail = 1; break; default: ! warnx("Error retrieving file: %s", cp); goto cleanup_url_get; } --- 830,837 ---- isunavail = 1; break; default: ! strnvis(gerror, cp, sizeof gerror, VIS_SAFE); ! warnx("Error retrieving %s: %s", origline, gerror); goto cleanup_url_get; } *************** *** 940,946 **** if (isunavail) { if (retried || retryafter != 0) ! warnx("Error retrieving file: 503 Service Unavailable"); else { if (verbose) fprintf(ttyout, "Retrying %s\n", origline); --- 943,950 ---- if (isunavail) { if (retried || retryafter != 0) ! warnx("Error retrieving %s: 503 Service Unavailable", ! origline); else { if (verbose) fprintf(ttyout, "Retrying %s\n", origline);