/* Clones selection. Count specifies number of copies of each file or directory * to create (one by default). */ static void cmd_C(key_info_t key_info, keys_info_t *keys_info) { int save_msg; check_marking(view, 0, NULL); save_msg = fops_clone(view, NULL, 0, 0, def_count(key_info.count)); accept_and_leave(save_msg); }
TEST(cloning_of_broken_symlink, IF(not_windows)) { /* symlink() is not available on Windows, but the rest of the code is fine. */ #ifndef _WIN32 assert_success(symlink("no-such-file", SANDBOX_PATH "/broken-link")); #endif flist_load_tree(&lwin, SANDBOX_PATH); /* Without specifying new name. */ lwin.dir_entry[0].marked = 1; (void)fops_clone(&lwin, NULL, 0, 0, 1); assert_success(unlink(SANDBOX_PATH "/broken-link(1)")); assert_success(unlink(SANDBOX_PATH "/broken-link")); }