commands.cc
/*
** rename_current_file - attempt to rename the current file
*/
attempt to rename the current file
attempt to rename the current file
static void rename_current_file(DirList *dl)
{
    const char *from_file = get_file_name(dl);
    if (strcmp(from_file, ".")  == 0 || strcmp(from_file, "..") == 0)
    {
        message("`renaming' of `.' and `..' is not allowed");
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
    const char *to_file = prompt("Rename to: ");
    if (to_file == 0)
    {
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
    else if (*to_file == 0)
    {
        message("not a valid file name");
        move_cursor(dl->savedYPos(), dl->savedXPos());
        synch_display();
        return;
    }
    if (*to_file == '~') to_file = expand_tilde(to_file);
    rename_file(dl, from_file, to_file);
    synch_display();
}
static void rename_current_file ( DirList * dl ) { const char * from_file = get_file_name ( dl ) ; if ( strcmp ( from_file , " " ) == 0 || strcmp ( from_file , " " ) == 0 ) { message ( " " ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } const char * to_file = prompt ( " " ) ; if ( to_file == 0 ) { move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } else if ( * to_file == 0 ) { message ( " " ) ; move_cursor ( dl -> savedYPos ( ) , dl -> savedXPos ( ) ) ; synch_display ( ) ; return ; } if ( * to_file == ' ' ) to_file = expand_tilde ( to_file ) ; rename_file ( dl , from_file , to_file ) ; synch_display ( ) ; }
rename_current_file - attempt to rename the current file
rename_current_file - attempt to rename the current file