# vile 9.4d - patch 2003/12/20 - T.E.Dickey # ------------------------------------------------------------------------------ # CHANGES | 24 ++++++++- # MANIFEST | 4 - # bind.c | 30 +++++------ # buffer.c | 6 +- # builtflt.c | 17 +++++- # config.guess | 31 +++++++++-- # config.sub | 39 ++++++++++++--- # configure | 4 - # configure.in | 6 +- # display.c | 69 ++++++++++++++++---------- # estruct.h | 8 +-- # filters/filters.c | 4 - # filters/genmake.mak | 4 - # filters/makefile.in | 4 - # filters/pas.key | 82 ++++++++++++++++++++++++++----- # filters/pl-filt.c | 106 +++++++++++++++++++++++++++++------------ # main.c | 41 +++++++++++++++ # makefile.wnt | 25 +++++---- # patchlev.h | 2 # perl.xs | 27 +++++++--- # proto.h | 12 +++- # regexp.c | 96 +++++++++++++++++++++++++++---------- # region.c | 30 +++++------ # revlist | 50 +++++++++---------- # select.c | 4 - # statevar.c | 48 ++++++++++-------- # vile-9.4.spec | 9 ++- # vile-9.4d/filters/pas-filt.l | 77 +++++++++++++++++++++++++++++ # 28 files changed, 629 insertions(+), 230 deletions(-) # ------------------------------------------------------------------------------ # Please remove the following file before applying this patch. # (You can feed this patch to 'sh' to do so.) rm -f filters/pas-filt.c exit Index: CHANGES --- vile-9.4c+/CHANGES 2003-11-04 21:09:55.000000000 -0500 +++ vile-9.4d/CHANGES 2003-12-21 19:16:37.000000000 -0500 @@ -1,9 +1,31 @@ Changes for vile 9.5 (released ??? ??? ?? ????) + 20031220 (d) + > Tom Dickey: + + modify pl-filt.c to handle + sub y { } + i.e., not treat the "y" as the beginning of a pattern. + + modify perl.xs to allow for $VILE_LIBDIR_PATH to be a list of paths. + Only add the corresponding xxx/perl names to @INC if they correspond + to a real directory. + + rewrote pascal syntax filter in lex, adding highlighting for numbers, + and TurboC, Delphi comments. + + improve pascal keywords. + + relax check for dlopen() by assuming that at least RTLD_LAZY is + defined. This works for SunOS 4.1.4. + + add a check in de_extend_lines() for a null wp->w_line.l, recover + by resetting to the buffer-head (report by George Eccles). + + add some more debugging code, calls to valid_buffer(), valid_window() + and new functions valid_line_bp(), valid_line_wp(). + + change minimum/maximum repeat counts for regular expressions from a + byte to an integer (report by George Eccles). + + modify "dist" rule in makefile.wnt to make it set the name of the + zip-file based on the executable. Add a ".map" file to the zip file. + 20031105 (c) > Tom Dickey: + improved check for dlsym to make loadable filters work on Solaris and - IRIX64. + IRIX64 (tested with gcc). + make "--disable-echo" apply to making the loadable filters. + use EXEEXT and OBJEXT in generated makefiles. + corrected parameter to lookup_filter(); it did not account for the Index: MANIFEST --- vile-9.4c+/MANIFEST 2003-11-05 20:45:46.000000000 -0500 +++ vile-9.4d/MANIFEST 2003-12-21 19:25:04.000000000 -0500 @@ -1,4 +1,4 @@ -MANIFEST for vile, version v9_4c +MANIFEST for vile, version v9_4d -------------------------------------------------------------------------------- MANIFEST this file CHANGES Change-log for VILE @@ -240,7 +240,7 @@ filters/mms-filt.l mms syntax filter for vile filters/nr-filt.l nroff syntax highlighting filter for vile filters/nr.key keywords for nroff filter -filters/pas-filt.c Pascal syntax filter for vile +filters/pas-filt.l Pascal syntax filter for vile filters/pas.key keywords for pascal highlighting filter filters/pc.key keywords for printcap syntax highlighting filters/perl.key keywords for perl syntax filter Index: bind.c Prereq: 1.266 --- vile-9.4c+/bind.c 2003-05-04 09:52:55.000000000 -0400 +++ vile-9.4d/bind.c 2003-11-12 19:35:55.000000000 -0500 @@ -3,7 +3,7 @@ * * written 11-feb-86 by Daniel Lawrence * - * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.266 2003/05/04 13:52:55 Mark.Robinson Exp $ + * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.267 2003/11/13 00:35:55 tom Exp $ * */ @@ -1332,13 +1332,13 @@ #endif /* OPT_REBIND || OPT_EVAL */ static char * -locate_fname(char *dirname, char *fname, UINT mode) +locate_fname(char *dir_name, char *fname, UINT mode) { static char fullpath[NFILEN]; /* expanded path */ - if (dirname - && dirname[0] != EOS - && ffaccess(pathcat(fullpath, dirname, fname), mode)) + if (dir_name + && dir_name[0] != EOS + && ffaccess(pathcat(fullpath, dir_name, fname), mode)) return (fullpath); return 0; @@ -1349,11 +1349,11 @@ { const char *cp; char *sp; - char dirname[NFILEN]; + char dir_name[NFILEN]; cp = list; - while ((cp = parse_pathlist(cp, dirname)) != 0) { - if ((sp = locate_fname(dirname, fname, mode)) != 0) + while ((cp = parse_pathlist(cp, dir_name)) != 0) { + if ((sp = locate_fname(dir_name, fname, mode)) != 0) return sp; } return 0; @@ -1469,13 +1469,13 @@ } static void -list_which_fname(char *dirname, char *fname, UINT mode) +list_which_fname(char *dir_name, char *fname, UINT mode) { char fullpath[NFILEN]; /* expanded path */ - if (dirname - && dirname[0] != EOS) { - list_one_fname(SL_TO_BSL(pathcat(fullpath, dirname, fname)), mode); + if (dir_name + && dir_name[0] != EOS) { + list_one_fname(SL_TO_BSL(pathcat(fullpath, dir_name, fname)), mode); } } @@ -1483,11 +1483,11 @@ list_which_file_in_list(char *list, char *fname, UINT mode) { const char *cp; - char dirname[NFILEN]; + char dir_name[NFILEN]; cp = list; - while ((cp = parse_pathlist(cp, dirname)) != 0) { - list_which_fname(dirname, fname, mode); + while ((cp = parse_pathlist(cp, dir_name)) != 0) { + list_which_fname(dir_name, fname, mode); } } Index: buffer.c Prereq: 1.263 --- vile-9.4c+/buffer.c 2003-06-18 18:14:57.000000000 -0400 +++ vile-9.4d/buffer.c 2003-11-11 20:21:25.000000000 -0500 @@ -5,7 +5,7 @@ * keys. Like everyone else, they set hints * for the display system. * - * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.263 2003/06/18 22:14:57 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.264 2003/11/12 01:21:25 tom Exp $ * */ @@ -1015,7 +1015,7 @@ MK = nullmark; #endif - if (curbp) { + if (valid_buffer(curbp)) { /* if we'll have to take over this window, and it's the last */ if ((this_window || bp->b_nwnd == 0) && curbp->b_nwnd != 0 && --(curbp->b_nwnd) == 0) { @@ -1533,7 +1533,7 @@ WINDOW *wp; TRACE((T_CALLED "popupbuff(%s) nwnd=%d\n", bp->b_bname, bp->b_nwnd)); - if (!curbp) { + if (!valid_buffer(curbp)) { curbp = bp; /* possibly at startup time */ curwp->w_bufp = curbp; ++curbp->b_nwnd; Index: builtflt.c Prereq: 1.34 --- vile-9.4c+/builtflt.c 2003-11-03 15:45:31.000000000 -0500 +++ vile-9.4d/builtflt.c 2003-11-12 19:19:58.000000000 -0500 @@ -1,7 +1,7 @@ /* * Main program and I/O for external vile syntax/highlighter programs * - * $Header: /usr/build/vile/vile/RCS/builtflt.c,v 1.34 2003/11/03 20:45:31 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/builtflt.c,v 1.36 2003/11/13 00:19:58 tom Exp $ * */ @@ -51,7 +51,7 @@ *params = 0; - if (curbp != 0 + if (valid_buffer(curbp) && curbp->majr != 0 && !strcmp(curbp->majr->name, major_name) && (temp = b_val_ptr(curbp, VAL_FILTERNAME)) != 0) { @@ -152,6 +152,17 @@ } #ifdef HAVE_LIBDL + +#ifdef RTLD_NOW +#define my_RTLD RTLD_NOW +#else +#ifdef RTLD_LAZY +#define my_RTLD RTLD_LAZY +#else +make an error +#endif +#endif + static int load_filter(const char *name) { @@ -173,7 +184,7 @@ pathcat(filename, filename, leafname); TRACE(("load_filter(%s) %s\n", filename, defining)); ++tried; - if ((obj = dlopen(filename, RTLD_NOW)) != 0) { + if ((obj = dlopen(filename, my_RTLD)) != 0) { found = 1; if ((def = dlsym(obj, defining)) == 0) { dlclose(obj); Index: config.guess --- vile-9.4c+/config.guess 2003-07-12 15:09:50.000000000 -0400 +++ vile-9.4d/config.guess 2003-11-08 15:01:57.000000000 -0500 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-07-02' +timestamp='2003-10-16' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -221,6 +221,9 @@ mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + pegasos:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -307,6 +310,9 @@ *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -734,7 +740,7 @@ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` @@ -742,6 +748,11 @@ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -751,7 +762,7 @@ *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -763,7 +774,7 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using + # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} @@ -799,8 +810,13 @@ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; @@ -948,6 +964,9 @@ LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 @@ -1049,7 +1068,7 @@ exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1164,7 +1183,7 @@ *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) Index: config.sub --- vile-9.4c+/config.sub 2003-07-12 15:10:05.000000000 -0400 +++ vile-9.4d/config.sub 2003-11-08 15:02:14.000000000 -0500 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-07-04' +timestamp='2003-11-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,8 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -228,13 +229,14 @@ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k \ + | ip2k | iq2000 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ @@ -247,6 +249,7 @@ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ @@ -304,7 +307,7 @@ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ + | ip2k-* | iq2000-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ @@ -319,6 +322,7 @@ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ @@ -740,6 +744,10 @@ basic_machine=or32-unknown os=-coff ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -960,6 +968,10 @@ tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1128,13 +1140,13 @@ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ @@ -1164,6 +1176,9 @@ -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1176,6 +1191,9 @@ -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1219,6 +1237,9 @@ -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1467,9 +1488,15 @@ -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; Index: configure --- vile-9.4c+/configure 2003-11-04 21:12:23.000000000 -0500 +++ vile-9.4d/configure 2003-11-12 19:43:32.000000000 -0500 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.202 . +# From configure.in Revision: 1.203 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20030208. # @@ -15543,7 +15543,7 @@ { void *obj; - if ((obj = dlopen("filename", RTLD_NOW)) != 0) { + if ((obj = dlopen("filename", 0)) != 0) { if (dlsym(obj, "symbolname") == 0) { dlclose(obj); } Index: configure.in Prereq: 1.202 --- vile-9.4c+/configure.in 2003-11-04 21:05:25.000000000 -0500 +++ vile-9.4d/configure.in 2003-11-12 18:54:19.000000000 -0500 @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 1.202 $) +AC_REVISION($Revision: 1.203 $) AC_PREREQ(2.13.20020210) rm -f config.cache ### Use "configure -with-screen" to override the default configuration, which is ### termcap-based on unix systems. -dnl $Header: /usr/build/vile/vile/RCS/configure.in,v 1.202 2003/11/05 02:05:25 tom Exp $ +dnl $Header: /usr/build/vile/vile/RCS/configure.in,v 1.203 2003/11/12 23:54:19 tom Exp $ define(MAKELIST, sh $srcdir/filters/makelist.sh $srcdir/filters/genmake.mak) @@ -855,7 +855,7 @@ AC_TRY_LINK([#include ],[ void *obj; - if ((obj = dlopen("filename", RTLD_NOW)) != 0) { + if ((obj = dlopen("filename", 0)) != 0) { if (dlsym(obj, "symbolname") == 0) { dlclose(obj); } Index: display.c Prereq: 1.380 --- vile-9.4c+/display.c 2003-07-27 12:53:03.000000000 -0400 +++ vile-9.4d/display.c 2003-11-12 17:08:56.000000000 -0500 @@ -5,7 +5,7 @@ * functions use hints that are left in the windows by the commands. * * - * $Header: /usr/build/vile/vile/RCS/display.c,v 1.380 2003/07/27 16:53:03 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/display.c,v 1.383 2003/11/12 22:08:56 tom Exp $ * */ @@ -2587,7 +2587,7 @@ static const char * rough_position(WINDOW *wp) { - LINE *lp = wp->w_line.l; + LINEPTR lp = wp->w_line.l; int rows = wp->w_ntrows; const char *msg = 0; @@ -2852,7 +2852,9 @@ if (((int) tb_length(*result) < term.cols) && (right_len = strlen(right_ms)) != 0) { - for (n = term.cols - (int) tb_length(*result) - right_len; n > 0; n--) + for (n = term.cols - (int) tb_length(*result) - right_len; + n > 0; + n--) tb_append(result, lchar); if ((n = term.cols - right_len) < 0) { col = right_len + n; @@ -3036,11 +3038,11 @@ /* if not a requested reframe, check for a needed one */ if ((wp->w_flag & WFFORCE) == 0) { /* initial update in main.c may not set these first... */ - if (wp->w_dot.l == (LINE *) 0) { + if (!valid_line_wp(wp->w_dot.l, wp)) { wp->w_dot.l = lforw(win_head(wp)); wp->w_dot.o = 0; } - if (wp->w_line.l == (LINE *) 0) { + if (!valid_line_wp(wp->w_line.l, wp)) { wp->w_line.l = wp->w_dot.l; wp->w_line.o = 0; } @@ -3222,24 +3224,31 @@ register int i; for_each_visible_window(wp) { - lp = wp->w_line.l; - i = TopRow(wp); - - while (i < mode_row(wp)) { - if (i >= 0 - && (vscreen[i]->v_flag & VFEXT) != 0) { - if ((wp != curwp) - || (lp != wp->w_dot.l) - || ((i != currow) - && (curcol < col_limit(wp)))) { - update_screen_line(wp, lp, i); - vteeol(); - /* this line no longer is extended */ - vscreen[i]->v_flag &= ~VFEXT; + if ((lp = wp->w_line.l) == NULL) { + /* this should not happen */ + mlforce("BUG: lost w_line for %s", wp->w_bufp->b_bname); + lp = win_head(wp); + wp->w_toprow = 0; + } + if (valid_line_wp(lp, wp)) { + i = TopRow(wp); + + while (i < mode_row(wp)) { + if (i >= 0 + && (vscreen[i]->v_flag & VFEXT) != 0) { + if ((wp != curwp) + || (lp != wp->w_dot.l) + || ((i != currow) + && (curcol < col_limit(wp)))) { + update_screen_line(wp, lp, i); + vteeol(); + /* this line no longer is extended */ + vscreen[i]->v_flag &= ~VFEXT; + } } + i += line_height(wp, lp); + lp = lforw(lp); } - i += line_height(wp, lp); - lp = lforw(lp); } } } @@ -3265,14 +3274,22 @@ origrow = ttrow; origcol = ttcol; - if (clhide || !is_visible_window(curwp)) + if (clhide || (valid_window(curwp) && !is_visible_window(curwp))) return TRUE; - if (!curbp || !vscreen || !curwp) /* not initialized */ + + /* + * If not initialized, just return. + */ + if (!valid_buffer(curbp) + || !vscreen + || !valid_window(curwp)) return FALSE; - /* don't try to update if we got called via a read-hook on a window + + /* + * Don't try to update if we got called via a read-hook on a window * that isn't complete. */ - if (curwp->w_bufp == 0 + if (!valid_buffer(curwp->w_bufp) || curwp->w_bufp->b_nwnd == 0 || curwp->w_ntrows < 1) return FALSE; @@ -3581,7 +3598,7 @@ * so save it now */ tb_init(&mlsave, EOS); #if OPT_POPUP_MSGS - if (global_g_val(GMDPOPUP_MSGS) || (curwp == 0)) { + if (global_g_val(GMDPOPUP_MSGS) || !valid_window(curwp)) { TRACE(("mlmsg popup_msgs #1 for '%s'\n", fmt)); popup_msgs(); msg_putc('\n'); Index: estruct.h Prereq: 1.538 --- vile-9.4c+/estruct.h 2003-11-02 19:53:13.000000000 -0500 +++ vile-9.4d/estruct.h 2003-11-11 20:51:14.000000000 -0500 @@ -12,7 +12,7 @@ */ /* - * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.538 2003/11/03 00:53:13 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.539 2003/11/12 01:51:14 tom Exp $ */ #ifndef _estruct_h @@ -2875,8 +2875,10 @@ /* extra checking if we're tracing */ #if !OPT_TRACE -#define valid_buffer(bp) ((bp) != NULL) -#define valid_window(wp) ((wp) != NULL) +#define valid_buffer(bp) ((bp) != NULL) +#define valid_window(wp) ((wp) != NULL) +#define valid_line_bp(lp,bp) ((lp) != NULL) +#define valid_line_wp(lp,wp) ((lp) != NULL) #endif /* Normally defined in "trace.h" */ Index: filters/filters.c Prereq: 1.88 --- vile-9.4c+/filters/filters.c 2003-05-23 20:49:25.000000000 -0400 +++ vile-9.4d/filters/filters.c 2003-11-12 19:34:33.000000000 -0500 @@ -1,7 +1,7 @@ /* * Common utility functions for vile syntax/highlighter programs * - * $Header: /usr/build/vile/vile/filters/RCS/filters.c,v 1.88 2003/05/24 00:49:25 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/filters.c,v 1.89 2003/11/13 00:34:33 tom Exp $ * */ @@ -662,7 +662,7 @@ name = do_alloc(name, strlen(text), &used); for (n = 0; text[n] != 0; n++) { if (isalpha(CharOf(text[n])) && isupper(CharOf(text[n]))) - name[n] = tolower(text[n]); + name[n] = tolower(CharOf(text[n])); else name[n] = text[n]; } Index: filters/genmake.mak Prereq: 1.22 --- vile-9.4c+/filters/genmake.mak 2003-02-09 09:54:10.000000000 -0500 +++ vile-9.4d/filters/genmake.mak 2003-12-12 14:36:19.000000000 -0500 @@ -1,4 +1,4 @@ -# $Header: /usr/build/vile/vile/filters/RCS/genmake.mak,v 1.22 2003/02/09 14:54:10 tom Exp $ +# $Header: /usr/build/vile/vile/filters/RCS/genmake.mak,v 1.23 2003/12/12 19:36:19 tom Exp $ # This is a list of filter root names and whether .c or .l files define the # filter. Except for vile-crypt and vile-manfilt (which do not correspond to # majormodes), the filter names are constructed as vile-{root}-filt. @@ -6,7 +6,6 @@ c c-filt c key key-filt c m4 m4-filt c -pas pas-filt c perl pl-filt c ruby rubyfilt c sed sed-filt c @@ -37,6 +36,7 @@ make makefilt l mms mms-filt l nr nr-filt l +pas pas-filt l pl perlfilt l pot pot-filt l ps ps-filt l Index: filters/makefile.in Prereq: 1.77 --- vile-9.4c+/filters/makefile.in 2003-11-05 19:37:36.000000000 -0500 +++ vile-9.4d/filters/makefile.in 2003-11-11 15:40:35.000000000 -0500 @@ -1,4 +1,4 @@ -# $Header: /usr/build/vile/vile/filters/RCS/makefile.in,v 1.77 2003/11/06 00:37:36 tom Exp $ +# $Header: /usr/build/vile/vile/filters/RCS/makefile.in,v 1.78 2003/11/11 20:40:35 tom Exp $ # #### Start of system configuration section. #### @@ -51,7 +51,7 @@ RM = rm -f QUOTDEFS = -DVILE_STARTUP_PATH=\"@VILE_STARTUP_PATH@\" -CPPFLAGS = -I. -I.. -I$(srcdir) -I$(top_srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ +CPPFLAGS = -I. -I.. -I$(top_srcdir)/filters -I$(top_srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ DESTDIR = BINDIR = $(DESTDIR)$(bindir) Index: filters/pas-filt.l --- /dev/null 2003-09-09 19:35:02.000000000 -0400 +++ vile-9.4d/filters/pas-filt.l 2003-12-12 16:48:31.000000000 -0500 @@ -0,0 +1,77 @@ +%x NORMAL CMT_STANDARD CMT_TURBOC + +%{ +/* + * $Header: /usr/build/vile/vile/filters/RCS/pas-filt.l,v 1.1 2003/12/12 21:48:31 tom Exp $ + * + * Filter to add vile "attribution" sequences to selected bits of Pascal + * input text. A few TurboC and Delphi extensions are recognized: + * #{UNSIGNED} + * //COMMENT + * {COMMENT} + */ + +#include +#include + +DefineFilter("pas"); + +static char *Comment_attr; +static char *Number_attr; +static char *String_attr; + +%} + +HEXADECIMAL \$[0-9a-fA-F_]+ +UNSIGNED [0-9]+ +INTEGER [-+]?{UNSIGNED} +REAL [-+]?(({UNSIGNED}?\.{UNSIGNED})|({UNSIGNED}(\.{UNSIGNED}?)?))([eE]{INTEGER})? +IDENT [a-zA-Z_][a-zA-Z_0-9]* + +CHARACTER "#"{UNSIGNED} +STRING \'([^'\n]|(''))*\' + +NUMBER {HEXADECIMAL}|{INTEGER}|{REAL} + +%% + +{IDENT} { WriteToken(ci_keyword_attr(yytext)); } +{STRING} { WriteToken(String_attr); } +{CHARACTER} | +{NUMBER} { WriteToken(Number_attr); } + +"{" { BeginQuote(CMT_TURBOC, Comment_attr); } +"}" { FinishQuote(NORMAL); } +\n | +. { flt_bfr_append(yytext, yyleng); } + +"(*" { BeginQuote(CMT_STANDARD, Comment_attr); } +"*)" { FinishQuote(NORMAL); } +\n | +. { flt_bfr_append(yytext, yyleng); } + +"//"[^\n]* { WriteToken(Comment_attr); /* Delphi */ } + +. { ECHO; } + +%% + +static void +init_filter(int before GCC_UNUSED) +{ +} + +static void +do_filter(FILE *inputs) +{ + yyin = inputs; + + Comment_attr = class_attr(NAME_COMMENT); + Number_attr = class_attr(NAME_NUMBER); + String_attr = class_attr(NAME_LITERAL); + + begin_state(NORMAL); + while (yylex() > 0) { + } + flt_bfr_error(); +} Index: filters/pas.key Prereq: 1.1 --- vile-9.4c+/filters/pas.key 1998-12-21 18:02:21.000000000 -0500 +++ vile-9.4d/filters/pas.key 2003-12-11 21:09:37.000000000 -0500 @@ -1,14 +1,22 @@ -: $Id: pas.key,v 1.1 1998/12/21 23:02:21 tom Exp $ +: $Id: pas.key,v 1.2 2003/12/12 02:09:37 tom Exp $ +: reserved identifiers goto:C2 and begin case constructor +div do +downto else end +for +forward function if +in +label +mod not of or @@ -17,6 +25,7 @@ record repeat then +to type unit until @@ -24,16 +33,61 @@ while with : -array:Type -boolean:Type -byte:Type -char:Type -const:Type -file:Type -integer:Type -packed:Type -pointer:Type -real:Type -set:Type -var:Type -word:Type +: predefined identifiers +.default Ident2 +abs +arctan +boolean +char +cos +dispose +eof +eoln +exp +false +input +integer +ln +maxint +new +odd +ord +output +pack +page +pred +read +readln +real +reset +rewrite +round +sin +sqr +sqrt +succ +text +true +trunc +write +writeln +: +.default Type +array +boolean +byte +char +const +file +integer +packed +pointer +real +set +var +word +: +.default Number +true +false +nil Index: filters/pl-filt.c Prereq: 1.71 --- vile-9.4c+/filters/pl-filt.c 2003-11-02 17:16:37.000000000 -0500 +++ vile-9.4d/filters/pl-filt.c 2003-12-14 20:42:54.000000000 -0500 @@ -1,5 +1,5 @@ /* - * $Header: /usr/build/vile/vile/filters/RCS/pl-filt.c,v 1.71 2003/11/02 22:16:37 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/pl-filt.c,v 1.72 2003/12/15 01:42:54 tom Exp $ * * Filter to add vile "attribution" sequences to perl scripts. This is a * translation into C of an earlier version written for LEX/FLEX. @@ -38,6 +38,11 @@ ,eIGNORED } States; +typedef struct { + int may_have_pattern; + int has_no_pattern; +} AfterKey; + static char *Action_attr; static char *Comment_attr; static char *Error_attr; @@ -48,6 +53,8 @@ static char *Preproc_attr; static char *Number_attr; +static AfterKey nullKey; + /* * The in-memory copy of the input file. */ @@ -949,26 +956,38 @@ * Check for special cases of keywords after which we may expect a pattern * that does not have to be inside parentheses. */ -static int -check_keyword(char *s, int ok) +static void +check_keyword(char *s, int ok, AfterKey * state) { + state->may_have_pattern = 0; + state->has_no_pattern = 0; + switch (ok) { case 2: - return !strncmp(s, "if", ok); + state->may_have_pattern = !strncmp(s, "if", ok); + break; + case 3: + state->has_no_pattern = !strncmp(s, "sub", ok); + break; case 4: - return !strncmp(s, "grep", ok); + state->may_have_pattern = !strncmp(s, "grep", ok); + break; case 5: - return !strncmp(s, "split", ok) - || !strncmp(s, "until", ok) - || !strncmp(s, "while", ok); + state->may_have_pattern = (!strncmp(s, "split", ok) + || !strncmp(s, "until", ok) + || !strncmp(s, "while", ok)); + break; case 6: - return !strncmp(s, "unless", ok); + state->may_have_pattern = !strncmp(s, "unless", ok); + break; } - return 0; } +/* + * Identifier may be a keyword, or a user identifier. + */ static char * -put_IDENT(char *s, int ok, int *had_op, int *if_wrd) +put_IDENT(char *s, int ok, int *had_op, AfterKey * if_wrd) { char *attr = 0; char save = s[ok]; @@ -978,7 +997,25 @@ attr = keyword_attr(s); s[ok] = save; flt_puts(s, ok, (attr != 0 && *attr != '\0') ? attr : Ident2_attr); - *if_wrd = check_keyword(s, ok); + check_keyword(s, ok, if_wrd); + return s + ok; +} + +/* + * Identifier must be a user identifier. + */ +static char * +put_NOKEYWORD(char *s, int ok, int *had_op, AfterKey * if_wrd) +{ + char *attr = 0; + char save = s[ok]; + + *had_op = 0; + s[ok] = '\0'; + attr = keyword_attr(s); + s[ok] = save; + flt_puts(s, ok, ""); + check_keyword(s, ok, if_wrd); return s + ok; } @@ -1061,23 +1098,23 @@ static unsigned used; static char *line; - unsigned actual = 0; - size_t request = 0; + AfterKey if_old; + AfterKey if_wrd; States state = eCODE; - char *s; char *marker = 0; - unsigned mark_len = 0; + char *s; + int err; + int had_op = 0; + int ignore; int in_line = -1; int in_stmt = 0; int ok; - int err; - int save; - int quoted = 0; int parens = 0; - int had_op = 0; - int if_wrd = 0; - int if_old = 0; - int ignore; + int quoted = 0; + int save; + size_t request = 0; + unsigned actual = 0; + unsigned mark_len = 0; Action_attr = class_attr(NAME_ACTION); Comment_attr = class_attr(NAME_COMMENT); @@ -1113,7 +1150,8 @@ the_last = the_file + the_size; s = the_file; - if_old = if_wrd = 0; + if_old = nullKey; + if_wrd = nullKey; while (MORE(s)) { if (*s == '\n' || s == the_file) { in_line = -1; @@ -1121,7 +1159,7 @@ in_line++; } if_old = if_wrd; - if_wrd = 0; + if_wrd = nullKey; DPRINTF(("(%s(%c) line:%d.%d(%d) if:%d op:%d)\n", stateName(state), *s, in_line, in_stmt, parens, if_wrd, had_op)); switch (state) { @@ -1181,7 +1219,10 @@ flt_puts(s, ok, ""); s += ok; if_wrd = if_old; - } else if ((if_old || had_op || (in_stmt == 1)) && isPattern(*s)) { + } else if ((if_old.may_have_pattern + || had_op + || (in_stmt == 1)) + && isPattern(*s)) { state = ePATTERN; } else if (*s == L_CURLY) { had_op = 1; @@ -1203,11 +1244,16 @@ flt_puts(s, ok, err ? Error_attr : Number_attr); s += ok; } else if ((ok = is_KEYWORD(s)) != 0) { - if ((s != the_file) && (s[-1] == '*')) { - /* typeglob */ + if ((s != the_file) + && (s[-1] == '*')) { /* typeglob */ s = put_IDENT(s, ok, &had_op, &if_wrd); break; } + if ((s != the_file) + && (if_old.has_no_pattern)) { + s = put_NOKEYWORD(s, ok, &had_op, &if_wrd); + break; + } if (is_QUOTE(s, &ignore)) { state = ePATTERN; break; @@ -1224,13 +1270,13 @@ state = eIGNORED; had_op = 0; flt_puts(s, ok, keyword_attr(s)); - if_wrd = check_keyword(s, ok); + check_keyword(s, ok, &if_wrd); s[ok] = save; s += ok; } else if ((ok = is_Option(s)) != 0) { had_op = 0; flt_puts(s, ok, Keyword_attr); - if_wrd = check_keyword(s, ok); + check_keyword(s, ok, &if_wrd); s += ok; } else if ((ok = is_IDENT(s)) != 0) { s = put_IDENT(s, ok, &had_op, &if_wrd); Index: main.c Prereq: 1.511 --- vile-9.4c+/main.c 2003-10-07 21:06:24.000000000 -0400 +++ vile-9.4d/main.c 2003-11-12 16:09:39.000000000 -0500 @@ -22,7 +22,7 @@ */ /* - * $Header: /usr/build/vile/vile/RCS/main.c,v 1.511 2003/10/08 01:06:24 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/main.c,v 1.513 2003/11/12 21:09:39 tom Exp $ */ #define realdef /* Make global definitions not external */ @@ -2801,6 +2801,45 @@ } #endif +#ifndef valid_line_bp +int +valid_line_bp(LINEPTR test, BUFFER *bp) +{ + beginDisplay(); + if (test != NULL) { + int valid = FALSE; + LINEPTR lp; + + if (test == buf_head(bp)) { + valid = TRUE; + } else { + for_each_line(lp, bp) { + if (lp == test) { + valid = TRUE; + break; + } + } + } + if (!valid) + imdying(SIGTERM); + } + endofDisplay(); + + return (test != NULL); +} +#endif + +#ifndef valid_line_wp +int +valid_line_wp(LINEPTR test, WINDOW *wp) +{ + return (test != NULL) + && valid_window(wp) + && valid_buffer(wp->w_bufp) + && valid_line_bp(test, wp->w_bufp); +} +#endif + #ifdef VILE_ERROR_ABORT #undef ExitProgram /* in case it is oleauto_exit() */ Index: makefile.wnt Prereq: 1.76 --- vile-9.4c+/makefile.wnt 2002-10-16 19:34:29.000000000 -0400 +++ vile-9.4d/makefile.wnt 2003-11-08 11:21:47.000000000 -0500 @@ -1,7 +1,7 @@ # # makefile for vile on WIN32 using Microsoft Visual C++ # -# $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.76 2002/10/16 23:34:29 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.77 2003/11/08 16:21:47 tom Exp $ # # !include @@ -123,7 +123,9 @@ CFLAGS = $(CFLAGS) -DPROGRAM_NAME=\"$(PROGNAME)\" !endif -TARGET = $(TARGET).exe +MAPFILE = $(TARGET).map +ZIPFILE = $(TARGET).zip +EXEFILE = $(TARGET).exe !IF "$(OPT)" == "ole-auto" CFLAGS = $(CFLAGS) -DVILE_OLE @@ -230,10 +232,10 @@ .cpp.obj: $(cc) $(CFLAGS) -c $< -Fo$@ -all :: $(PERLCFG) $(TARGET) $(WRAPUTIL) +all :: $(PERLCFG) $(EXEFILE) $(WRAPUTIL) -$(TARGET): $(MYHDRS) $(OBJ) $(MYLIBS) - $(link) $(LDFLAGS) $(OBJ) $(MYLIBS) $(LIBS) -out:$(TARGET) +$(EXEFILE) : $(MYHDRS) $(OBJ) $(MYLIBS) + $(link) $(LDFLAGS) $(OBJ) $(MYLIBS) $(LIBS) -out:$(EXEFILE) -map:$(MAPFILE) winvile.res : winvile.rc winvile.h $(RC) -DVILE_ICON="$(ICON).ico" -Iicons winvile.rc @@ -294,6 +296,7 @@ clean :: -del *.bak -del *.exe + -del *.map -del *.obj -del ne*.h -del $(THE_PERLCFG) @@ -304,14 +307,14 @@ -del *.tlb -del *.res -dist : $(TARGET) - - del $(CFG).zip - echo "$(CFG)", vi-like-emacs for win32 >zipnote.txt - zip $(CFG).zip readme.pc readme $(TARGET) vile.hlp - zip -z $(CFG).zip zipnote.txt + zip $(TARGET).zip readme.pc readme $(EXEFILE) $(MAPFILE) vile.hlp + zip -z $(ZIPFILE) = RR_MIN(next)) + if (min == 0 + || found >= min) return (1); return (0); @@ -1985,8 +2033,8 @@ rpt = OPERAND(scan); break; default: /* RSIMPLE */ - min = RR_MIN(scan); - max = RR_MAX(scan); + min = get_RR_MIN(scan); + max = get_RR_MAX(scan); rpt = scan + RR_LEN; break; } @@ -2477,11 +2525,11 @@ (void) sprintf(STRSKIP(buf), "%s%c", OP(op) == RSIMPLE ? "RSIMPLE" : "RCOMPLX", L_CURL); - if (RR_MIN(op)) - (void) sprintf(STRSKIP(buf), "%d", RR_MIN(op)); + if (get_RR_MIN(op)) + (void) sprintf(STRSKIP(buf), "%d", get_RR_MIN(op)); strcat(buf, ","); - if (RR_MAX(op)) - (void) sprintf(STRSKIP(buf), "%d", RR_MAX(op)); + if (get_RR_MAX(op)) + (void) sprintf(STRSKIP(buf), "%d", get_RR_MAX(op)); (void) sprintf(STRSKIP(buf), "%c", R_CURL); p = NULL; break; Index: region.c Prereq: 1.126 --- vile-9.4c+/region.c 2003-06-17 19:39:48.000000000 -0400 +++ vile-9.4d/region.c 2003-11-11 20:56:30.000000000 -0500 @@ -3,7 +3,7 @@ * and mark. Some functions are commands. Some functions are just for * internal use. * - * $Header: /usr/build/vile/vile/RCS/region.c,v 1.126 2003/06/17 23:39:48 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/region.c,v 1.127 2003/11/12 01:56:30 tom Exp $ * */ @@ -28,7 +28,7 @@ { int c, nc; int changed = 0; - LINE *lp; + LINEPTR lp; int i; lp = DOT.l; @@ -64,7 +64,7 @@ static int do_lines_in_region(int (*linefunc) (REGN_ARGS), void *argp, int convert_cols) { - LINE *linep; + LINEPTR linep; int status; REGION region; C_NUM l, r; @@ -230,7 +230,7 @@ { int s; int save = *(int *) flagp; - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; s = detabline((void *) FALSE, 0, 0); if (s != TRUE) @@ -270,7 +270,7 @@ int len; int s; int saveo = DOT.o; - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; s = detabline((void *) FALSE, 0, 0); if (s != TRUE) @@ -372,7 +372,7 @@ int i; int lim; int s; - LINE *linep = DOT.l; + LINEPTR linep = DOT.l; if (llength(linep) == 0) return TRUE; @@ -427,7 +427,7 @@ int c; int ocol; long leadingonly = (long) flagp; - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; if (llength(lp) == 0) return TRUE; @@ -486,7 +486,7 @@ { int savecol; long leadingonly = (long) flagp; - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; C_NUM ocol, ncol; C_NUM ooff, noff; int ch; @@ -569,7 +569,7 @@ trimline(void *flag GCC_UNUSED, int l GCC_UNUSED, int r GCC_UNUSED) { int off; - LINE *lp; + LINEPTR lp; int odoto, s; int delcnt, was_at_eol; @@ -624,7 +624,7 @@ int len; int s = TRUE; int saveo; - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; saveo = l; @@ -860,8 +860,8 @@ int getregion(REGION * rp) { - LINE *flp; - LINE *blp; + LINEPTR flp; + LINEPTR blp; B_COUNT fsize; B_COUNT bsize; int len_rs = len_record_sep(curbp); @@ -912,7 +912,7 @@ } #if !SMALLER if (b_is_counted(curbp)) { /* we have valid line numbers */ - LINE *flp_start; + LINEPTR flp_start; L_NUM dno, mno; dno = line_no(curbp, DOT.l); mno = line_no(curbp, MK.l); @@ -1081,7 +1081,7 @@ * back to ^A-sequences. */ TBUFF * -encode_attributes(LINE *lp, BUFFER *bp, REGION * top_region) +encode_attributes(LINEPTR lp, BUFFER *bp, REGION * top_region) { TBUFF *result = 0; int j, k, len; @@ -1188,7 +1188,7 @@ static int encode_line(void *flagp GCC_UNUSED, int l GCC_UNUSED, int r GCC_UNUSED) { - LINE *lp = DOT.l; + LINEPTR lp = DOT.l; TBUFF *text; ENCODEREG *work = (ENCODEREG *) flagp; L_NUM this_line = line_no(curbp, lp); Index: revlist --- vile-9.4c+/revlist 2003-11-05 20:45:18.000000000 -0500 +++ vile-9.4d/revlist 2003-12-21 19:19:59.000000000 -0500 @@ -1,6 +1,6 @@ -revlist for vile, version v9_4c +revlist for vile, version v9_4d -------------------------------------------------------------------------------- -CHANGES 1.733 +CHANGES 1.735 CHANGES.R3 1.1 CHANGES.R4 1.1 CHANGES.R5 1.1 @@ -18,28 +18,28 @@ api.c 1.34 api.h 1.12 basic.c 1.119 -bind.c 1.266 +bind.c 1.267 borland.c 1.32 btree.c 1.17 btree.h 1.4 -buffer.c 1.263 +buffer.c 1.264 buglist 1.398 -builtflt.c 1.34 +builtflt.c 1.36 chgdfunc.h 1.16 cmdtbl 1.228 config.emx 1.2 config_h.in 1.2 configure none -configure.in 1.202 +configure.in 1.203 csrch.c 1.31 curses.c 1.20 descrip.mms 1.44 dirstuff.h 1.24 -display.c 1.380 +display.c 1.383 djhandl.c 1.6 dumbterm.c 1.17 edef.h 1.313 -estruct.h 1.538 +estruct.h 1.539 eval.c 1.322 exec.c 1.259 externs.c 1.8 @@ -60,7 +60,7 @@ itbuff.c 1.18 lckfiles.c 1.11 line.c 1.160 -main.c 1.511 +main.c 1.513 makefile.blc 1.17 makefile.djg 1.32 makefile.emx 1.5 @@ -68,7 +68,7 @@ makefile.in 1.189 makefile.tbc 1.24 makefile.wat 1.26 -makefile.wnt 1.76 +makefile.wnt 1.77 map.c 1.97 menu.c 1.43 mkdirs.sh 1.5 @@ -85,21 +85,21 @@ os2keys.h 1.1 os2pipe.c 1.5 os2vio.c 1.29 -patchlev.h 1.307 +patchlev.h 1.308 path.c 1.135 -perl.xs 1.89 -proto.h 1.521 +perl.xs 1.90 +proto.h 1.522 pscreen.h 1.1 ptypemap 1.7 random.c 1.272 -regexp.c 1.107 -region.c 1.126 -revlist v9_4c +regexp.c 1.108 +region.c 1.127 +revlist v9_4d search.c 1.134 -select.c 1.147 +select.c 1.148 sinstall.sh 1.1 spawn.c 1.178 -statevar.c 1.76 +statevar.c 1.77 tags.c 1.120 tbuff.c 1.44 tcap.c 1.152 @@ -110,7 +110,7 @@ ucrypt.c 1.15 undo.c 1.84 version.c 1.55 -vile-9.4.spec 1.4 +vile-9.4.spec 1.5 vile.1 1.30 vile.hlp 1.568 vile.wmconfig 1.1 @@ -192,12 +192,12 @@ filters/fdl-filt.l 1.9 filters/fdl.key 1.4 filters/filterio.c 1.22 -filters/filters.c 1.88 +filters/filters.c 1.89 filters/filters.h 1.81 filters/filters.rc 1.178 filters/fltstack.h 1.8 filters/genmake.c 1.4 -filters/genmake.mak 1.22 +filters/genmake.mak 1.23 filters/html.key 1.6 filters/htmlfilt.l 1.29 filters/imake.key 1.4 @@ -221,7 +221,7 @@ filters/makefile.djg 1.3 filters/makefile.emx 1.4 filters/makefile.icc 1.3 -filters/makefile.in 1.77 +filters/makefile.in 1.78 filters/makefile.wnt 1.30 filters/makefilt.l 1.49 filters/makelist.sh 1.3 @@ -236,12 +236,12 @@ filters/mms-filt.l 1.9 filters/nr-filt.l 1.15 filters/nr.key 1.1 -filters/pas-filt.c 1.15 -filters/pas.key 1.1 +filters/pas-filt.l 1.1 +filters/pas.key 1.2 filters/pc.key 1.1 filters/perl.key 1.8 filters/perlfilt.l 1.39 -filters/pl-filt.c 1.71 +filters/pl-filt.c 1.72 filters/pot-filt.l 1.2 filters/pot.key 1.1 filters/ps-filt.l 1.3 Index: select.c Prereq: 1.147 --- vile-9.4c+/select.c 2003-06-29 20:31:33.000000000 -0400 +++ vile-9.4d/select.c 2003-11-11 20:55:45.000000000 -0500 @@ -18,7 +18,7 @@ * transferring the selection are not dealt with in this file. Procedures * for dealing with the representation are maintained in this file. * - * $Header: /usr/build/vile/vile/RCS/select.c,v 1.147 2003/06/30 00:31:33 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/select.c,v 1.148 2003/11/12 01:55:45 tom Exp $ * */ @@ -1961,7 +1961,7 @@ free_line_attribs(BUFFER *bp) { #if OPT_LINE_ATTRS - LINE *lp; + LINEPTR lp; int do_update = 0; for_each_line(lp, bp) { do_update |= (lp->l_attrs != 0); Index: statevar.c Prereq: 1.76 --- vile-9.4c+/statevar.c 2003-11-03 15:34:05.000000000 -0500 +++ vile-9.4d/statevar.c 2003-11-11 20:26:55.000000000 -0500 @@ -3,7 +3,7 @@ * for getting and setting the values of the vile state variables, * plus helper utility functions. * - * $Header: /usr/build/vile/vile/RCS/statevar.c,v 1.76 2003/11/03 20:34:05 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/statevar.c,v 1.77 2003/11/12 01:26:55 tom Exp $ */ #include "estruct.h" @@ -168,7 +168,7 @@ if (rp) { lgrabtext(rp, type); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { return lrepltext(type, vp, strlen(vp)); } else { return FALSE; @@ -402,7 +402,9 @@ int var_BCHARS(TBUFF ** rp, const char *vp) { - return curbp ? any_ro_INT(rp, vp, curbp->b_bytecount) : FALSE; + return (valid_buffer(curbp) + ? any_ro_INT(rp, vp, curbp->b_bytecount) + : FALSE); } int @@ -422,7 +424,9 @@ int var_BLINES(TBUFF ** rp, const char *vp) { - return curbp ? any_ro_INT(rp, vp, curbp->b_linecount) : FALSE; + return (valid_buffer(curbp) + ? any_ro_INT(rp, vp, curbp->b_linecount) + : FALSE); } #if DISP_NTWIN @@ -476,7 +480,7 @@ tb_scopy(rp, curbp->b_bname); return TRUE; } else if (vp) { - if (curbp) { + if (valid_buffer(curbp)) { set_bname(curbp, vp); curwp->w_flag |= WFMODE; } @@ -489,7 +493,9 @@ int var_BWINDOWS(TBUFF ** rp, const char *vp) { - return curbp ? any_ro_INT(rp, vp, curbp->b_nwnd) : FALSE; + return (valid_buffer(curbp) + ? any_ro_INT(rp, vp, curbp->b_nwnd) + : FALSE); } #if OPT_HOOKS @@ -510,10 +516,12 @@ var_CFNAME(TBUFF ** rp, const char *vp) { if (rp) { - tb_scopy(rp, (curbp && curbp->b_fname) ? curbp->b_fname : ""); + tb_scopy(rp, ((valid_buffer(curbp) && curbp->b_fname) + ? curbp->b_fname + : "")); return TRUE; } else if (vp) { - if (curbp) { + if (valid_buffer(curbp)) { ch_fname(curbp, vp); curwp->w_flag |= WFMODE; } @@ -527,7 +535,7 @@ var_CHAR(TBUFF ** rp, const char *vp) { if (rp) { - if (curbp && !is_empty_buf(curbp)) { + if (valid_buffer(curbp) && !is_empty_buf(curbp)) { if (is_at_end_of_line(DOT)) render_int(rp, '\n'); else @@ -537,9 +545,7 @@ } return TRUE; } else if (vp) { - if (curbp == NULL || b_val(curbp, MDVIEW)) { - return rdonly(); - } else { + if (valid_buffer(curbp) && !b_val(curbp, MDVIEW)) { int s, c; mayneedundo(); (void) ldelete(1L, FALSE); /* delete 1 char */ @@ -550,6 +556,8 @@ s = linsert(1, c); (void) backchar(FALSE, 1); return s; + } else { + return rdonly(); } } else { return FALSE; @@ -583,7 +591,7 @@ if (rp) { render_int(rp, vl_getcchar() + 1); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { return gotochr(TRUE, strtol(vp, 0, 0)); } else { return FALSE; @@ -597,7 +605,7 @@ if (rp) { render_int(rp, getccol(FALSE) + 1); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { return gotocol(TRUE, strtol(vp, 0, 0)); } else { return FALSE; @@ -610,7 +618,7 @@ if (rp) { render_int(rp, getcline()); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { return gotoline(TRUE, strtol(vp, 0, 0)); } else { return FALSE; @@ -638,7 +646,7 @@ if (rp) { render_int(rp, getlinerow()); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { return forwline(TRUE, strtol(vp, 0, 0) - getlinerow()); } else { return FALSE; @@ -948,14 +956,14 @@ int var_LLENGTH(TBUFF ** rp, const char *vp) { - return curbp ? any_ro_INT(rp, vp, llength(DOT.l)) : FALSE; + return valid_buffer(curbp) ? any_ro_INT(rp, vp, llength(DOT.l)) : FALSE; } #if OPT_MAJORMODE int var_MAJORMODE(TBUFF ** rp, const char *vp) { - return any_ro_STR(rp, vp, ((curbp != 0 && curbp->majr != 0) + return any_ro_STR(rp, vp, ((valid_buffer(curbp) && curbp->majr != 0) ? curbp->majr->name : "")); } @@ -1013,7 +1021,7 @@ int var_MODIFIED(TBUFF ** rp, const char *vp) { - return any_ro_BOOL(rp, vp, curbp && b_is_changed(curbp)); + return any_ro_BOOL(rp, vp, valid_buffer(curbp) && b_is_changed(curbp)); } #if OPT_COLOR @@ -1264,7 +1272,7 @@ if (rp) { tb_copy(rp, searchpat); return TRUE; - } else if (vp && curbp) { + } else if (vp && valid_buffer(curbp)) { (void) tb_init(&searchpat, EOS); (void) tb_sappend(&searchpat, vp); beginDisplay(); Index: vile-9.4.spec Prereq: 1.4 --- vile-9.4c+/vile-9.4.spec 2003-11-04 21:10:52.000000000 -0500 +++ vile-9.4d/vile-9.4.spec 2003-11-12 19:42:51.000000000 -0500 @@ -1,7 +1,7 @@ Summary: VILE VI Like Emacs editor -# $Header: /usr/build/vile/vile/RCS/vile-9.4.spec,v 1.4 2003/11/05 02:10:52 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/vile-9.4.spec,v 1.5 2003/11/13 00:42:51 tom Exp $ Name: vile -Version: 9.4c +Version: 9.4d # each patch should update the version Release: 1 Copyright: GPL @@ -11,6 +11,7 @@ Patch1: vile-9.4a.patch.gz Patch2: vile-9.4b.patch.gz Patch3: vile-9.4c.patch.gz +Patch4: vile-9.4d.patch.gz # each patch should add itself to this list Packager: Thomas Dickey BuildRoot: %{_tmppath}/%{name}-root @@ -26,6 +27,7 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 # each patch should add itself to this list %build @@ -73,6 +75,9 @@ %changelog # each patch should add its ChangeLog entries here +* Tue Nov 12 2003 Thomas Dickey +- added patch for 9.4d + * Tue Nov 04 2003 Thomas Dickey - added patch for 9.4c