simplify
This commit is contained in:
@@ -483,24 +483,20 @@ void ScreenPackages::EnterURL( const CString & sURL )
|
|||||||
else
|
else
|
||||||
m_bIsPackage = false;
|
m_bIsPackage = false;
|
||||||
|
|
||||||
int k=0,j=0;
|
m_sBaseAddress = "http://" + Server;
|
||||||
while( k >= 0 )
|
if( Port != 80 )
|
||||||
|
m_sBaseAddress += ssprintf( ":%d", Port );
|
||||||
|
m_sBaseAddress += "/";
|
||||||
|
|
||||||
|
if( sAddress.Right(1) != "/" )
|
||||||
{
|
{
|
||||||
j = k+1;
|
m_sEndName = Basename( sAddress );
|
||||||
k = sAddress.Find( '/', j );
|
m_sBaseAddress += Dirname( sAddress );
|
||||||
}
|
}
|
||||||
|
|
||||||
//If there is no '/' in the address, ignore it all
|
|
||||||
//for base address.
|
|
||||||
if( sAddress.Find( '/', 0 ) < 0 )
|
|
||||||
j = 0;
|
|
||||||
|
|
||||||
m_sEndName = sAddress.Right( sAddress.length() - j + 1 );
|
|
||||||
|
|
||||||
if( Port == 80 )
|
|
||||||
m_sBaseAddress = "http://" + Server + "/" + CString(sAddress.substr(0, j));
|
|
||||||
else
|
else
|
||||||
m_sBaseAddress = "http://" + Server + ssprintf( ":%d/", Port ) + CString(sAddress.substr(0, j));
|
{
|
||||||
|
m_sEndName = "";
|
||||||
|
}
|
||||||
|
|
||||||
//Open the file...
|
//Open the file...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user