Menu

#2 ls *, mget *, pwd and ls

open
nobody
None
5
2014-07-24
2007-07-03
Anonymous
No

I think its a error with wild card processing. This bug is present in 4.0 and upwards.

ls is not appending "\r\n" while listing.

pwd is not identified.

Discussion

  • Erakis

    Erakis - 2014-07-24

    I've notice the same problem while reformatting the code. As is it code here it cannot work, albeit I did not test it.

    Here is what you have to do to correct the problem. Create a temp variable, copy the file path to it, append the \r\n and add this variable to the list buffer.

    if( pClient->CurrentTransfer.nCmd ==  CMD_NLST ) {
    
        CHAR szFileNameWithCRLF[MAX_PATH + 1] = {0};
        sprintf(szFileNameWithCRLF, MAX_PATH, _T("%s\r\n"), fi->pszName);
    
        if( szFileNameWithCRLF[0] != '.' || pTransfer->opt_a ) {
            if( !pClient->AddToListBuffer( pTransfer, szFileNameWithCRLF, strlen(szFileNameWithCRLF), pBuffer, &nBufferPos, uiBufferSize ) )
                break;
        }
    
     
  • js107

    js107 - 2018-02-20
    Post awaiting moderation.

Log in to post a comment.