Replace the topmost selection in the stack with a clone of it. */ local sel = selection.clone(sel); */
| 133 | /* Replace the topmost selection in the stack with a clone of it. */ |
| 134 | /* local sel = selection.clone(sel); */ |
| 135 | staticfn int |
| 136 | l_selection_clone(lua_State *L) |
| 137 | { |
| 138 | struct selectionvar *sel = l_selection_check(L, 1); |
| 139 | struct selectionvar *tmp; |
| 140 | |
| 141 | (void) l_selection_new(L); |
| 142 | tmp = l_selection_check(L, 2); |
| 143 | if (tmp->map) |
| 144 | free(tmp->map); |
| 145 | *tmp = *sel; |
| 146 | tmp->map = dupstr(sel->map); |
| 147 | return 1; |
| 148 | } |
| 149 | |
| 150 | DISABLE_WARNING_UNREACHABLE_CODE |
| 151 |
no test coverage detected