To: vim-dev@vim.org Subject: Patch 6.2.161 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.161 (extra) Problem: VMS: Missing header file. Reading input busy loops. Solution: Include termdef.h. Avoid the use of a wait function in vms_read(). (Frank Ries) Files: src/os_unix.h, src/os_vms.c *** ../vim-6.2.160/src/os_unix.h Mon Jan 20 21:14:13 2003 --- src/os_unix.h Mon Nov 10 10:53:44 2003 *************** *** 218,223 **** --- 218,224 ---- #include #include #include + #include #include #include #include *** ../vim-6.2.160/src/os_vms.c Wed Oct 29 14:40:27 2003 --- src/os_vms.c Tue Dec 23 14:30:31 2003 *************** *** 53,62 **** static short iochan; /* TTY I/O channel */ static short iosb[4]; /* IO status block */ ! int vms_match_num = 0; ! int vms_match_alloced = 0; ! int vms_match_free = 0; ! char_u **vms_fmatch = NULL; static char *Fspec_Rms; /* rms file spec, passed implicitly between routines */ --- 53,61 ---- static short iochan; /* TTY I/O channel */ static short iosb[4]; /* IO status block */ ! static int vms_match_num = 0; ! static int vms_match_free = 0; ! static char_u **vms_fmatch = NULL; static char *Fspec_Rms; /* rms file spec, passed implicitly between routines */ *************** *** 145,151 **** return; } ! static TT_MODE get_tty(void) { --- 144,150 ---- return; } ! static TT_MODE get_tty(void) { *************** *** 299,322 **** int vms_read(char *inbuf, size_t nbytes) { ! int status, function, len; ! float wait = 0.05; ! TT_MODE tt_mode; /* whatever happened earlier we need an iochan here */ if (!iochan) ! tt_mode = get_tty(); ! function = (IO$_READLBLK | IO$M_NOECHO | IO$M_TIMED | IO$M_ESCAPE); memset(inbuf, 0, nbytes); while (1) { ! status = sys$qiow(0,iochan,function,&iosb,0,0,inbuf,nbytes-1,0,0,0,0); len = strlen(inbuf); if (len > 0) break; - lib$wait(&wait); } return len; } --- 298,327 ---- int vms_read(char *inbuf, size_t nbytes) { ! int status, function, len; ! TT_MODE tt_mode; ! ITEM itmlst[2]; ! static long trm_mask[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* whatever happened earlier we need an iochan here */ if (!iochan) ! tt_mode = get_tty(); ! ! vul_item(&itmlst[0], 0, TRM$_MODIFIERS, ! (char *)(TRM$M_TM_ESCAPE | TRM$M_TM_NOECHO | TRM$M_TM_NOEDIT | ! TRM$M_TM_NOFILTR | TRM$M_TM_NORECALL | TRM$M_TM_TRMNOECHO), 0); ! vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0); ! function = (IO$_READLBLK | IO$M_EXTEND); memset(inbuf, 0, nbytes); while (1) { ! status = sys$qiow(0, iochan, function, &iosb, 0, 0, inbuf, nbytes - 1, ! 0, 0, &itmlst, sizeof(itmlst)); len = strlen(inbuf); if (len > 0) break; } return len; } *************** *** 328,338 **** * Returns: 1 - continue finding matches * 0 - stop trying to find any further mathces */ ! static int vms_wproc(char *name, int val) { int i; int nlen; if (val != DECC$K_FILE) /* Directories and foreing non VMS files are not counting */ return 1; --- 333,344 ---- * Returns: 1 - continue finding matches * 0 - stop trying to find any further mathces */ ! static int vms_wproc(char *name, int val) { int i; int nlen; + static int vms_match_alloced = 0; if (val != DECC$K_FILE) /* Directories and foreing non VMS files are not counting */ return 1; *** ../vim-6.2.160/src/version.c Mon Dec 29 20:32:43 2003 --- src/version.c Mon Dec 29 20:34:56 2003 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 161, /**/ -- From "know your smileys": [:-) Frankenstein's monster /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///