Mercurial > vim
changeset 6232:ac6cfdc02695 v7.4.451
updated for version 7.4.451
Problem: Calling system() with empty input gives an error for writing the
temp file.
Solution: Do not try writing if the string length is zero. (Olaf Dabrunz)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 19 Sep 2014 20:45:23 +0200 |
parents | 30f1a0f7d71c |
children | 54b031246e22 |
files | src/eval.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -18638,13 +18638,16 @@ get_cmd_output_as_rettv(argvars, rettv, } else { + size_t len; + p = get_tv_string_buf_chk(&argvars[1], buf); if (p == NULL) { fclose(fd); goto errret; /* type error; errmsg already given */ } - if (fwrite(p, STRLEN(p), 1, fd) != 1) + len = STRLEN(p); + if (len > 0 && fwrite(p, len, 1, fd) != 1) err = TRUE; } if (fclose(fd) != 0)