comparison src/os_unix.c @ 15967:ddd82b1c9e9d v8.1.0989

patch 8.1.0989: various small code ugliness commit https://github.com/vim/vim/commit/bdace838c67c1bd94e55e34270a8325933891466 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 2 10:13:42 2019 +0100 patch 8.1.0989: various small code ugliness Problem: Various small code ugliness. Solution: Remove pointless NULL checks. Fix function calls. Fix typos. (Dominique Pelle, closes #4060)
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 Mar 2019 10:15:06 +0100
parents 907481b9260f
children 78faa25f9698
comparison
equal deleted inserted replaced
15966:04e63da5e0b3 15967:ddd82b1c9e9d
6416 #define STYLE_BT 4 /* `cmd` expansion, execute the pattern 6416 #define STYLE_BT 4 /* `cmd` expansion, execute the pattern
6417 * directly */ 6417 * directly */
6418 int shell_style = STYLE_ECHO; 6418 int shell_style = STYLE_ECHO;
6419 int check_spaces; 6419 int check_spaces;
6420 static int did_find_nul = FALSE; 6420 static int did_find_nul = FALSE;
6421 int ampersent = FALSE; 6421 int ampersand = FALSE;
6422 /* vimglob() function to define for Posix shell */ 6422 /* vimglob() function to define for Posix shell */
6423 static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >"; 6423 static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >";
6424 6424
6425 *num_file = 0; /* default: no files found */ 6425 *num_file = 0; /* default: no files found */
6426 *file = NULL; 6426 *file = NULL;
6533 *p-- = ')'; /* remove last backtick */ 6533 *p-- = ')'; /* remove last backtick */
6534 while (p > command && VIM_ISWHITE(*p)) 6534 while (p > command && VIM_ISWHITE(*p))
6535 --p; 6535 --p;
6536 if (*p == '&') /* remove trailing '&' */ 6536 if (*p == '&') /* remove trailing '&' */
6537 { 6537 {
6538 ampersent = TRUE; 6538 ampersand = TRUE;
6539 *p = ' '; 6539 *p = ' ';
6540 } 6540 }
6541 STRCAT(command, ">"); 6541 STRCAT(command, ">");
6542 } 6542 }
6543 else 6543 else
6602 *p = NUL; 6602 *p = NUL;
6603 #endif 6603 #endif
6604 } 6604 }
6605 if (flags & EW_SILENT) 6605 if (flags & EW_SILENT)
6606 show_shell_mess = FALSE; 6606 show_shell_mess = FALSE;
6607 if (ampersent) 6607 if (ampersand)
6608 STRCAT(command, "&"); /* put the '&' after the redirection */ 6608 STRCAT(command, "&"); /* put the '&' after the redirection */
6609 6609
6610 /* 6610 /*
6611 * Using zsh -G: If a pattern has no matches, it is just deleted from 6611 * Using zsh -G: If a pattern has no matches, it is just deleted from
6612 * the argument list, otherwise zsh gives an error message and doesn't 6612 * the argument list, otherwise zsh gives an error message and doesn't
6628 */ 6628 */
6629 i = call_shell(command, SHELL_EXPAND | SHELL_SILENT); 6629 i = call_shell(command, SHELL_EXPAND | SHELL_SILENT);
6630 6630
6631 /* When running in the background, give it some time to create the temp 6631 /* When running in the background, give it some time to create the temp
6632 * file, but don't wait for it to finish. */ 6632 * file, but don't wait for it to finish. */
6633 if (ampersent) 6633 if (ampersand)
6634 mch_delay(10L, TRUE); 6634 mch_delay(10L, TRUE);
6635 6635
6636 extra_shell_arg = NULL; /* cleanup */ 6636 extra_shell_arg = NULL; /* cleanup */
6637 show_shell_mess = TRUE; 6637 show_shell_mess = TRUE;
6638 vim_free(command); 6638 vim_free(command);