To: vim_dev@googlegroups.com Subject: Patch 8.0.1617 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1617 (after 8.0.1616) Problem: Win32: :shell command in the GUI crashes. Solution: Handle the situation that "cmd" is NULL. (Yasuhiro Matsumoto, closes #2721) Files: src/os_win32.c *** ../vim-8.0.1616/src/os_win32.c 2018-03-18 19:29:27.727188043 +0100 --- src/os_win32.c 2018-03-19 21:39:47.674274538 +0100 *************** *** 4800,4814 **** aco_save_T aco; oparg_T oa; /* operator arguments */ ! cmdlen = STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10; ! newcmd = lalloc(cmdlen, TRUE); if (newcmd == NULL) return 255; ! vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", p_sh, p_shcf, cmd); init_job_options(&opt); - ch_log(NULL, "starting terminal for system command '%s'", cmd); argvar[0].v_type = VAR_STRING; argvar[0].vval.v_string = newcmd; --- 4800,4824 ---- aco_save_T aco; oparg_T oa; /* operator arguments */ ! if (cmd == NULL) ! cmdlen = STRLEN(p_sh) + 1; ! else ! cmdlen = STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10; newcmd = lalloc(cmdlen, TRUE); if (newcmd == NULL) return 255; ! if (cmd == NULL) ! { ! STRCPY(newcmd, p_sh); ! ch_log(NULL, "starting terminal to run a shell"); ! } ! else ! { ! vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", p_sh, p_shcf, cmd); ! ch_log(NULL, "starting terminal for system command '%s'", cmd); ! } init_job_options(&opt); argvar[0].v_type = VAR_STRING; argvar[0].vval.v_string = newcmd; *** ../vim-8.0.1616/src/version.c 2018-03-18 19:29:27.731188020 +0100 --- src/version.c 2018-03-19 21:42:04.521439666 +0100 *************** *** 768,769 **** --- 768,771 ---- { /* Add new patch number below this line */ + /**/ + 1617, /**/ -- The startling truth finally became apparent, and it was this: Numbers written on restaurant checks within the confines of restaurants do not follow the same mathematical laws as numbers written on any other pieces of paper in any other parts of the Universe. This single statement took the scientific world by storm. So many mathematical conferences got held in such good restaurants that many of the finest minds of a generation died of obesity and heart failure, and the science of mathematics was put back by years. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///