To: vim-dev@vim.org Subject: patch 5.4.x8 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.4.x8 (addition to 5.4.45) Files: many *** ../vim-5.4.44/src/os_amiga.c Tue May 18 21:41:36 1999 --- src/os_amiga.c Sun Aug 22 12:17:08 1999 *************** *** 1047,1064 **** */ int mch_call_shell(cmd, options) ! char_u *cmd; ! int options; /* SHELL_FILTER if called by do_filter() */ ! /* SHELL_COOKED if term needs cooked mode */ { ! BPTR mydir; ! int x; #ifdef AZTEC_C ! int use_execute; ! char_u *shellcmd = NULL; ! char_u *shellarg; #endif ! int retval = 0; if (close_win) { --- 1047,1063 ---- */ int mch_call_shell(cmd, options) ! char_u *cmd; ! int options; /* SHELL_*, see vim.h */ { ! BPTR mydir; ! int x; #ifdef AZTEC_C ! int use_execute; ! char_u *shellcmd = NULL; ! char_u *shellarg; #endif ! int retval = 0; if (close_win) { *************** *** 1123,1129 **** { if (x = IoErr()) { ! if (!expand_interactively) { msg_putchar('\n'); msg_outnum((long)x); --- 1122,1128 ---- { if (x = IoErr()) { ! if (!(options & SHELL_SILENT)) { msg_putchar('\n'); msg_outnum((long)x); *************** *** 1133,1139 **** } } #else /* else part is for AZTEC_C */ ! if (p_st >= 4 || (p_st >= 2 && options != SHELL_FILTER)) use_execute = 1; else use_execute = 0; --- 1132,1138 ---- } } #else /* else part is for AZTEC_C */ ! if (p_st >= 4 || (p_st >= 2 && !(options & SHELL_FILTER))) use_execute = 1; else use_execute = 0; *************** *** 1225,1231 **** x = wait(); if (x) { ! if (!expand_interactively) { msg_putchar('\n'); msg_outnum((long)x); --- 1224,1230 ---- x = wait(); if (x) { ! if (!(options & SHELL_SILENT)) { msg_putchar('\n'); msg_outnum((long)x); *************** *** 1302,1308 **** mch_expandpath(gap, pat, flags) struct growarray *gap; char_u *pat; ! int flags; { struct AnchorPath *Anchor; LONG Result; --- 1301,1307 ---- mch_expandpath(gap, pat, flags) struct growarray *gap; char_u *pat; ! int flags; /* EW_* flags */ { struct AnchorPath *Anchor; LONG Result; *** ../vim-5.4.44/src/os_mac.c Sat Jun 5 20:57:46 1999 --- src/os_mac.c Sun Aug 22 12:18:15 1999 *************** *** 25,31 **** mac_expandpath( struct growarray *gap, char_u *path, ! int flags, short start_at, short as_full) { --- 25,31 ---- mac_expandpath( struct growarray *gap, char_u *path, ! int flags, /* EW_* flags */ short start_at, short as_full) { *************** *** 257,263 **** mch_expandpath( struct growarray *gap, char_u *path, ! int flags) { char_u first = *path; --- 257,263 ---- mch_expandpath( struct growarray *gap, char_u *path, ! int flags) /* EW_* flags */ { char_u first = *path; *************** *** 878,886 **** int mch_call_shell(cmd, options) ! char_u *cmd; ! int options; /* SHELL_FILTER if called by do_filter() */ ! /* SHELL_COOKED if term needs cooked mode */ { /* * TODO: find a shell or pseudo-shell to call --- 878,885 ---- int mch_call_shell(cmd, options) ! char_u *cmd; ! int options; /* SHELL_*, see vim.h */ { /* * TODO: find a shell or pseudo-shell to call *** ../vim-5.4.44/src/os_msdos.c Sat Jul 24 15:34:05 1999 --- src/os_msdos.c Sun Aug 22 12:18:49 1999 *************** *** 1664,1687 **** /* * call shell, return FAIL for failure, OK otherwise ! * options == SHELL_FILTER if called by do_filter() ! * options == SHELL_COOKED if term needs cooked mode */ int mch_call_shell( char_u *cmd, int options) { ! int x; #ifndef DJGPP ! char_u *newcmd; #endif out_flush(); if (options & SHELL_COOKED) settmode(TMODE_COOK); /* set to normal mode */ ! set_interrupts(FALSE); /* restore interrupts */ #ifdef DJGPP /* ignore signals while external command is running */ --- 1664,1686 ---- /* * call shell, return FAIL for failure, OK otherwise ! * options: SHELL_*, see vim.h. */ int mch_call_shell( char_u *cmd, int options) { ! int x; #ifndef DJGPP ! char_u *newcmd; #endif out_flush(); if (options & SHELL_COOKED) settmode(TMODE_COOK); /* set to normal mode */ ! set_interrupts(FALSE); /* restore interrupts */ #ifdef DJGPP /* ignore signals while external command is running */ *************** *** 1722,1728 **** settmode(TMODE_RAW); /* set to raw mode */ set_interrupts(TRUE); /* catch interrupts */ ! if (x && !expand_interactively) { msg_putchar('\n'); msg_outnum((long)x); --- 1721,1727 ---- settmode(TMODE_RAW); /* set to raw mode */ set_interrupts(TRUE); /* catch interrupts */ ! if (x && !(options & SHELL_SILENT)) { msg_putchar('\n'); msg_outnum((long)x); *************** *** 1793,1799 **** struct growarray *gap, char_u *path, char_u *wildc, ! int flags) { char_u *buf; char_u *p, *s, *e; --- 1792,1798 ---- struct growarray *gap, char_u *path, char_u *wildc, ! int flags) /* EW_* flags */ { char_u *buf; char_u *p, *s, *e; *************** *** 1834,1840 **** *e = NUL; /* now we have one wildcard component between s and e */ ! /* if the file name ends in "*" and does not contain a ".", addd ".*" */ if (e[-1] == '*' && vim_strchr(s, '.') == NULL) { *e++ = '.'; --- 1833,1839 ---- *e = NUL; /* now we have one wildcard component between s and e */ ! /* if the file name ends in "*" and does not contain a ".", add ".*" */ if (e[-1] == '*' && vim_strchr(s, '.') == NULL) { *e++ = '.'; *************** *** 1890,1896 **** mch_expandpath( struct growarray *gap, char_u *path, ! int flags) { return dos_expandpath(gap, path, path, flags); } --- 1889,1895 ---- mch_expandpath( struct growarray *gap, char_u *path, ! int flags) /* EW_* flags */ { return dos_expandpath(gap, path, path, flags); } *** ../vim-5.4.44/src/os_riscos.c Tue May 11 21:02:59 1999 --- src/os_riscos.c Sun Aug 22 12:19:29 1999 *************** *** 727,736 **** int mch_call_shell(cmd, options) ! char_u *cmd; ! int options;/* SHELL_FILTER if called by do_filter() */ ! /* SHELL_COOKED if term needs cooked mode */ ! /* SHELL_EXPAND if called by mch_expand_wildcards() - NOT USED */ { int retval; --- 727,734 ---- int mch_call_shell(cmd, options) ! char_u *cmd; ! int options; /* SHELL_*, see vim.h */ { int retval; *************** *** 749,755 **** * be doing to allow this to work... */ retval = system(cmd); ! if (retval) EMSG(strerror(EOPSYS)); /* Doesn't seem to set errno? */ swi(OS_Byte, 229, 1, 0); /* Re-disable escape */ --- 747,753 ---- * be doing to allow this to work... */ retval = system(cmd); ! if (retval && !(options & SHELL_SILENT)) EMSG(strerror(EOPSYS)); /* Doesn't seem to set errno? */ swi(OS_Byte, 229, 1, 0); /* Re-disable escape */ *************** *** 783,789 **** mch_expandpath(gap, path, flags) struct growarray *gap; /* Grow array for results. */ char_u *path; ! int flags; /* Add dirs/files/missing objects. */ { int got; /* Number of matches. */ char_u *pattern; --- 781,787 ---- mch_expandpath(gap, path, flags) struct growarray *gap; /* Grow array for results. */ char_u *path; ! int flags; /* EW_* flags */ { int got; /* Number of matches. */ char_u *pattern; *************** *** 981,987 **** char_u **pat; int *num_file; char_u ***file; ! int flags; { /* This doesn't get called unless SPECIAL_WILDCHAR is defined. */ return FAIL; --- 979,985 ---- char_u **pat; int *num_file; char_u ***file; ! int flags; /* EW_* flags */ { /* This doesn't get called unless SPECIAL_WILDCHAR is defined. */ return FAIL; *** ../vim-5.4.44/src/os_vms.c Wed Jul 21 22:51:30 1999 --- src/os_vms.c Sun Aug 22 12:26:31 1999 *************** *** 892,899 **** { if (name == NULL) return FALSE; ! return(vim_strnicmp((char *)name, "xterm", (size_t)5) == 0 || ! STRCMP(name, "builtin_xterm") == 0); } int --- 892,899 ---- { if (name == NULL) return FALSE; ! return (vim_strnicmp((char *)name, "xterm", (size_t)5) == 0 ! || STRCMP(name, "builtin_xterm") == 0); } int *************** *** 901,908 **** { if (name == NULL) return FALSE; ! return(vim_strnicmp((char *)name, "iris-ansi", (size_t)9) == 0 || ! STRCMP(name, "builtin_iris-ansi") == 0); } /* --- 901,908 ---- { if (name == NULL) return FALSE; ! return (vim_strnicmp((char *)name, "iris-ansi", (size_t)9) == 0 ! || STRCMP(name, "builtin_iris-ansi") == 0); } /* *************** *** 916,923 **** return FALSE; if (vim_is_xterm(name) || vim_is_iris_ansi(name)) return TRUE; ! return(vim_strnicmp((char *)name, "hpterm", (size_t)6) == 0 || ! vim_strnicmp((char *)name, "sun-cmd", (size_t)7) == 0); } /* --- 916,923 ---- return FALSE; if (vim_is_xterm(name) || vim_is_iris_ansi(name)) return TRUE; ! return (vim_strnicmp((char *)name, "hpterm", (size_t)6) == 0 ! || vim_strnicmp((char *)name, "sun-cmd", (size_t)7) == 0); } /* *************** *** 1418,1426 **** } /* ! * options SHELL_FILTER if called by do_filter() ! * SHELL_COOKED if term needs cooked mode ! * SHELL_EXPAND if called by mch_expand_wildcards() */ int --- 1418,1424 ---- } /* ! * options: SHELL_*, see vim.h */ int *************** *** 1455,1461 **** x = system((char *)p_sh); if (x == 127) OUT_STR("\nCannot execute shell sh\n"); ! else if (x && !expand_interactively) { msg_putchar('\n'); msg_outnum((long)x); --- 1453,1459 ---- x = system((char *)p_sh); if (x == 127) OUT_STR("\nCannot execute shell sh\n"); ! else if (x && !(options & SHELL_SILENT)) { msg_putchar('\n'); msg_outnum((long)x); *************** *** 1673,1699 **** STRCPY(buf,pat[i]); vms_match_num = 0; /* reset collection counter */ ! cnt = decc$to_vms((char *)buf,vms_wproc,1,0); if (cnt > 0) cnt = vms_match_num; if (cnt < 1) continue; ! for (i = 0; i 0) cnt = vms_match_num; if (cnt < 1) continue; ! for (i = 0; i < cnt; i++) ! { /* files should exist if expanding interactively */ ! if (!(flags & EW_NOTFOUND) && mch_getperm(vms_fmatch[i]) < 0) continue; /* check if this entry should be included */ dir = (mch_isdir(vms_fmatch[i])); if (( dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE))) continue; /* allocate memory for pointers */ ! if (--files_free < 1) ! { files_alloced += EXPL_ALLOC_INC; *file = (char_u **)realloc(*file, sizeof(char_u **) * files_alloced); ! if (*file == NULL) ! { *file = (char_u **)""; *num_file = 0; return(FAIL); *************** *** 1705,1711 **** (*file)[*num_file++] = vms_fmatch[i]; } } ! return(OK); } /* --- 1706,1712 ---- (*file)[*num_file++] = vms_fmatch[i]; } } ! return OK; } /* *** ../vim-5.4.44/src/os_win32.c Sun Aug 22 15:07:48 1999 --- src/os_win32.c Sun Aug 22 12:26:18 1999 *************** *** 2397,2404 **** int mch_call_shell( char_u *cmd, ! int options) /* SHELL_FILTER if called by do_filter() */ ! /* SHELL_COOKED if term needs cooked mode */ { int x; #ifndef USE_GUI_WIN32 --- 2397,2403 ---- int mch_call_shell( char_u *cmd, ! int options) /* SHELL_*, see vim.h */ { int x; #ifndef USE_GUI_WIN32 *************** *** 2528,2538 **** settmode(TMODE_RAW); /* set to raw mode */ #ifdef USE_GUI_WIN32 ! if (x && !expand_interactively && !fUseConsole) ! #else ! if (x && !expand_interactively) #endif { smsg("%d returned", x); msg_putchar('\n'); --- 2527,2537 ---- settmode(TMODE_RAW); /* set to raw mode */ + if (x && !(options & SHELL_SILENT) #ifdef USE_GUI_WIN32 ! && !fUseConsole #endif + ) { smsg("%d returned", x); msg_putchar('\n'); *************** *** 2601,2607 **** struct growarray *gap, char_u *path, char_u *wildc, ! int flags) { char *buf; char *p, *s, *e; --- 2600,2606 ---- struct growarray *gap, char_u *path, char_u *wildc, ! int flags) /* EW_* flags */ { char *buf; char *p, *s, *e; *************** *** 2719,2725 **** mch_expandpath( struct growarray *gap, char_u *path, ! int flags) { return win32_expandpath(gap, path, path, flags); } --- 2718,2724 ---- mch_expandpath( struct growarray *gap, char_u *path, ! int flags) /* EW_* flags */ { return win32_expandpath(gap, path, path, flags); } -- hundred-and-one symptoms of being an internet addict: 186. You overstay in the office so you can have more time surfing the net. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /