]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.451 v7.4.451
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Sep 2014 18:45:23 +0000 (20:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Sep 2014 18:45:23 +0000 (20:45 +0200)
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)

src/eval.c
src/version.c

index 780d8834b032255327a3197c824097116f3e9082..8f62cb2e8312b62f951fccf1aed25cfa610583f2 100644 (file)
@@ -18638,13 +18638,16 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
        }
        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)
index a6a10176df96fdfd0c97a81983434609817a6b78..fa2ced9bc41c5262465d5b4b86f669cf68d3b03a 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    451,
 /**/
     450,
 /**/