* write history to a file given */
| 1363 | * write history to a file given |
| 1364 | */ |
| 1365 | int |
| 1366 | write_history(const char *filename) |
| 1367 | { |
| 1368 | HistEvent ev; |
| 1369 | |
| 1370 | if (h == NULL || e == NULL) |
| 1371 | rl_initialize(); |
| 1372 | if (filename == NULL && (filename = _default_history_file()) == NULL) |
| 1373 | return errno; |
| 1374 | return history(h, &ev, H_SAVE, filename) == -1 ? |
| 1375 | (errno ? errno : EINVAL) : 0; |
| 1376 | } |
| 1377 | |
| 1378 | |
| 1379 | /* |
nothing calls this directly
no test coverage detected