* remove the specified entry from the history list and return it. */
| 1439 | * remove the specified entry from the history list and return it. |
| 1440 | */ |
| 1441 | HIST_ENTRY * |
| 1442 | remove_history(int num) |
| 1443 | { |
| 1444 | HIST_ENTRY *he; |
| 1445 | HistEvent ev; |
| 1446 | |
| 1447 | if (h == NULL || e == NULL) |
| 1448 | rl_initialize(); |
| 1449 | |
| 1450 | if ((he = el_malloc(sizeof(*he))) == NULL) |
| 1451 | return NULL; |
| 1452 | |
| 1453 | if (history(h, &ev, H_DELDATA, num, &he->data) != 0) { |
| 1454 | el_free(he); |
| 1455 | return NULL; |
| 1456 | } |
| 1457 | |
| 1458 | he->line = ev.str; |
| 1459 | if (history(h, &ev, H_GETSIZE) == 0) |
| 1460 | history_length = ev.num; |
| 1461 | |
| 1462 | return he; |
| 1463 | } |
| 1464 | |
| 1465 | |
| 1466 | /* |
nothing calls this directly
no test coverage detected