diff src/ex_docmd.c @ 19069:e14feba578f1 v8.2.0095

patch 8.2.0095: cannot specify exit code for :cquit Commit: https://github.com/vim/vim/commit/1860bde9d31bbb0ba857f6284f6332a7134030dd Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 6 21:47:21 2020 +0100 patch 8.2.0095: cannot specify exit code for :cquit Problem: Cannot specify exit code for :cquit. Solution: Add optional argument. (Thinca, Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5442)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Jan 2020 22:00:06 +0100
parents 847cc7932c42
children af1eca322b9e
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4920,8 +4920,8 @@ ex_quit(exarg_T *eap)
     static void
 ex_cquit(exarg_T *eap UNUSED)
 {
-    getout(1);	// this does not always pass on the exit code to the Manx
-		// compiler. why?
+    // this does not always pass on the exit code to the Manx compiler. why?
+    getout(eap->addr_count > 0 ? (int)eap->line2 : EXIT_FAILURE);
 }
 
 /*