Mercurial > vim
comparison src/os_win32.c @ 16734:e3feaa3e5f10 v8.1.1369
patch 8.1.1369: get E484 when using system() during GUI startup
commit https://github.com/vim/vim/commit/294d9bf966bbbcb0b49affb9b15534d5b9c93801
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 23 20:12:46 2019 +0200
patch 8.1.1369: get E484 when using system() during GUI startup
Problem: Get E484 when using system() during GUI startup.
Solution: Check "gui.starting". (Ken Takata)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 May 2019 20:15:05 +0200 |
parents | 7e733046db1d |
children | 8050cde51945 |
comparison
equal
deleted
inserted
replaced
16733:8cd7f9941a04 | 16734:e3feaa3e5f10 |
---|---|
2760 | 2760 |
2761 void | 2761 void |
2762 mch_exit(int r) | 2762 mch_exit(int r) |
2763 { | 2763 { |
2764 #ifdef VIMDLL | 2764 #ifdef VIMDLL |
2765 if (gui.starting || gui.in_use) | 2765 if (gui.in_use || gui.starting) |
2766 mch_exit_g(r); | 2766 mch_exit_g(r); |
2767 else | 2767 else |
2768 mch_exit_c(r); | 2768 mch_exit_c(r); |
2769 #elif defined(FEAT_GUI_MSWIN) | 2769 #elif defined(FEAT_GUI_MSWIN) |
2770 mch_exit_g(r); | 2770 mch_exit_g(r); |
4498 | 4498 |
4499 static int | 4499 static int |
4500 mch_system(char *cmd, int options) | 4500 mch_system(char *cmd, int options) |
4501 { | 4501 { |
4502 #ifdef VIMDLL | 4502 #ifdef VIMDLL |
4503 if (gui.in_use) | 4503 if (gui.in_use || gui.starting) |
4504 return mch_system_g(cmd, options); | 4504 return mch_system_g(cmd, options); |
4505 else | 4505 else |
4506 return mch_system_c(cmd, options); | 4506 return mch_system_c(cmd, options); |
4507 #elif defined(FEAT_GUI_MSWIN) | 4507 #elif defined(FEAT_GUI_MSWIN) |
4508 return mch_system_g(cmd, options); | 4508 return mch_system_g(cmd, options); |
4819 } | 4819 } |
4820 else | 4820 else |
4821 { | 4821 { |
4822 cmdlen = | 4822 cmdlen = |
4823 #ifdef FEAT_GUI_MSWIN | 4823 #ifdef FEAT_GUI_MSWIN |
4824 (gui.in_use ? | 4824 ((gui.in_use || gui.starting) ? |
4825 (!s_dont_use_vimrun && p_stmp ? | 4825 (!s_dont_use_vimrun && p_stmp ? |
4826 STRLEN(vimrun_path) : STRLEN(p_sh) + STRLEN(p_shcf)) | 4826 STRLEN(vimrun_path) : STRLEN(p_sh) + STRLEN(p_shcf)) |
4827 : 0) + | 4827 : 0) + |
4828 #endif | 4828 #endif |
4829 STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10; | 4829 STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10; |
4832 if (newcmd != NULL) | 4832 if (newcmd != NULL) |
4833 { | 4833 { |
4834 #if defined(FEAT_GUI_MSWIN) | 4834 #if defined(FEAT_GUI_MSWIN) |
4835 if ( | 4835 if ( |
4836 # ifdef VIMDLL | 4836 # ifdef VIMDLL |
4837 gui.in_use && | 4837 (gui.in_use || gui.starting) && |
4838 # endif | 4838 # endif |
4839 need_vimrun_warning) | 4839 need_vimrun_warning) |
4840 { | 4840 { |
4841 char *msg = _("VIMRUN.EXE not found in your $PATH.\n" | 4841 char *msg = _("VIMRUN.EXE not found in your $PATH.\n" |
4842 "External commands will not pause after completion.\n" | 4842 "External commands will not pause after completion.\n" |
4851 vim_free(wtitle); | 4851 vim_free(wtitle); |
4852 need_vimrun_warning = FALSE; | 4852 need_vimrun_warning = FALSE; |
4853 } | 4853 } |
4854 if ( | 4854 if ( |
4855 # ifdef VIMDLL | 4855 # ifdef VIMDLL |
4856 gui.in_use && | 4856 (gui.in_use || gui.starting) && |
4857 # endif | 4857 # endif |
4858 !s_dont_use_vimrun && p_stmp) | 4858 !s_dont_use_vimrun && p_stmp) |
4859 /* Use vimrun to execute the command. It opens a console | 4859 /* Use vimrun to execute the command. It opens a console |
4860 * window, which can be closed without killing Vim. */ | 4860 * window, which can be closed without killing Vim. */ |
4861 vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s", | 4861 vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s", |
4863 (msg_silent != 0 || (options & SHELL_DOOUT)) | 4863 (msg_silent != 0 || (options & SHELL_DOOUT)) |
4864 ? "-s " : "", | 4864 ? "-s " : "", |
4865 p_sh, p_shcf, cmd); | 4865 p_sh, p_shcf, cmd); |
4866 else | 4866 else |
4867 # ifdef VIMDLL | 4867 # ifdef VIMDLL |
4868 if (gui.in_use) | 4868 if (gui.in_use || gui.starting) |
4869 # endif | 4869 # endif |
4870 vim_snprintf((char *)newcmd, cmdlen, "%s %s %s %s %s", | 4870 vim_snprintf((char *)newcmd, cmdlen, "%s %s %s %s %s", |
4871 p_sh, p_shcf, p_sh, p_shcf, cmd); | 4871 p_sh, p_shcf, p_sh, p_shcf, cmd); |
4872 # ifdef VIMDLL | 4872 # ifdef VIMDLL |
4873 else | 4873 else |
4887 settmode(TMODE_RAW); /* set to raw mode */ | 4887 settmode(TMODE_RAW); /* set to raw mode */ |
4888 | 4888 |
4889 /* Print the return value, unless "vimrun" was used. */ | 4889 /* Print the return value, unless "vimrun" was used. */ |
4890 if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent | 4890 if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent |
4891 #if defined(FEAT_GUI_MSWIN) | 4891 #if defined(FEAT_GUI_MSWIN) |
4892 && (gui.in_use ? | 4892 && ((gui.in_use || gui.starting) ? |
4893 ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp) : 1) | 4893 ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp) : 1) |
4894 #endif | 4894 #endif |
4895 ) | 4895 ) |
4896 { | 4896 { |
4897 smsg(_("shell returned %d"), x); | 4897 smsg(_("shell returned %d"), x); |