tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ftp(1) doesn't glob on ftp://..., patch.



Now
  ftp ftp://ftp.netbsd.org/robots*
doesn't work (FTP_URL_T)

Wheras
  ftp ftp.netbsd.org:/robots*
does (CLASSIC_URL_T)

I don't feel comfortable just doing it because there might be a reason
not to, and I haven't read the RFC or whatever.

Patch works.

Thanks.
Index: fetch.c
===================================================================
RCS file: /cvsroot/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.223
diff -u -r1.223 fetch.c
--- fetch.c	4 Apr 2016 23:59:41 -0000	1.223
+++ fetch.c	28 Jul 2016 17:13:57 -0000
@@ -1899,7 +1899,8 @@
 	    STRorNULL(ui.path), STRorNULL(dir), STRorNULL(file));
 
 	dirhasglob = filehasglob = 0;
-	if (doglob && ui.utype == CLASSIC_URL_T) {
+	if (doglob &&
+	    (ui.utype == CLASSIC_URL_T || ui.utype == FTP_URL_T)) {
 		if (! EMPTYSTRING(dir) && strpbrk(dir, "*?[]{}") != NULL)
 			dirhasglob = 1;
 		if (! EMPTYSTRING(file) && strpbrk(file, "*?[]{}") != NULL)


Home | Main Index | Thread Index | Old Index