]> granicus.if.org Git - vim/commitdiff
patch 8.0.1454: when in silent mode too much output is buffered v8.0.1454
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Feb 2018 13:46:45 +0000 (14:46 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Feb 2018 13:46:45 +0000 (14:46 +0100)
Problem:    When in silent mode too much output is buffered.
Solution:   Use line buffering instead of fully buffered. (Brian M. Carlson,
            closes #2537)

src/main.c
src/version.c

index 9cf10bd7817924cb7eea7612f025db65f0e8dfc9..aea652b5d32c29b31b1e43547052a7b99143b57b 100644 (file)
@@ -359,6 +359,13 @@ main
      */
     check_tty(&params);
 
+#ifdef _IOLBF
+    /* Ensure output works usefully without a tty: buffer lines instead of
+     * fully buffered. */
+    if (silent_mode)
+       setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
+
     /* This message comes before term inits, but after setting "silent_mode"
      * when the input is not a tty. */
     if (GARGCOUNT > 1 && !silent_mode)
@@ -2532,7 +2539,7 @@ scripterror:
 
 /*
  * Print a warning if stdout is not a terminal.
- * When starting in Ex mode and commands come from a file, set Silent mode.
+ * When starting in Ex mode and commands come from a file, set silent_mode.
  */
     static void
 check_tty(mparm_T *parmp)
index cd994600b6283d06fee4c6da21c9980ef292af1b..57040747f79b743ecaf360c5d69c36ab16418b9a 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1454,
 /**/
     1453,
 /**/