commands.cc
/*
** copy_current_file - attempt to copy current file to another
*/
attempt to copy current file to another
attempt to copy current file to another
static void copy_current_file(DirList *dl)
{
    const char *src = get_file_name(dl);
    if (strcmp(src, ".")  == 0 || strcmp(src, "..") == 0)
    {
        message("`copying' of `.' and `..' is not allowed");
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
#ifdef COMPLETION
    const char *dest = prompt("Copy to: ", 1);  
#else
    const char *dest = prompt("Copy to: ");
#endif
    if (dest == 0)
    {
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
    else if (*dest == 0)
    {
        message("not a valid file name");
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
    if (*dest == '~') dest = expand_tilde(dest);
    copy_file(dl, src, dest);
    synch_display();
}
static void copy_current_file ( DirList * dl ) { const char * src = get_file_name ( dl ) ; if ( strcmp ( src , " " ) == 0 || strcmp ( src , " " ) == 0 ) { message ( " " ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } #ifdef COMPLETION const char * dest = prompt ( " " , 1 ) ; #else const char * dest = prompt ( " " ) ; #endif if ( dest == 0 ) { move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } else if ( * dest == 0 ) { message ( " " ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } if ( * dest == ' ' ) dest = expand_tilde ( dest ) ; copy_file ( dl , src , dest ) ; synch_display ( ) ; }
copy_current_file - attempt to copy current file to another
copy_current_file - attempt to copy current file to another
// prompt with completion // command was aborted