diff options
Diffstat (limited to 'linenoise')
-rw-r--r-- | linenoise/linenoise.c | 6 | ||||
-rw-r--r-- | linenoise/linenoise.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 01b6b53d..060963c5 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1947,7 +1947,7 @@ static void edit_in_editor(lino_t *l) { int preserve = 0; tr(l->data, '\r', '\n'); - if (lino_os.puts_fn(fo, l->data) && lino_os.puts_fn(fo, L"\n")) + if (lino_os.puts_file_fn(fo, l->data) && lino_os.puts_file_fn(fo, L"\n")) { mem_t *fi; lino_os.close_fn(fo); @@ -2745,8 +2745,8 @@ int lino_hist_save(lino_t *ls, const wchar_t *filename) { } for (j = 0; j < ls->history_len; j++) { - lino_os.puts_fn(fp, ls->history[j]); - lino_os.puts_fn(fp, L"\n"); + lino_os.puts_file_fn(fp, ls->history[j]); + lino_os.puts_file_fn(fp, L"\n"); } lino_os.close_fn(fp); diff --git a/linenoise/linenoise.h b/linenoise/linenoise.h index 3c887a33..b43fb45f 100644 --- a/linenoise/linenoise.h +++ b/linenoise/linenoise.h @@ -68,6 +68,7 @@ typedef struct lino_os { void (*free_fn)(void *); int (*fileno_fn)(mem_t *stream); int (*puts_fn)(mem_t *stream, const wchar_t *str); + int (*puts_file_fn)(mem_t *stream, const wchar_t *str); wint_t (*getch_fn)(mem_t *stream); wchar_t *(*getl_fn)(mem_t *stream, wchar_t *buf, size_t nchar); wchar_t *(*gets_fn)(mem_t *stream, wchar_t *buf, size_t nchar); @@ -80,11 +81,12 @@ typedef struct lino_os { } lino_os_t; #define lino_os_init(alloc, realloc, wmalloc, wrealloc, wstrdup, free, \ - fileno, puts, getch, getl, gets, eof, \ - open, open8, fdopen, close, wide_disp) \ + fileno, puts, puts_file, getch, getl, gets, \ + eof, open, open8, fdopen, close, wide_disp) \ { \ alloc, realloc, wmalloc, wrealloc, wstrdup, free, \ - fileno, puts, getch, getl, gets, eof, open, open8, fdopen, close, \ + fileno, puts, puts_file, getch, getl, gets, eof, \ + open, open8, fdopen, close, \ wide_disp \ } |