efn/c_delete.c

14 lines
280 B
C

void
c_delete(char *c, char **argv) {
Row *line = b_getline(buffer, atoi(c + 2));
Row *prev_line = b_getline(buffer, atoi(c + 2) - 1);
if (line == NULL || prev_line == NULL) {puts ("invalid line"); return; }
prev_line->n = line->n;
line->n->p = prev_line;
free(line);
}