diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 19 | ||||
-rw-r--r-- | src/nvim/os/wstream.c | 5 | ||||
-rw-r--r-- | src/nvim/os/wstream_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/testdir/Makefile | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_system.in | bin | 137 -> 0 bytes | |||
-rw-r--r-- | src/nvim/testdir/test_system.ok | 3 |
7 files changed, 5 insertions, 29 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 114a6f8a59..b0aa5a4162 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -15148,8 +15148,6 @@ static char_u *save_tv_as_string(typval_T *tv, ssize_t *len) ret = vim_strsave(ret); } else { ret = NULL; - } - if (tv->v_type != VAR_STRING) { *len = -1; } return ret; diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 398d94b606..912dc95aca 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -293,19 +293,15 @@ int os_system(const char *cmd, if (input) { WBuffer *input_buffer = wstream_new_buffer((char *) input, len, 1, NULL); - // we want to be notified when the write completes - job_write_cb(job, system_write_cb); - if (!job_write(job, input_buffer)) { // couldn't write, stop the job and tell the user about it job_stop(job); return -1; } - } else { - // close the input stream, let the process know that no input is coming - job_close_in(job); } + // close the input stream, let the process know that no more input is coming + job_close_in(job); int status = job_wait(job, -1); // prepare the out parameters if requested @@ -353,17 +349,6 @@ static void system_data_cb(RStream *rstream, void *data, bool eof) buf->len += nread; } -static void system_write_cb(WStream *wstream, - void *data, - size_t pending, - int status) -{ - if (pending == 0) { - Job *job = data; - job_close_in(job); - } -} - /// Parses a command string into a sequence of words, taking quotes into /// consideration. /// diff --git a/src/nvim/os/wstream.c b/src/nvim/os/wstream.c index 00a53d1628..eb7de02a2f 100644 --- a/src/nvim/os/wstream.c +++ b/src/nvim/os/wstream.c @@ -208,15 +208,14 @@ static void write_cb(uv_write_t *req, int status) release_wbuffer(data->buffer); - data->wstream->pending_reqs--; - if (data->wstream->cb) { data->wstream->cb(data->wstream, data->wstream->data, - data->wstream->pending_reqs, status); } + data->wstream->pending_reqs--; + if (data->wstream->freed && data->wstream->pending_reqs == 0) { // Last pending write, free the wstream; free(data->wstream); diff --git a/src/nvim/os/wstream_defs.h b/src/nvim/os/wstream_defs.h index e42481f283..cfa0bf0b60 100644 --- a/src/nvim/os/wstream_defs.h +++ b/src/nvim/os/wstream_defs.h @@ -10,11 +10,9 @@ typedef void (*wbuffer_data_finalizer)(void *data); /// /// @param wstream The `WStream` instance /// @param data User-defined data -/// @param pending The number of write requests that are still pending /// @param status 0 on success, anything else indicates failure typedef void (*wstream_cb)(WStream *wstream, void *data, - size_t pending, int status); #endif // NVIM_OS_WSTREAM_DEFS_H diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 26bf35aa94..9f04f880b5 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -35,8 +35,7 @@ SCRIPTS := test_autoformat_join.out \ test_listlbr.out test_listlbr_utf8.out \ test_changelist.out \ test_breakindent.out \ - test_insertcount.out \ - test_systen.in + test_insertcount.out SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test_system.in b/src/nvim/testdir/test_system.in Binary files differdeleted file mode 100644 index 420465ce26..0000000000 --- a/src/nvim/testdir/test_system.in +++ /dev/null diff --git a/src/nvim/testdir/test_system.ok b/src/nvim/testdir/test_system.ok deleted file mode 100644 index aa60536c3b..0000000000 --- a/src/nvim/testdir/test_system.ok +++ /dev/null @@ -1,3 +0,0 @@ - -abcd -['abcd'] |