MCPcopy Create free account
hub / github.com/NetHack/NetHack / l_selection_clone

Function l_selection_clone

src/nhlsel.c:135–148  ·  view source on GitHub ↗

Replace the topmost selection in the stack with a clone of it. */ local sel = selection.clone(sel); */

Source from the content-addressed store, hash-verified

133/* Replace the topmost selection in the stack with a clone of it. */
134/* local sel = selection.clone(sel); */
135staticfn int
136l_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
150DISABLE_WARNING_UNREACHABLE_CODE
151

Callers 6

l_selection_notFunction · 0.85
l_selection_lineFunction · 0.85
l_selection_rectFunction · 0.85
l_selection_fillrectFunction · 0.85
l_selection_randlineFunction · 0.85
l_selection_growFunction · 0.85

Calls 3

l_selection_checkFunction · 0.85
l_selection_newFunction · 0.85
dupstrFunction · 0.85

Tested by

no test coverage detected