Ticket #30: mc-4.7.0-pre2-editcmd_xclip.patch

File mc-4.7.0-pre2-editcmd_xclip.patch, 1.3 KB (added by uchti, 15 years ago)

editcmd.c xclip patch for 4.7.0-pre2

  • edit/editcmd.c

    old new  
    18051805 
    18061806int edit_copy_to_X_buf_cmd (WEdit * edit) 
    18071807{ 
    1808     long start_mark, end_mark; 
     1808        long start_mark, end_mark; 
    18091809    if (eval_marks (edit, &start_mark, &end_mark)) 
    18101810        return 0; 
    18111811    if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) { 
     
    18131813        return 1; 
    18141814    } 
    18151815    edit_mark_cmd (edit, 1); 
     1816    char *tmp,*res; 
     1817    res = concat_dir_and_file (home_dir, EDIT_CLIP_FILE); 
     1818    tmp = g_strconcat ("xclip -i ",res," -selection clipboard", NULL ); 
     1819    system (tmp); 
     1820    g_free(res); 
     1821    g_free(tmp); 
    18161822    return 0; 
    18171823} 
    18181824 
    18191825int edit_cut_to_X_buf_cmd (WEdit * edit) 
    18201826{ 
    1821     long start_mark, end_mark; 
     1827        long start_mark, end_mark; 
    18221828    if (eval_marks (edit, &start_mark, &end_mark)) 
    18231829        return 0; 
    18241830    if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) { 
     
    18271833    } 
    18281834    edit_block_delete_cmd (edit); 
    18291835    edit_mark_cmd (edit, 1); 
     1836    char *tmp, *res; 
     1837    res = concat_dir_and_file (home_dir, EDIT_CLIP_FILE); 
     1838    tmp = g_strconcat ("xclip -i ",res," -selection clipboard", NULL ); 
     1839    system (tmp); 
     1840    g_free(res); 
     1841    g_free(tmp); 
    18301842    return 0; 
    18311843} 
    18321844