Re: [Fwd: Bug#408579: lftp: option [-p port] ignored if a path is specified]

"Alexander V. Lukyanov" <[email protected]> Mon, 26 Feb 2007 18:06:41 +0300
Newsgroups gmane.network.lftp.devel
Message-ID <20070226150641.GA23392__49390.3234870688$1172504604$gmane$org@night.netis.ru>
> > Depending on the specification of a path ("/" is considered as a path)
> > or not, the option [-p port] can be ignored.

This patch should fix the problem.

Index: commands.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/commands.cc,v
retrieving revision 1.261.2.1
diff -u -p -r1.261.2.1 commands.cc
--- commands.cc	14 Dec 2006 09:29:06 -0000	1.261.2.1
+++ commands.cc	26 Feb 2007 15:05:32 -0000
@@ -909,10 +909,17 @@ Job *CmdExec::builtin_open()
 	    delete url;
 	    url=new ParsedURL(u);
 	 }
-	 if(user)
+	 if(user || port)
 	 {
 	    url->user=user;
 	    url->pass=pass;
+	    if(user)
+	    {
+	       url->user=user;
+	       url->pass=pass;
+	    }
+	    if(port)
+	       url->port=port;
 	    char *host1=url->Combine();
 	    delete url;
 	    url=new ParsedURL(host1);

-- 
   Alexander.