implementation of yank_file_name and yank_file_path
This commit is contained in:
@@ -23,6 +23,7 @@ extern unsigned int terminal_width;
|
||||
|
||||
extern unsigned int status;
|
||||
extern char *start_path;
|
||||
extern char *global_path;
|
||||
extern char *input;
|
||||
|
||||
extern time_t seed;
|
||||
@@ -349,8 +350,26 @@ void order_by(unsigned long passes, int index){
|
||||
void cmd_on_selected(unsigned long passes, int index){
|
||||
TODO;
|
||||
}
|
||||
void yank_text(unsigned long passes, int index){
|
||||
TODO;
|
||||
void yank_file_name(){
|
||||
char *cmd = parse_cmd(clipboard_cmd, mid_dir.current_file);
|
||||
system(cmd);
|
||||
free(cmd);
|
||||
status |= (STATUS_RUN_BACKEND);
|
||||
}
|
||||
void yank_file_path(){
|
||||
file *tmp = malloc(sizeof(file));
|
||||
tmp->file_name = malloc(strlen(global_path)+1+strlen(mid_dir.current_file->file_name)+1);
|
||||
memcpy(tmp->file_name, global_path, strlen(global_path));
|
||||
memcpy(tmp->file_name+strlen(global_path)+1, mid_dir.current_file->file_name, strlen(mid_dir.current_file->file_name)+1);
|
||||
tmp->file_name[strlen(global_path)] = '/'; /*no +1 is needed*/
|
||||
char *cmd = parse_cmd(clipboard_cmd, tmp);
|
||||
system(cmd);
|
||||
free(cmd);
|
||||
free(tmp->file_name);
|
||||
free(tmp);
|
||||
status |= (STATUS_RUN_BACKEND);
|
||||
|
||||
|
||||
}
|
||||
void yank_file(unsigned long passes, int index){
|
||||
TODO;
|
||||
|
||||
Reference in New Issue
Block a user