81c2858
To: vim-dev@vim.org
81c2858
Subject: Patch 7.2.167
81c2858
Fcc: outbox
81c2858
From: Bram Moolenaar <Bram@moolenaar.net>
81c2858
Mime-Version: 1.0
81c2858
Content-Type: text/plain; charset=UTF-8
81c2858
Content-Transfer-Encoding: 8bit
81c2858
------------
81c2858
81c2858
Patch 7.2.167
81c2858
Problem:    Splint doesn't work well for checking the code.
81c2858
Solution:   Add splint arguments in the Makefile.  Exclude some code from
81c2858
	    splint that it can't handle.  Tune splint arguments to give
81c2858
	    reasonable errors.  Add a filter for removing false warnings from
81c2858
	    splint output.  Many small changes to avoid warnings.  More to
81c2858
	    follow...
81c2858
Files:	    Filelist, src/Makefile, src/buffer.c, src/charset.c,
81c2858
	    src/cleanlint.vim, src/digraph.c, src/edit.c, src/ex_cmds.c,
81c2858
	    src/globals.h, src/ops.c, src/os_unix.c, src/os_unix.h,
81c2858
	    src/proto/buffer.pro, src/proto/edit.pro, src/screen.c,
81c2858
	    src/structs.h
81c2858
81c2858
*** ../vim-7.2.166/Filelist	2008-09-20 16:26:10.000000000 +0200
81c2858
--- Filelist	2009-05-05 21:45:49.000000000 +0200
81c2858
***************
81c2858
*** 139,144 ****
81c2858
--- 139,145 ----
81c2858
  		src/INSTALL \
81c2858
  		src/INSTALLx.txt \
81c2858
  		src/Makefile \
81c2858
+ 		src/cleanlint.vim \
81c2858
  		src/auto/configure \
81c2858
  		src/config.aap.in \
81c2858
  		src/config.h.in \
81c2858
***************
81c2858
*** 683,691 ****
81c2858
  		runtime/spell/??/main.aap \
81c2858
  		runtime/spell/yi/README.txt \
81c2858
  		runtime/spell/main.aap \
81c2858
- 		runtime/spell/cleanadd.vim \
81c2858
  		runtime/spell/*.vim \
81c2858
- 		runtime/spell/fixdup \
81c2858
  
81c2858
  # generic language files, binary
81c2858
  LANG_GEN_BIN = \
81c2858
--- 684,690 ----
81c2858
*** ../vim-7.2.166/src/Makefile	2009-04-29 18:44:45.000000000 +0200
81c2858
--- src/Makefile	2009-05-06 00:23:15.000000000 +0200
81c2858
***************
81c2858
*** 551,557 ****
81c2858
  # }}}
81c2858
  
81c2858
  # LINT - for running lint
81c2858
! LINT_OPTIONS = -beprxzF
81c2858
  
81c2858
  # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
81c2858
  # Might not work with GUI or Perl.
81c2858
--- 551,562 ----
81c2858
  # }}}
81c2858
  
81c2858
  # LINT - for running lint
81c2858
! #  For standard lint
81c2858
! #LINT = lint
81c2858
! #LINT_OPTIONS = -beprxzF
81c2858
! #  For splint  (see cleanlint.vim for filtering the output)
81c2858
! LINT = splint
81c2858
! LINT_OPTIONS = +unixlib -weak -macrovarprefixexclude -showfunc -linelen 9999
81c2858
  
81c2858
  # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
81c2858
  # Might not work with GUI or Perl.
81c2858
***************
81c2858
*** 1259,1274 ****
81c2858
  #     This is for cproto 3 patchlevel 8 or below
81c2858
  #     __inline, __attribute__ and __extension__ are not recognized by cproto
81c2858
  #     G_IMPLEMENT_INLINES is to avoid functions defined in glib/gutils.h.
81c2858
! NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \
81c2858
! 	  -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \
81c2858
! 	  -D__extension__= -D__restrict="" \
81c2858
! 	  -D__gnuc_va_list=char -D__builtin_va_list=char
81c2858
  
81c2858
  #
81c2858
! #     This is for cproto 3 patchlevel 9 or above (currently 4.6)
81c2858
  #     __inline and __attribute__ are now recognized by cproto
81c2858
  #     -D"foo()=" is not supported by all compilers so do not use it
81c2858
! # NO_ATTR=
81c2858
  #
81c2858
  #     maybe the "/usr/bin/cc -E" has to be adjusted for some systems
81c2858
  # This is for cproto 3.5 patchlevel 3:
81c2858
--- 1264,1279 ----
81c2858
  #     This is for cproto 3 patchlevel 8 or below
81c2858
  #     __inline, __attribute__ and __extension__ are not recognized by cproto
81c2858
  #     G_IMPLEMENT_INLINES is to avoid functions defined in glib/gutils.h.
81c2858
! #NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \
81c2858
! #	  -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \
81c2858
! #	  -D__extension__= -D__restrict="" \
81c2858
! #	  -D__gnuc_va_list=char -D__builtin_va_list=char
81c2858
  
81c2858
  #
81c2858
! #     This is for cproto 3 patchlevel 9 or above (currently 4.6, 4.7g)
81c2858
  #     __inline and __attribute__ are now recognized by cproto
81c2858
  #     -D"foo()=" is not supported by all compilers so do not use it
81c2858
! NO_ATTR=
81c2858
  #
81c2858
  #     maybe the "/usr/bin/cc -E" has to be adjusted for some systems
81c2858
  # This is for cproto 3.5 patchlevel 3:
81c2858
***************
81c2858
*** 1432,1437 ****
81c2858
--- 1437,1443 ----
81c2858
  	$(SNIFF_SRC) $(WORKSHOP_SRC) $(WSDEBUG_SRC) $(NETBEANS_SRC)
81c2858
  #LINT_SRC = $(SRC)
81c2858
  #LINT_SRC = $(ALL_SRC)
81c2858
+ #LINT_SRC = $(BASIC_SRC)
81c2858
  
81c2858
  OBJ = \
81c2858
  	objects/buffer.o \
81c2858
***************
81c2858
*** 2272,2283 ****
81c2858
  
81c2858
  # Run lint.  Clean up the *.ln files that are sometimes left behind.
81c2858
  lint:
81c2858
! 	lint $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC)
81c2858
  	-rm -f *.ln
81c2858
  
81c2858
  # Check dosinst.c with lint.
81c2858
  lintinstall:
81c2858
! 	lint $(LINT_OPTIONS) -DWIN32 -DUNIX_LINT dosinst.c
81c2858
  	-rm -f dosinst.ln
81c2858
  
81c2858
  ###########################################################################
81c2858
--- 2279,2290 ----
81c2858
  
81c2858
  # Run lint.  Clean up the *.ln files that are sometimes left behind.
81c2858
  lint:
81c2858
! 	$(LINT) $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC)
81c2858
  	-rm -f *.ln
81c2858
  
81c2858
  # Check dosinst.c with lint.
81c2858
  lintinstall:
81c2858
! 	$(LINT) $(LINT_OPTIONS) -DWIN32 -DUNIX_LINT dosinst.c
81c2858
  	-rm -f dosinst.ln
81c2858
  
81c2858
  ###########################################################################
81c2858
*** ../vim-7.2.166/src/buffer.c	2009-02-22 00:01:42.000000000 +0100
81c2858
--- src/buffer.c	2009-05-13 12:25:29.000000000 +0200
81c2858
***************
81c2858
*** 44,49 ****
81c2858
--- 44,50 ----
81c2858
  #ifdef FEAT_TITLE
81c2858
  static int	ti_change __ARGS((char_u *str, char_u **last));
81c2858
  #endif
81c2858
+ static int	append_arg_number __ARGS((win_T *wp, char_u *buf, int buflen, int add_file));
81c2858
  static void	free_buffer __ARGS((buf_T *));
81c2858
  static void	free_buffer_stuff __ARGS((buf_T *buf, int free_options));
81c2858
  static void	clear_wininfo __ARGS((buf_T *buf));
81c2858
***************
81c2858
*** 1453,1465 ****
81c2858
  
81c2858
  #ifdef FEAT_KEYMAP
81c2858
      if (curbuf->b_kmap_state & KEYMAP_INIT)
81c2858
! 	keymap_init();
81c2858
  #endif
81c2858
  #ifdef FEAT_SPELL
81c2858
      /* May need to set the spell language.  Can only do this after the buffer
81c2858
       * has been properly setup. */
81c2858
      if (!curbuf->b_help && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
81c2858
! 	did_set_spelllang(curbuf);
81c2858
  #endif
81c2858
  
81c2858
      redraw_later(NOT_VALID);
81c2858
--- 1454,1466 ----
81c2858
  
81c2858
  #ifdef FEAT_KEYMAP
81c2858
      if (curbuf->b_kmap_state & KEYMAP_INIT)
81c2858
! 	(void)keymap_init();
81c2858
  #endif
81c2858
  #ifdef FEAT_SPELL
81c2858
      /* May need to set the spell language.  Can only do this after the buffer
81c2858
       * has been properly setup. */
81c2858
      if (!curbuf->b_help && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
81c2858
! 	(void)did_set_spelllang(curbuf);
81c2858
  #endif
81c2858
  
81c2858
      redraw_later(NOT_VALID);
81c2858
***************
81c2858
*** 2516,2522 ****
81c2858
      buf_T	*buf;
81c2858
  {
81c2858
      wininfo_T	*wip;
81c2858
!     static pos_T no_position = {1, 0};
81c2858
  
81c2858
      wip = find_wininfo(buf, FALSE);
81c2858
      if (wip != NULL)
81c2858
--- 2517,2523 ----
81c2858
      buf_T	*buf;
81c2858
  {
81c2858
      wininfo_T	*wip;
81c2858
!     static pos_T no_position = INIT_POS_T(1, 0, 0);
81c2858
  
81c2858
      wip = find_wininfo(buf, FALSE);
81c2858
      if (wip != NULL)
81c2858
***************
81c2858
*** 2577,2584 ****
81c2858
  	{
81c2858
  	    IObuff[len++] = ' ';
81c2858
  	} while (--i > 0 && len < IOSIZE - 18);
81c2858
! 	vim_snprintf((char *)IObuff + len, IOSIZE - len, _("line %ld"),
81c2858
! 		buf == curbuf ? curwin->w_cursor.lnum
81c2858
  					       : (long)buflist_findlnum(buf));
81c2858
  	msg_outtrans(IObuff);
81c2858
  	out_flush();	    /* output one line at a time */
81c2858
--- 2578,2585 ----
81c2858
  	{
81c2858
  	    IObuff[len++] = ' ';
81c2858
  	} while (--i > 0 && len < IOSIZE - 18);
81c2858
! 	vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len),
81c2858
! 		_("line %ld"), buf == curbuf ? curwin->w_cursor.lnum
81c2858
  					       : (long)buflist_findlnum(buf));
81c2858
  	msg_outtrans(IObuff);
81c2858
  	out_flush();	    /* output one line at a time */
81c2858
***************
81c2858
*** 2967,2973 ****
81c2858
  
81c2858
      if (fullname > 1)	    /* 2 CTRL-G: include buffer number */
81c2858
      {
81c2858
! 	sprintf((char *)buffer, "buf %d: ", curbuf->b_fnum);
81c2858
  	p = buffer + STRLEN(buffer);
81c2858
      }
81c2858
      else
81c2858
--- 2968,2974 ----
81c2858
  
81c2858
      if (fullname > 1)	    /* 2 CTRL-G: include buffer number */
81c2858
      {
81c2858
! 	vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
81c2858
  	p = buffer + STRLEN(buffer);
81c2858
      }
81c2858
      else
81c2858
***************
81c2858
*** 3041,3051 ****
81c2858
  		(long)curbuf->b_ml.ml_line_count,
81c2858
  		n);
81c2858
  	validate_virtcol();
81c2858
! 	col_print(buffer + STRLEN(buffer),
81c2858
  		   (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1);
81c2858
      }
81c2858
  
81c2858
!     (void)append_arg_number(curwin, buffer, !shortmess(SHM_FILE), IOSIZE);
81c2858
  
81c2858
      if (dont_truncate)
81c2858
      {
81c2858
--- 3042,3053 ----
81c2858
  		(long)curbuf->b_ml.ml_line_count,
81c2858
  		n);
81c2858
  	validate_virtcol();
81c2858
! 	len = STRLEN(buffer);
81c2858
! 	col_print(buffer + len, IOSIZE - len,
81c2858
  		   (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1);
81c2858
      }
81c2858
  
81c2858
!     (void)append_arg_number(curwin, buffer, IOSIZE, !shortmess(SHM_FILE));
81c2858
  
81c2858
      if (dont_truncate)
81c2858
      {
81c2858
***************
81c2858
*** 3073,3087 ****
81c2858
  }
81c2858
  
81c2858
      void
81c2858
! col_print(buf, col, vcol)
81c2858
      char_u  *buf;
81c2858
      int	    col;
81c2858
      int	    vcol;
81c2858
  {
81c2858
      if (col == vcol)
81c2858
! 	sprintf((char *)buf, "%d", col);
81c2858
      else
81c2858
! 	sprintf((char *)buf, "%d-%d", col, vcol);
81c2858
  }
81c2858
  
81c2858
  #if defined(FEAT_TITLE) || defined(PROTO)
81c2858
--- 3075,3090 ----
81c2858
  }
81c2858
  
81c2858
      void
81c2858
! col_print(buf, buflen, col, vcol)
81c2858
      char_u  *buf;
81c2858
+     size_t  buflen;
81c2858
      int	    col;
81c2858
      int	    vcol;
81c2858
  {
81c2858
      if (col == vcol)
81c2858
! 	vim_snprintf((char *)buf, buflen, "%d", col);
81c2858
      else
81c2858
! 	vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol);
81c2858
  }
81c2858
  
81c2858
  #if defined(FEAT_TITLE) || defined(PROTO)
81c2858
***************
81c2858
*** 3194,3211 ****
81c2858
  		if (p == buf + off)
81c2858
  		    /* must be a help buffer */
81c2858
  		    vim_strncpy(buf + off, (char_u *)_("help"),
81c2858
! 							    IOSIZE - off - 1);
81c2858
  		else
81c2858
  		    *p = NUL;
81c2858
  
81c2858
  		/* translate unprintable chars */
81c2858
  		p = transstr(buf + off);
81c2858
! 		vim_strncpy(buf + off, p, IOSIZE - off - 1);
81c2858
  		vim_free(p);
81c2858
  		STRCAT(buf, ")");
81c2858
  	    }
81c2858
  
81c2858
! 	    append_arg_number(curwin, buf, FALSE, IOSIZE);
81c2858
  
81c2858
  #if defined(FEAT_CLIENTSERVER)
81c2858
  	    if (serverName != NULL)
81c2858
--- 3197,3214 ----
81c2858
  		if (p == buf + off)
81c2858
  		    /* must be a help buffer */
81c2858
  		    vim_strncpy(buf + off, (char_u *)_("help"),
81c2858
! 						  (size_t)(IOSIZE - off - 1));
81c2858
  		else
81c2858
  		    *p = NUL;
81c2858
  
81c2858
  		/* translate unprintable chars */
81c2858
  		p = transstr(buf + off);
81c2858
! 		vim_strncpy(buf + off, p, (size_t)(IOSIZE - off - 1));
81c2858
  		vim_free(p);
81c2858
  		STRCAT(buf, ")");
81c2858
  	    }
81c2858
  
81c2858
! 	    append_arg_number(curwin, buf, IOSIZE, FALSE);
81c2858
  
81c2858
  #if defined(FEAT_CLIENTSERVER)
81c2858
  	    if (serverName != NULL)
81c2858
***************
81c2858
*** 3520,3526 ****
81c2858
  		    n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
81c2858
  
81c2858
  		*t = '<';
81c2858
! 		mch_memmove(t + 1, t + n, p - (t + n));
81c2858
  		p = p - n + 1;
81c2858
  #ifdef FEAT_MBYTE
81c2858
  		/* Fill up space left over by half a double-wide char. */
81c2858
--- 3523,3529 ----
81c2858
  		    n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
81c2858
  
81c2858
  		*t = '<';
81c2858
! 		mch_memmove(t + 1, t + n, (size_t)(p - (t + n)));
81c2858
  		p = p - n + 1;
81c2858
  #ifdef FEAT_MBYTE
81c2858
  		/* Fill up space left over by half a double-wide char. */
81c2858
***************
81c2858
*** 3550,3556 ****
81c2858
  		else
81c2858
  		{
81c2858
  		    /* fill by inserting characters */
81c2858
! 		    mch_memmove(t + n - l, t, p - t);
81c2858
  		    l = n - l;
81c2858
  		    if (p + l >= out + outlen)
81c2858
  			l = (long)((out + outlen) - p - 1);
81c2858
--- 3553,3559 ----
81c2858
  		else
81c2858
  		{
81c2858
  		    /* fill by inserting characters */
81c2858
! 		    mch_memmove(t + n - l, t, (size_t)(p - t));
81c2858
  		    l = n - l;
81c2858
  		    if (p + l >= out + outlen)
81c2858
  			l = (long)((out + outlen) - p - 1);
81c2858
***************
81c2858
*** 3686,3692 ****
81c2858
  	    p = t;
81c2858
  
81c2858
  #ifdef FEAT_EVAL
81c2858
! 	    sprintf((char *)tmp, "%d", curbuf->b_fnum);
81c2858
  	    set_internal_string_var((char_u *)"actual_curbuf", tmp);
81c2858
  
81c2858
  	    o_curbuf = curbuf;
81c2858
--- 3689,3695 ----
81c2858
  	    p = t;
81c2858
  
81c2858
  #ifdef FEAT_EVAL
81c2858
! 	    vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum);
81c2858
  	    set_internal_string_var((char_u *)"actual_curbuf", tmp);
81c2858
  
81c2858
  	    o_curbuf = curbuf;
81c2858
***************
81c2858
*** 3753,3765 ****
81c2858
  
81c2858
  	case STL_ALTPERCENT:
81c2858
  	    str = tmp;
81c2858
! 	    get_rel_pos(wp, str);
81c2858
  	    break;
81c2858
  
81c2858
  	case STL_ARGLISTSTAT:
81c2858
  	    fillable = FALSE;
81c2858
  	    tmp[0] = 0;
81c2858
! 	    if (append_arg_number(wp, tmp, FALSE, (int)sizeof(tmp)))
81c2858
  		str = tmp;
81c2858
  	    break;
81c2858
  
81c2858
--- 3756,3768 ----
81c2858
  
81c2858
  	case STL_ALTPERCENT:
81c2858
  	    str = tmp;
81c2858
! 	    get_rel_pos(wp, str, TMPLEN);
81c2858
  	    break;
81c2858
  
81c2858
  	case STL_ARGLISTSTAT:
81c2858
  	    fillable = FALSE;
81c2858
  	    tmp[0] = 0;
81c2858
! 	    if (append_arg_number(wp, tmp, (int)sizeof(tmp), FALSE))
81c2858
  		str = tmp;
81c2858
  	    break;
81c2858
  
81c2858
***************
81c2858
*** 3794,3800 ****
81c2858
  	case STL_BYTEVAL_X:
81c2858
  	    base = 'X';
81c2858
  	case STL_BYTEVAL:
81c2858
! 	    if (wp->w_cursor.col > STRLEN(linecont))
81c2858
  		num = 0;
81c2858
  	    else
81c2858
  	    {
81c2858
--- 3797,3803 ----
81c2858
  	case STL_BYTEVAL_X:
81c2858
  	    base = 'X';
81c2858
  	case STL_BYTEVAL:
81c2858
! 	    if (wp->w_cursor.col > (colnr_T)STRLEN(linecont))
81c2858
  		num = 0;
81c2858
  	    else
81c2858
  	    {
81c2858
***************
81c2858
*** 3967,3973 ****
81c2858
  	    if (zeropad)
81c2858
  		*t++ = '0';
81c2858
  	    *t++ = '*';
81c2858
! 	    *t++ = nbase == 16 ? base : (nbase == 8 ? 'o' : 'd');
81c2858
  	    *t = 0;
81c2858
  
81c2858
  	    for (n = num, l = 1; n >= nbase; n /= nbase)
81c2858
--- 3970,3976 ----
81c2858
  	    if (zeropad)
81c2858
  		*t++ = '0';
81c2858
  	    *t++ = '*';
81c2858
! 	    *t++ = nbase == 16 ? base : (char_u)(nbase == 8 ? 'o' : 'd');
81c2858
  	    *t = 0;
81c2858
  
81c2858
  	    for (n = num, l = 1; n >= nbase; n /= nbase)
81c2858
***************
81c2858
*** 4160,4172 ****
81c2858
  #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \
81c2858
  	    || defined(FEAT_GUI_TABLINE) || defined(PROTO)
81c2858
  /*
81c2858
!  * Get relative cursor position in window into "str[]", in the form 99%, using
81c2858
!  * "Top", "Bot" or "All" when appropriate.
81c2858
   */
81c2858
      void
81c2858
! get_rel_pos(wp, str)
81c2858
      win_T	*wp;
81c2858
!     char_u	*str;
81c2858
  {
81c2858
      long	above; /* number of lines above window */
81c2858
      long	below; /* number of lines below window */
81c2858
--- 4163,4176 ----
81c2858
  #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \
81c2858
  	    || defined(FEAT_GUI_TABLINE) || defined(PROTO)
81c2858
  /*
81c2858
!  * Get relative cursor position in window into "buf[buflen]", in the form 99%,
81c2858
!  * using "Top", "Bot" or "All" when appropriate.
81c2858
   */
81c2858
      void
81c2858
! get_rel_pos(wp, buf, buflen)
81c2858
      win_T	*wp;
81c2858
!     char_u	*buf;
81c2858
!     int		buflen;
81c2858
  {
81c2858
      long	above; /* number of lines above window */
81c2858
      long	below; /* number of lines below window */
81c2858
***************
81c2858
*** 4177,4210 ****
81c2858
  #endif
81c2858
      below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1;
81c2858
      if (below <= 0)
81c2858
! 	STRCPY(str, above == 0 ? _("All") : _("Bot"));
81c2858
      else if (above <= 0)
81c2858
! 	STRCPY(str, _("Top"));
81c2858
      else
81c2858
! 	sprintf((char *)str, "%2d%%", above > 1000000L
81c2858
  				    ? (int)(above / ((above + below) / 100L))
81c2858
  				    : (int)(above * 100L / (above + below)));
81c2858
  }
81c2858
  #endif
81c2858
  
81c2858
  /*
81c2858
!  * Append (file 2 of 8) to 'buf', if editing more than one file.
81c2858
   * Return TRUE if it was appended.
81c2858
   */
81c2858
!     int
81c2858
! append_arg_number(wp, buf, add_file, maxlen)
81c2858
      win_T	*wp;
81c2858
      char_u	*buf;
81c2858
      int		add_file;	/* Add "file" before the arg number */
81c2858
-     int		maxlen;		/* maximum nr of chars in buf or zero*/
81c2858
  {
81c2858
      char_u	*p;
81c2858
  
81c2858
      if (ARGCOUNT <= 1)		/* nothing to do */
81c2858
  	return FALSE;
81c2858
  
81c2858
!     p = buf + STRLEN(buf);		/* go to the end of the buffer */
81c2858
!     if (maxlen && p - buf + 35 >= maxlen) /* getting too long */
81c2858
  	return FALSE;
81c2858
      *p++ = ' ';
81c2858
      *p++ = '(';
81c2858
--- 4181,4215 ----
81c2858
  #endif
81c2858
      below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1;
81c2858
      if (below <= 0)
81c2858
! 	vim_strncpy(buf, (char_u *)(above == 0 ? _("All") : _("Bot")),
81c2858
! 							(size_t)(buflen - 1));
81c2858
      else if (above <= 0)
81c2858
! 	vim_strncpy(buf, (char_u *)_("Top"), (size_t)(buflen - 1));
81c2858
      else
81c2858
! 	vim_snprintf((char *)buf, (size_t)buflen, "%2d%%", above > 1000000L
81c2858
  				    ? (int)(above / ((above + below) / 100L))
81c2858
  				    : (int)(above * 100L / (above + below)));
81c2858
  }
81c2858
  #endif
81c2858
  
81c2858
  /*
81c2858
!  * Append (file 2 of 8) to "buf[buflen]", if editing more than one file.
81c2858
   * Return TRUE if it was appended.
81c2858
   */
81c2858
!     static int
81c2858
! append_arg_number(wp, buf, buflen, add_file)
81c2858
      win_T	*wp;
81c2858
      char_u	*buf;
81c2858
+     int		buflen;
81c2858
      int		add_file;	/* Add "file" before the arg number */
81c2858
  {
81c2858
      char_u	*p;
81c2858
  
81c2858
      if (ARGCOUNT <= 1)		/* nothing to do */
81c2858
  	return FALSE;
81c2858
  
81c2858
!     p = buf + STRLEN(buf);	/* go to the end of the buffer */
81c2858
!     if (p - buf + 35 >= buflen)	/* getting too long */
81c2858
  	return FALSE;
81c2858
      *p++ = ' ';
81c2858
      *p++ = '(';
81c2858
***************
81c2858
*** 4213,4219 ****
81c2858
  	STRCPY(p, "file ");
81c2858
  	p += 5;
81c2858
      }
81c2858
!     sprintf((char *)p, wp->w_arg_idx_invalid ? "(%d) of %d)"
81c2858
  				  : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT);
81c2858
      return TRUE;
81c2858
  }
81c2858
--- 4218,4225 ----
81c2858
  	STRCPY(p, "file ");
81c2858
  	p += 5;
81c2858
      }
81c2858
!     vim_snprintf((char *)p, (size_t)(buflen - (p - buf)),
81c2858
! 		wp->w_arg_idx_invalid ? "(%d) of %d)"
81c2858
  				  : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT);
81c2858
      return TRUE;
81c2858
  }
81c2858
***************
81c2858
*** 4996,5002 ****
81c2858
  	if (tab != NULL)
81c2858
  	{
81c2858
  	    *tab++ = '\0';
81c2858
! 	    col = atoi((char *)tab);
81c2858
  	    tab = vim_strrchr(xline, '\t');
81c2858
  	    if (tab != NULL)
81c2858
  	    {
81c2858
--- 5002,5008 ----
81c2858
  	if (tab != NULL)
81c2858
  	{
81c2858
  	    *tab++ = '\0';
81c2858
! 	    col = (colnr_T)atoi((char *)tab);
81c2858
  	    tab = vim_strrchr(xline, '\t');
81c2858
  	    if (tab != NULL)
81c2858
  	    {
81c2858
***************
81c2858
*** 5034,5039 ****
81c2858
--- 5040,5046 ----
81c2858
  #endif
81c2858
      char_u	*line;
81c2858
      int		max_buffers;
81c2858
+     size_t	len;
81c2858
  
81c2858
      if (find_viminfo_parameter('%') == NULL)
81c2858
  	return;
81c2858
***************
81c2858
*** 5042,5048 ****
81c2858
      max_buffers = get_viminfo_parameter('%');
81c2858
  
81c2858
      /* Allocate room for the file name, lnum and col. */
81c2858
!     line = alloc(MAXPATHL + 40);
81c2858
      if (line == NULL)
81c2858
  	return;
81c2858
  
81c2858
--- 5049,5056 ----
81c2858
      max_buffers = get_viminfo_parameter('%');
81c2858
  
81c2858
      /* Allocate room for the file name, lnum and col. */
81c2858
! #define LINE_BUF_LEN (MAXPATHL + 40)
81c2858
!     line = alloc(LINE_BUF_LEN);
81c2858
      if (line == NULL)
81c2858
  	return;
81c2858
  
81c2858
***************
81c2858
*** 5068,5074 ****
81c2858
  	    break;
81c2858
  	putc('%', fp);
81c2858
  	home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE);
81c2858
! 	sprintf((char *)line + STRLEN(line), "\t%ld\t%d",
81c2858
  			(long)buf->b_last_cursor.lnum,
81c2858
  			buf->b_last_cursor.col);
81c2858
  	viminfo_writestring(fp, line);
81c2858
--- 5076,5083 ----
81c2858
  	    break;
81c2858
  	putc('%', fp);
81c2858
  	home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE);
81c2858
! 	len = STRLEN(line);
81c2858
! 	vim_snprintf((char *)line + len, len - LINE_BUF_LEN, "\t%ld\t%d",
81c2858
  			(long)buf->b_last_cursor.lnum,
81c2858
  			buf->b_last_cursor.col);
81c2858
  	viminfo_writestring(fp, line);
81c2858
***************
81c2858
*** 5226,5232 ****
81c2858
      return;
81c2858
  }
81c2858
  
81c2858
!     int
81c2858
  buf_change_sign_type(buf, markId, typenr)
81c2858
      buf_T	*buf;		/* buffer to store sign in */
81c2858
      int		markId;		/* sign ID */
81c2858
--- 5235,5241 ----
81c2858
      return;
81c2858
  }
81c2858
  
81c2858
!     linenr_T
81c2858
  buf_change_sign_type(buf, markId, typenr)
81c2858
      buf_T	*buf;		/* buffer to store sign in */
81c2858
      int		markId;		/* sign ID */
81c2858
***************
81c2858
*** 5243,5252 ****
81c2858
  	}
81c2858
      }
81c2858
  
81c2858
!     return 0;
81c2858
  }
81c2858
  
81c2858
!     int_u
81c2858
  buf_getsigntype(buf, lnum, type)
81c2858
      buf_T	*buf;
81c2858
      linenr_T	lnum;
81c2858
--- 5252,5261 ----
81c2858
  	}
81c2858
      }
81c2858
  
81c2858
!     return (linenr_T)0;
81c2858
  }
81c2858
  
81c2858
!     int
81c2858
  buf_getsigntype(buf, lnum, type)
81c2858
      buf_T	*buf;
81c2858
      linenr_T	lnum;
81c2858
*** ../vim-7.2.166/src/charset.c	2008-07-24 21:30:44.000000000 +0200
81c2858
--- src/charset.c	2009-05-05 18:17:11.000000000 +0200
81c2858
***************
81c2858
*** 17,23 ****
81c2858
  static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
81c2858
  #endif
81c2858
  
81c2858
! static int nr2hex __ARGS((int c));
81c2858
  
81c2858
  static int    chartab_initialized = FALSE;
81c2858
  
81c2858
--- 17,23 ----
81c2858
  static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
81c2858
  #endif
81c2858
  
81c2858
! static unsigned nr2hex __ARGS((unsigned c));
81c2858
  
81c2858
  static int    chartab_initialized = FALSE;
81c2858
  
81c2858
***************
81c2858
*** 664,670 ****
81c2858
      }
81c2858
  #endif
81c2858
      buf[++i] = nr2hex((unsigned)c >> 4);
81c2858
!     buf[++i] = nr2hex(c);
81c2858
      buf[++i] = '>';
81c2858
      buf[++i] = NUL;
81c2858
  }
81c2858
--- 664,670 ----
81c2858
      }
81c2858
  #endif
81c2858
      buf[++i] = nr2hex((unsigned)c >> 4);
81c2858
!     buf[++i] = nr2hex((unsigned)c);
81c2858
      buf[++i] = '>';
81c2858
      buf[++i] = NUL;
81c2858
  }
81c2858
***************
81c2858
*** 674,682 ****
81c2858
   * Lower case letters are used to avoid the confusion of <F1> being 0xf1 or
81c2858
   * function key 1.
81c2858
   */
81c2858
!     static int
81c2858
  nr2hex(c)
81c2858
!     int		c;
81c2858
  {
81c2858
      if ((c & 0xf) <= 9)
81c2858
  	return (c & 0xf) + '0';
81c2858
--- 674,682 ----
81c2858
   * Lower case letters are used to avoid the confusion of <F1> being 0xf1 or
81c2858
   * function key 1.
81c2858
   */
81c2858
!     static unsigned
81c2858
  nr2hex(c)
81c2858
!     unsigned	c;
81c2858
  {
81c2858
      if ((c & 0xf) <= 9)
81c2858
  	return (c & 0xf) + '0';
81c2858
***************
81c2858
*** 884,890 ****
81c2858
      if (c >= 0x100)
81c2858
      {
81c2858
  	if (enc_dbcs != 0)
81c2858
! 	    return dbcs_class((unsigned)c >> 8, c & 0xff) >= 2;
81c2858
  	if (enc_utf8)
81c2858
  	    return utf_class(c) >= 2;
81c2858
      }
81c2858
--- 884,890 ----
81c2858
      if (c >= 0x100)
81c2858
      {
81c2858
  	if (enc_dbcs != 0)
81c2858
! 	    return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2;
81c2858
  	if (enc_utf8)
81c2858
  	    return utf_class(c) >= 2;
81c2858
      }
81c2858
***************
81c2858
*** 1090,1096 ****
81c2858
  	 */
81c2858
  	numberextra = win_col_off(wp);
81c2858
  	col2 = col;
81c2858
! 	colmax = W_WIDTH(wp) - numberextra;
81c2858
  	if (col >= colmax)
81c2858
  	{
81c2858
  	    n = colmax + win_col_off2(wp);
81c2858
--- 1090,1096 ----
81c2858
  	 */
81c2858
  	numberextra = win_col_off(wp);
81c2858
  	col2 = col;
81c2858
! 	colmax = (colnr_T)(W_WIDTH(wp) - numberextra);
81c2858
  	if (col >= colmax)
81c2858
  	{
81c2858
  	    n = colmax + win_col_off2(wp);
81c2858
***************
81c2858
*** 1201,1217 ****
81c2858
      win_T	*wp;
81c2858
      colnr_T	vcol;
81c2858
  {
81c2858
!     colnr_T	width1;		/* width of first line (after line number) */
81c2858
!     colnr_T	width2;		/* width of further lines */
81c2858
  
81c2858
  #ifdef FEAT_VERTSPLIT
81c2858
      if (wp->w_width == 0)	/* there is no border */
81c2858
  	return FALSE;
81c2858
  #endif
81c2858
      width1 = W_WIDTH(wp) - win_col_off(wp);
81c2858
!     if (vcol < width1 - 1)
81c2858
  	return FALSE;
81c2858
!     if (vcol == width1 - 1)
81c2858
  	return TRUE;
81c2858
      width2 = width1 + win_col_off2(wp);
81c2858
      return ((vcol - width1) % width2 == width2 - 1);
81c2858
--- 1201,1217 ----
81c2858
      win_T	*wp;
81c2858
      colnr_T	vcol;
81c2858
  {
81c2858
!     int		width1;		/* width of first line (after line number) */
81c2858
!     int		width2;		/* width of further lines */
81c2858
  
81c2858
  #ifdef FEAT_VERTSPLIT
81c2858
      if (wp->w_width == 0)	/* there is no border */
81c2858
  	return FALSE;
81c2858
  #endif
81c2858
      width1 = W_WIDTH(wp) - win_col_off(wp);
81c2858
!     if ((int)vcol < width1 - 1)
81c2858
  	return FALSE;
81c2858
!     if ((int)vcol == width1 - 1)
81c2858
  	return TRUE;
81c2858
      width2 = width1 + win_col_off2(wp);
81c2858
      return ((vcol - width1) % width2 == width2 - 1);
81c2858
***************
81c2858
*** 1396,1408 ****
81c2858
  # ifdef FEAT_MBYTE
81c2858
  	/* Cannot put the cursor on part of a wide character. */
81c2858
  	ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
81c2858
! 	if (pos->col < STRLEN(ptr))
81c2858
  	{
81c2858
  	    int c = (*mb_ptr2char)(ptr + pos->col);
81c2858
  
81c2858
  	    if (c != TAB && vim_isprintc(c))
81c2858
  	    {
81c2858
! 		endadd = char2cells(c) - 1;
81c2858
  		if (coladd > endadd)	/* past end of line */
81c2858
  		    endadd = 0;
81c2858
  		else
81c2858
--- 1396,1408 ----
81c2858
  # ifdef FEAT_MBYTE
81c2858
  	/* Cannot put the cursor on part of a wide character. */
81c2858
  	ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
81c2858
! 	if (pos->col < (colnr_T)STRLEN(ptr))
81c2858
  	{
81c2858
  	    int c = (*mb_ptr2char)(ptr + pos->col);
81c2858
  
81c2858
  	    if (c != TAB && vim_isprintc(c))
81c2858
  	    {
81c2858
! 		endadd = (colnr_T)(char2cells(c) - 1);
81c2858
  		if (coladd > endadd)	/* past end of line */
81c2858
  		    endadd = 0;
81c2858
  		else
81c2858
*** ../vim-7.2.166/src/cleanlint.vim	2009-05-13 12:08:12.000000000 +0200
81c2858
--- src/cleanlint.vim	2009-05-05 21:34:01.000000000 +0200
81c2858
***************
81c2858
*** 0 ****
81c2858
--- 1,27 ----
81c2858
+ " Vim tool: Filter output of splint
81c2858
+ "
81c2858
+ " Maintainer:	Bram Moolenaar <Bram@vim.org>
81c2858
+ " Last Change:	2009 May 05
81c2858
+ 
81c2858
+ " Usage: redirect output of "make lint" to a file, edit that file with Vim and
81c2858
+ " :call CleanLint()
81c2858
+ " This deletes irrelevant messages.  What remains might be valid warnings.
81c2858
+ 
81c2858
+ fun! CleanLint()
81c2858
+   g/^  Types are incompatible/lockmarks d
81c2858
+   g/Assignment of dev_t to __dev_t:/lockmarks d
81c2858
+   g/Assignment of __dev_t to dev_t:/lockmarks d
81c2858
+   g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
81c2858
+   g/Operands of == have incompatible types (unsigned int, int): /lockmarks d
81c2858
+   g/Assignment of char to char_u: /lockmarks d
81c2858
+   g/Assignment of unsigned int to int: /lockmarks d
81c2858
+   g/Assignment of colnr_T to int: /lockmarks d
81c2858
+   g/Assignment of int to char_u: /lockmarks d
81c2858
+   g/Function .* expects arg . to be wint_t gets int: /lockmarks d
81c2858
+   g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d
81c2858
+   g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
81c2858
+   g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
81c2858
+   g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
81c2858
+   g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
81c2858
+   g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
81c2858
+ endfun
81c2858
*** ../vim-7.2.166/src/digraph.c	2008-06-25 00:26:41.000000000 +0200
81c2858
--- src/digraph.c	2009-05-05 20:32:43.000000000 +0200
81c2858
***************
81c2858
*** 32,38 ****
81c2858
  static void printdigraph __ARGS((digr_T *));
81c2858
  
81c2858
  /* digraphs added by the user */
81c2858
! static garray_T	user_digraphs = {0, 0, sizeof(digr_T), 10, NULL};
81c2858
  
81c2858
  /*
81c2858
   * Note: Characters marked with XX are not included literally, because some
81c2858
--- 32,38 ----
81c2858
  static void printdigraph __ARGS((digr_T *));
81c2858
  
81c2858
  /* digraphs added by the user */
81c2858
! static garray_T	user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL};
81c2858
  
81c2858
  /*
81c2858
   * Note: Characters marked with XX are not included literally, because some
81c2858
***************
81c2858
*** 2371,2380 ****
81c2858
  	}
81c2858
  	else
81c2858
  #endif
81c2858
! 	    *p++ = dp->result;
81c2858
  	if (char2cells(dp->result) == 1)
81c2858
  	    *p++ = ' ';
81c2858
! 	sprintf((char *)p, " %3d", dp->result);
81c2858
  	msg_outtrans(buf);
81c2858
      }
81c2858
  }
81c2858
--- 2371,2380 ----
81c2858
  	}
81c2858
  	else
81c2858
  #endif
81c2858
! 	    *p++ = (char_u)dp->result;
81c2858
  	if (char2cells(dp->result) == 1)
81c2858
  	    *p++ = ' ';
81c2858
! 	vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result);
81c2858
  	msg_outtrans(buf);
81c2858
      }
81c2858
  }
81c2858
***************
81c2858
*** 2395,2401 ****
81c2858
  static void keymap_unload __ARGS((void));
81c2858
  
81c2858
  /*
81c2858
!  * Set up key mapping tables for the 'keymap' option
81c2858
   */
81c2858
      char_u *
81c2858
  keymap_init()
81c2858
--- 2395,2404 ----
81c2858
  static void keymap_unload __ARGS((void));
81c2858
  
81c2858
  /*
81c2858
!  * Set up key mapping tables for the 'keymap' option.
81c2858
!  * Returns NULL if OK, an error message for failure.  This only needs to be
81c2858
!  * used when setting the option, not later when the value has already been
81c2858
!  * checked.
81c2858
   */
81c2858
      char_u *
81c2858
  keymap_init()
81c2858
***************
81c2858
*** 2412,2436 ****
81c2858
      else
81c2858
      {
81c2858
  	char_u	*buf;
81c2858
  
81c2858
  	/* Source the keymap file.  It will contain a ":loadkeymap" command
81c2858
  	 * which will call ex_loadkeymap() below. */
81c2858
! 	buf = alloc((unsigned)(STRLEN(curbuf->b_p_keymap)
81c2858
  # ifdef FEAT_MBYTE
81c2858
! 						       + STRLEN(p_enc)
81c2858
  # endif
81c2858
! 						       + 14));
81c2858
  	if (buf == NULL)
81c2858
  	    return e_outofmem;
81c2858
  
81c2858
  # ifdef FEAT_MBYTE
81c2858
  	/* try finding "keymap/'keymap'_'encoding'.vim"  in 'runtimepath' */
81c2858
! 	sprintf((char *)buf, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc);
81c2858
  	if (source_runtime(buf, FALSE) == FAIL)
81c2858
  # endif
81c2858
  	{
81c2858
  	    /* try finding "keymap/'keymap'.vim" in 'runtimepath'  */
81c2858
! 	    sprintf((char *)buf, "keymap/%s.vim", curbuf->b_p_keymap);
81c2858
  	    if (source_runtime(buf, FALSE) == FAIL)
81c2858
  	    {
81c2858
  		vim_free(buf);
81c2858
--- 2415,2443 ----
81c2858
      else
81c2858
      {
81c2858
  	char_u	*buf;
81c2858
+ 	size_t  buflen;
81c2858
  
81c2858
  	/* Source the keymap file.  It will contain a ":loadkeymap" command
81c2858
  	 * which will call ex_loadkeymap() below. */
81c2858
! 	buflen = STRLEN(curbuf->b_p_keymap)
81c2858
  # ifdef FEAT_MBYTE
81c2858
! 					   + STRLEN(p_enc)
81c2858
  # endif
81c2858
! 						       + 14;
81c2858
! 	buf = alloc((unsigned)buflen);
81c2858
  	if (buf == NULL)
81c2858
  	    return e_outofmem;
81c2858
  
81c2858
  # ifdef FEAT_MBYTE
81c2858
  	/* try finding "keymap/'keymap'_'encoding'.vim"  in 'runtimepath' */
81c2858
! 	vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim",
81c2858
! 						   curbuf->b_p_keymap, p_enc);
81c2858
  	if (source_runtime(buf, FALSE) == FAIL)
81c2858
  # endif
81c2858
  	{
81c2858
  	    /* try finding "keymap/'keymap'.vim" in 'runtimepath'  */
81c2858
! 	    vim_snprintf((char *)buf, buflen, "keymap/%s.vim",
81c2858
! 							  curbuf->b_p_keymap);
81c2858
  	    if (source_runtime(buf, FALSE) == FAIL)
81c2858
  	    {
81c2858
  		vim_free(buf);
81c2858
*** ../vim-7.2.166/src/edit.c	2009-02-21 20:27:00.000000000 +0100
81c2858
--- src/edit.c	2009-05-05 21:14:50.000000000 +0200
81c2858
***************
81c2858
*** 57,63 ****
81c2858
      N_(" Keyword Local completion (^N^P)"),
81c2858
  };
81c2858
  
81c2858
! static char_u e_hitend[] = N_("Hit end of paragraph");
81c2858
  
81c2858
  /*
81c2858
   * Structure used to store one match for insert completion.
81c2858
--- 57,63 ----
81c2858
      N_(" Keyword Local completion (^N^P)"),
81c2858
  };
81c2858
  
81c2858
! static char e_hitend[] = N_("Hit end of paragraph");
81c2858
  
81c2858
  /*
81c2858
   * Structure used to store one match for insert completion.
81c2858
***************
81c2858
*** 69,75 ****
81c2858
--- 69,79 ----
81c2858
      compl_T	*cp_prev;
81c2858
      char_u	*cp_str;	/* matched text */
81c2858
      char	cp_icase;	/* TRUE or FALSE: ignore case */
81c2858
+ #ifdef S_SPLINT_S  /* splint can't handle array of pointers */
81c2858
+     char_u	**cp_text;	/* text for the menu */
81c2858
+ #else
81c2858
      char_u	*(cp_text[CPT_COUNT]);	/* text for the menu */
81c2858
+ #endif
81c2858
      char_u	*cp_fname;	/* file containing the match, allocated when
81c2858
  				 * cp_flags has FREE_FNAME */
81c2858
      int		cp_flags;	/* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */
81c2858
***************
81c2858
*** 306,312 ****
81c2858
      int		c = 0;
81c2858
      char_u	*ptr;
81c2858
      int		lastc;
81c2858
!     colnr_T	mincol;
81c2858
      static linenr_T o_lnum = 0;
81c2858
      int		i;
81c2858
      int		did_backspace = TRUE;	    /* previous char was backspace */
81c2858
--- 310,316 ----
81c2858
      int		c = 0;
81c2858
      char_u	*ptr;
81c2858
      int		lastc;
81c2858
!     int		mincol;
81c2858
      static linenr_T o_lnum = 0;
81c2858
      int		i;
81c2858
      int		did_backspace = TRUE;	    /* previous char was backspace */
81c2858
***************
81c2858
*** 387,393 ****
81c2858
  	if (startln)
81c2858
  	    Insstart.col = 0;
81c2858
      }
81c2858
!     Insstart_textlen = linetabsize(ml_get_curline());
81c2858
      Insstart_blank_vcol = MAXCOL;
81c2858
      if (!did_ai)
81c2858
  	ai_col = 0;
81c2858
--- 391,397 ----
81c2858
  	if (startln)
81c2858
  	    Insstart.col = 0;
81c2858
      }
81c2858
!     Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
81c2858
      Insstart_blank_vcol = MAXCOL;
81c2858
      if (!did_ai)
81c2858
  	ai_col = 0;
81c2858
***************
81c2858
*** 653,659 ****
81c2858
  	    mincol = curwin->w_wcol;
81c2858
  	    validate_cursor_col();
81c2858
  
81c2858
! 	    if ((int)curwin->w_wcol < (int)mincol - curbuf->b_p_ts
81c2858
  		    && curwin->w_wrow == W_WINROW(curwin)
81c2858
  						 + curwin->w_height - 1 - p_so
81c2858
  		    && (curwin->w_cursor.lnum != curwin->w_topline
81c2858
--- 657,663 ----
81c2858
  	    mincol = curwin->w_wcol;
81c2858
  	    validate_cursor_col();
81c2858
  
81c2858
! 	    if ((int)curwin->w_wcol < mincol - curbuf->b_p_ts
81c2858
  		    && curwin->w_wrow == W_WINROW(curwin)
81c2858
  						 + curwin->w_height - 1 - p_so
81c2858
  		    && (curwin->w_cursor.lnum != curwin->w_topline
81c2858
***************
81c2858
*** 1773,1779 ****
81c2858
  	 * Compute the screen column where the cursor should be.
81c2858
  	 */
81c2858
  	vcol = get_indent() - vcol;
81c2858
! 	curwin->w_virtcol = (vcol < 0) ? 0 : vcol;
81c2858
  
81c2858
  	/*
81c2858
  	 * Advance the cursor until we reach the right screen column.
81c2858
--- 1777,1783 ----
81c2858
  	 * Compute the screen column where the cursor should be.
81c2858
  	 */
81c2858
  	vcol = get_indent() - vcol;
81c2858
! 	curwin->w_virtcol = (colnr_T)((vcol < 0) ? 0 : vcol);
81c2858
  
81c2858
  	/*
81c2858
  	 * Advance the cursor until we reach the right screen column.
81c2858
***************
81c2858
*** 1800,1808 ****
81c2858
  	 */
81c2858
  	if (vcol != (int)curwin->w_virtcol)
81c2858
  	{
81c2858
! 	    curwin->w_cursor.col = new_cursor_col;
81c2858
  	    i = (int)curwin->w_virtcol - vcol;
81c2858
! 	    ptr = alloc(i + 1);
81c2858
  	    if (ptr != NULL)
81c2858
  	    {
81c2858
  		new_cursor_col += i;
81c2858
--- 1804,1812 ----
81c2858
  	 */
81c2858
  	if (vcol != (int)curwin->w_virtcol)
81c2858
  	{
81c2858
! 	    curwin->w_cursor.col = (colnr_T)new_cursor_col;
81c2858
  	    i = (int)curwin->w_virtcol - vcol;
81c2858
! 	    ptr = alloc((unsigned)(i + 1));
81c2858
  	    if (ptr != NULL)
81c2858
  	    {
81c2858
  		new_cursor_col += i;
81c2858
***************
81c2858
*** 1826,1832 ****
81c2858
      if (new_cursor_col <= 0)
81c2858
  	curwin->w_cursor.col = 0;
81c2858
      else
81c2858
! 	curwin->w_cursor.col = new_cursor_col;
81c2858
      curwin->w_set_curswant = TRUE;
81c2858
      changed_cline_bef_curs();
81c2858
  
81c2858
--- 1830,1836 ----
81c2858
      if (new_cursor_col <= 0)
81c2858
  	curwin->w_cursor.col = 0;
81c2858
      else
81c2858
! 	curwin->w_cursor.col = (colnr_T)new_cursor_col;
81c2858
      curwin->w_set_curswant = TRUE;
81c2858
      changed_cline_bef_curs();
81c2858
  
81c2858
***************
81c2858
*** 1966,1972 ****
81c2858
  #ifdef FEAT_MBYTE
81c2858
      if (enc_utf8 && limit_col >= 0)
81c2858
      {
81c2858
! 	int ecol = curwin->w_cursor.col + 1;
81c2858
  
81c2858
  	/* Make sure the cursor is at the start of a character, but
81c2858
  	 * skip forward again when going too far back because of a
81c2858
--- 1970,1976 ----
81c2858
  #ifdef FEAT_MBYTE
81c2858
      if (enc_utf8 && limit_col >= 0)
81c2858
      {
81c2858
! 	colnr_T ecol = curwin->w_cursor.col + 1;
81c2858
  
81c2858
  	/* Make sure the cursor is at the start of a character, but
81c2858
  	 * skip forward again when going too far back because of a
81c2858
***************
81c2858
*** 1982,1988 ****
81c2858
  	}
81c2858
  	if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol)
81c2858
  	    return FALSE;
81c2858
! 	del_bytes((long)(ecol - curwin->w_cursor.col), FALSE, TRUE);
81c2858
      }
81c2858
      else
81c2858
  #endif
81c2858
--- 1986,1992 ----
81c2858
  	}
81c2858
  	if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol)
81c2858
  	    return FALSE;
81c2858
! 	del_bytes((long)((int)ecol - curwin->w_cursor.col), FALSE, TRUE);
81c2858
      }
81c2858
      else
81c2858
  #endif
81c2858
***************
81c2858
*** 2201,2207 ****
81c2858
  	    actual_compl_length = compl_length;
81c2858
  
81c2858
  	/* Allocate wide character array for the completion and fill it. */
81c2858
! 	wca = (int *)alloc(actual_len * sizeof(int));
81c2858
  	if (wca != NULL)
81c2858
  	{
81c2858
  	    p = str;
81c2858
--- 2205,2211 ----
81c2858
  	    actual_compl_length = compl_length;
81c2858
  
81c2858
  	/* Allocate wide character array for the completion and fill it. */
81c2858
! 	wca = (int *)alloc((unsigned)(actual_len * sizeof(int)));
81c2858
  	if (wca != NULL)
81c2858
  	{
81c2858
  	    p = str;
81c2858
***************
81c2858
*** 2580,2586 ****
81c2858
   */
81c2858
      void
81c2858
  set_completion(startcol, list)
81c2858
!     int	    startcol;
81c2858
      list_T  *list;
81c2858
  {
81c2858
      /* If already doing completions stop it. */
81c2858
--- 2584,2590 ----
81c2858
   */
81c2858
      void
81c2858
  set_completion(startcol, list)
81c2858
!     colnr_T startcol;
81c2858
      list_T  *list;
81c2858
  {
81c2858
      /* If already doing completions stop it. */
81c2858
***************
81c2858
*** 2591,2600 ****
81c2858
      if (stop_arrow() == FAIL)
81c2858
  	return;
81c2858
  
81c2858
!     if (startcol > (int)curwin->w_cursor.col)
81c2858
  	startcol = curwin->w_cursor.col;
81c2858
      compl_col = startcol;
81c2858
!     compl_length = curwin->w_cursor.col - startcol;
81c2858
      /* compl_pattern doesn't need to be set */
81c2858
      compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
81c2858
      if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
81c2858
--- 2595,2604 ----
81c2858
      if (stop_arrow() == FAIL)
81c2858
  	return;
81c2858
  
81c2858
!     if (startcol > curwin->w_cursor.col)
81c2858
  	startcol = curwin->w_cursor.col;
81c2858
      compl_col = startcol;
81c2858
!     compl_length = (int)curwin->w_cursor.col - (int)startcol;
81c2858
      /* compl_pattern doesn't need to be set */
81c2858
      compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
81c2858
      if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
81c2858
***************
81c2858
*** 2860,2866 ****
81c2858
      regmatch_T	regmatch;
81c2858
      char_u	**files;
81c2858
      int		count;
81c2858
-     int		i;
81c2858
      int		save_p_scs;
81c2858
      int		dir = compl_direction;
81c2858
  
81c2858
--- 2864,2869 ----
81c2858
***************
81c2858
*** 2892,2908 ****
81c2858
      if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
81c2858
      {
81c2858
  	char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\");
81c2858
  
81c2858
  	if (pat_esc == NULL)
81c2858
  	    goto theend;
81c2858
! 	i = (int)STRLEN(pat_esc) + 10;
81c2858
! 	ptr = alloc(i);
81c2858
  	if (ptr == NULL)
81c2858
  	{
81c2858
  	    vim_free(pat_esc);
81c2858
  	    goto theend;
81c2858
  	}
81c2858
! 	vim_snprintf((char *)ptr, i, "^\\s*\\zs\\V%s", pat_esc);
81c2858
  	regmatch.regprog = vim_regcomp(ptr, RE_MAGIC);
81c2858
  	vim_free(pat_esc);
81c2858
  	vim_free(ptr);
81c2858
--- 2895,2912 ----
81c2858
      if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
81c2858
      {
81c2858
  	char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\");
81c2858
+ 	size_t len;
81c2858
  
81c2858
  	if (pat_esc == NULL)
81c2858
  	    goto theend;
81c2858
! 	len = STRLEN(pat_esc) + 10;
81c2858
! 	ptr = alloc((unsigned)len);
81c2858
  	if (ptr == NULL)
81c2858
  	{
81c2858
  	    vim_free(pat_esc);
81c2858
  	    goto theend;
81c2858
  	}
81c2858
! 	vim_snprintf((char *)ptr, len, "^\\s*\\zs\\V%s", pat_esc);
81c2858
  	regmatch.regprog = vim_regcomp(ptr, RE_MAGIC);
81c2858
  	vim_free(pat_esc);
81c2858
  	vim_free(ptr);
81c2858
***************
81c2858
*** 2993,2999 ****
81c2858
  	{
81c2858
  	    vim_snprintf((char *)IObuff, IOSIZE,
81c2858
  			      _("Scanning dictionary: %s"), (char *)files[i]);
81c2858
! 	    msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  	}
81c2858
  
81c2858
  	if (fp != NULL)
81c2858
--- 2997,3003 ----
81c2858
  	{
81c2858
  	    vim_snprintf((char *)IObuff, IOSIZE,
81c2858
  			      _("Scanning dictionary: %s"), (char *)files[i]);
81c2858
! 	    (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  	}
81c2858
  
81c2858
  	if (fp != NULL)
81c2858
***************
81c2858
*** 3311,3317 ****
81c2858
      static int
81c2858
  ins_compl_len()
81c2858
  {
81c2858
!     int off = curwin->w_cursor.col - compl_col;
81c2858
  
81c2858
      if (off < 0)
81c2858
  	return 0;
81c2858
--- 3315,3321 ----
81c2858
      static int
81c2858
  ins_compl_len()
81c2858
  {
81c2858
!     int off = (int)curwin->w_cursor.col - (int)compl_col;
81c2858
  
81c2858
      if (off < 0)
81c2858
  	return 0;
81c2858
***************
81c2858
*** 3347,3353 ****
81c2858
  
81c2858
      vim_free(compl_leader);
81c2858
      compl_leader = vim_strnsave(ml_get_curline() + compl_col,
81c2858
! 					    curwin->w_cursor.col - compl_col);
81c2858
      if (compl_leader != NULL)
81c2858
  	ins_compl_new_leader();
81c2858
  }
81c2858
--- 3351,3357 ----
81c2858
  
81c2858
      vim_free(compl_leader);
81c2858
      compl_leader = vim_strnsave(ml_get_curline() + compl_col,
81c2858
! 				     (int)(curwin->w_cursor.col - compl_col));
81c2858
      if (compl_leader != NULL)
81c2858
  	ins_compl_new_leader();
81c2858
  }
81c2858
***************
81c2858
*** 3395,3401 ****
81c2858
  ins_compl_addfrommatch()
81c2858
  {
81c2858
      char_u	*p;
81c2858
!     int		len = curwin->w_cursor.col - compl_col;
81c2858
      int		c;
81c2858
      compl_T	*cp;
81c2858
  
81c2858
--- 3399,3405 ----
81c2858
  ins_compl_addfrommatch()
81c2858
  {
81c2858
      char_u	*p;
81c2858
!     int		len = (int)curwin->w_cursor.col - (int)compl_col;
81c2858
      int		c;
81c2858
      compl_T	*cp;
81c2858
  
81c2858
***************
81c2858
*** 3961,3967 ****
81c2858
  			    : ins_buf->b_sfname == NULL
81c2858
  				? (char *)ins_buf->b_fname
81c2858
  				: (char *)ins_buf->b_sfname);
81c2858
! 		msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  	    }
81c2858
  	    else if (*e_cpt == NUL)
81c2858
  		break;
81c2858
--- 3965,3971 ----
81c2858
  			    : ins_buf->b_sfname == NULL
81c2858
  				? (char *)ins_buf->b_fname
81c2858
  				: (char *)ins_buf->b_sfname);
81c2858
! 		(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  	    }
81c2858
  	    else if (*e_cpt == NUL)
81c2858
  		break;
81c2858
***************
81c2858
*** 3991,3997 ****
81c2858
  		{
81c2858
  		    type = CTRL_X_TAGS;
81c2858
  		    sprintf((char*)IObuff, _("Scanning tags."));
81c2858
! 		    msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  		}
81c2858
  		else
81c2858
  		    type = -1;
81c2858
--- 3995,4001 ----
81c2858
  		{
81c2858
  		    type = CTRL_X_TAGS;
81c2858
  		    sprintf((char*)IObuff, _("Scanning tags."));
81c2858
! 		    (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
81c2858
  		}
81c2858
  		else
81c2858
  		    type = -1;
81c2858
***************
81c2858
*** 6320,6326 ****
81c2858
  	    ins_need_undo = FALSE;
81c2858
  	}
81c2858
  	Insstart = curwin->w_cursor;	/* new insertion starts here */
81c2858
! 	Insstart_textlen = linetabsize(ml_get_curline());
81c2858
  	ai_col = 0;
81c2858
  #ifdef FEAT_VREPLACE
81c2858
  	if (State & VREPLACE_FLAG)
81c2858
--- 6324,6330 ----
81c2858
  	    ins_need_undo = FALSE;
81c2858
  	}
81c2858
  	Insstart = curwin->w_cursor;	/* new insertion starts here */
81c2858
! 	Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
81c2858
  	ai_col = 0;
81c2858
  #ifdef FEAT_VREPLACE
81c2858
  	if (State & VREPLACE_FLAG)
81c2858
*** ../vim-7.2.166/src/ex_cmds.c	2009-04-29 18:44:38.000000000 +0200
81c2858
--- src/ex_cmds.c	2009-05-05 17:55:40.000000000 +0200
81c2858
***************
81c2858
*** 1789,1795 ****
81c2858
  	 * overwrite a user's viminfo file after a "su root", with a
81c2858
  	 * viminfo file that the user can't read.
81c2858
  	 */
81c2858
! 	st_old.st_dev = 0;
81c2858
  	st_old.st_ino = 0;
81c2858
  	st_old.st_mode = 0600;
81c2858
  	if (mch_stat((char *)fname, &st_old) == 0
81c2858
--- 1789,1795 ----
81c2858
  	 * overwrite a user's viminfo file after a "su root", with a
81c2858
  	 * viminfo file that the user can't read.
81c2858
  	 */
81c2858
! 	st_old.st_dev = (dev_t)0;
81c2858
  	st_old.st_ino = 0;
81c2858
  	st_old.st_mode = 0600;
81c2858
  	if (mch_stat((char *)fname, &st_old) == 0
81c2858
***************
81c2858
*** 3715,3721 ****
81c2858
      /* If the window options were changed may need to set the spell language.
81c2858
       * Can only do this after the buffer has been properly setup. */
81c2858
      if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
81c2858
! 	did_set_spelllang(curbuf);
81c2858
  #endif
81c2858
  
81c2858
      if (command == NULL)
81c2858
--- 3715,3721 ----
81c2858
      /* If the window options were changed may need to set the spell language.
81c2858
       * Can only do this after the buffer has been properly setup. */
81c2858
      if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
81c2858
! 	(void)did_set_spelllang(curbuf);
81c2858
  #endif
81c2858
  
81c2858
      if (command == NULL)
81c2858
***************
81c2858
*** 3788,3794 ****
81c2858
  
81c2858
  #ifdef FEAT_KEYMAP
81c2858
      if (curbuf->b_kmap_state & KEYMAP_INIT)
81c2858
! 	keymap_init();
81c2858
  #endif
81c2858
  
81c2858
      --RedrawingDisabled;
81c2858
--- 3788,3794 ----
81c2858
  
81c2858
  #ifdef FEAT_KEYMAP
81c2858
      if (curbuf->b_kmap_state & KEYMAP_INIT)
81c2858
! 	(void)keymap_init();
81c2858
  #endif
81c2858
  
81c2858
      --RedrawingDisabled;
81c2858
*** ../vim-7.2.166/src/globals.h	2009-03-05 03:13:51.000000000 +0100
81c2858
--- src/globals.h	2009-05-09 21:14:49.000000000 +0200
81c2858
***************
81c2858
*** 524,530 ****
81c2858
  EXTERN win_T	*prevwin INIT(= NULL);	/* previous window */
81c2858
  # define W_NEXT(wp) ((wp)->w_next)
81c2858
  # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
81c2858
! #define FOR_ALL_TAB_WINDOWS(tp, wp) \
81c2858
      for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
81c2858
  	for ((wp) = ((tp) == curtab) \
81c2858
  		? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
81c2858
--- 524,530 ----
81c2858
  EXTERN win_T	*prevwin INIT(= NULL);	/* previous window */
81c2858
  # define W_NEXT(wp) ((wp)->w_next)
81c2858
  # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
81c2858
! # define FOR_ALL_TAB_WINDOWS(tp, wp) \
81c2858
      for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
81c2858
  	for ((wp) = ((tp) == curtab) \
81c2858
  		? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
81c2858
***************
81c2858
*** 718,724 ****
81c2858
  
81c2858
  EXTERN pos_T	saved_cursor		/* w_cursor before formatting text. */
81c2858
  # ifdef DO_INIT
81c2858
! 	= INIT_POS_T
81c2858
  # endif
81c2858
  	;
81c2858
  
81c2858
--- 718,724 ----
81c2858
  
81c2858
  EXTERN pos_T	saved_cursor		/* w_cursor before formatting text. */
81c2858
  # ifdef DO_INIT
81c2858
! 	= INIT_POS_T(0, 0, 0)
81c2858
  # endif
81c2858
  	;
81c2858
  
81c2858
***************
81c2858
*** 1039,1045 ****
81c2858
  EXTERN int	did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
81c2858
  EXTERN pos_T	last_cursormoved	    /* for CursorMoved event */
81c2858
  # ifdef DO_INIT
81c2858
! 			= INIT_POS_T
81c2858
  # endif
81c2858
  			;
81c2858
  #endif
81c2858
--- 1039,1045 ----
81c2858
  EXTERN int	did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
81c2858
  EXTERN pos_T	last_cursormoved	    /* for CursorMoved event */
81c2858
  # ifdef DO_INIT
81c2858
! 			= INIT_POS_T(0, 0, 0)
81c2858
  # endif
81c2858
  			;
81c2858
  #endif
81c2858
*** ../vim-7.2.166/src/ops.c	2009-04-29 17:39:17.000000000 +0200
81c2858
--- src/ops.c	2009-05-13 12:41:02.000000000 +0200
81c2858
***************
81c2858
*** 6400,6406 ****
81c2858
  	    {
81c2858
  		getvcols(curwin, &min_pos, &max_pos, &min_pos.col,
81c2858
  								&max_pos.col);
81c2858
! 		sprintf((char *)buf1, _("%ld Cols; "),
81c2858
  			(long)(oparg.end_vcol - oparg.start_vcol + 1));
81c2858
  	    }
81c2858
  	    else
81c2858
--- 6400,6406 ----
81c2858
  	    {
81c2858
  		getvcols(curwin, &min_pos, &max_pos, &min_pos.col,
81c2858
  								&max_pos.col);
81c2858
! 		vim_snprintf((char *)buf1, sizeof(buf1), _("%ld Cols; "),
81c2858
  			(long)(oparg.end_vcol - oparg.start_vcol + 1));
81c2858
  	    }
81c2858
  	    else
81c2858
***************
81c2858
*** 6408,6420 ****
81c2858
  
81c2858
  	    if (char_count_cursor == byte_count_cursor
81c2858
  						  && char_count == byte_count)
81c2858
! 		sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"),
81c2858
  			buf1, line_count_selected,
81c2858
  			(long)curbuf->b_ml.ml_line_count,
81c2858
  			word_count_cursor, word_count,
81c2858
  			byte_count_cursor, byte_count);
81c2858
  	    else
81c2858
! 		sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Chars; %ld of %ld Bytes"),
81c2858
  			buf1, line_count_selected,
81c2858
  			(long)curbuf->b_ml.ml_line_count,
81c2858
  			word_count_cursor, word_count,
81c2858
--- 6408,6422 ----
81c2858
  
81c2858
  	    if (char_count_cursor == byte_count_cursor
81c2858
  						  && char_count == byte_count)
81c2858
! 		vim_snprintf((char *)IObuff, IOSIZE,
81c2858
! 			_("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"),
81c2858
  			buf1, line_count_selected,
81c2858
  			(long)curbuf->b_ml.ml_line_count,
81c2858
  			word_count_cursor, word_count,
81c2858
  			byte_count_cursor, byte_count);
81c2858
  	    else
81c2858
! 		vim_snprintf((char *)IObuff, IOSIZE,
81c2858
! 			_("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Chars; %ld of %ld Bytes"),
81c2858
  			buf1, line_count_selected,
81c2858
  			(long)curbuf->b_ml.ml_line_count,
81c2858
  			word_count_cursor, word_count,
81c2858
***************
81c2858
*** 6426,6445 ****
81c2858
  	{
81c2858
  	    p = ml_get_curline();
81c2858
  	    validate_virtcol();
81c2858
! 	    col_print(buf1, (int)curwin->w_cursor.col + 1,
81c2858
  		    (int)curwin->w_virtcol + 1);
81c2858
! 	    col_print(buf2, (int)STRLEN(p), linetabsize(p));
81c2858
  
81c2858
  	    if (char_count_cursor == byte_count_cursor
81c2858
  		    && char_count == byte_count)
81c2858
! 		sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"),
81c2858
  		    (char *)buf1, (char *)buf2,
81c2858
  		    (long)curwin->w_cursor.lnum,
81c2858
  		    (long)curbuf->b_ml.ml_line_count,
81c2858
  		    word_count_cursor, word_count,
81c2858
  		    byte_count_cursor, byte_count);
81c2858
  	    else
81c2858
! 		sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Char %ld of %ld; Byte %ld of %ld"),
81c2858
  		    (char *)buf1, (char *)buf2,
81c2858
  		    (long)curwin->w_cursor.lnum,
81c2858
  		    (long)curbuf->b_ml.ml_line_count,
81c2858
--- 6428,6449 ----
81c2858
  	{
81c2858
  	    p = ml_get_curline();
81c2858
  	    validate_virtcol();
81c2858
! 	    col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1,
81c2858
  		    (int)curwin->w_virtcol + 1);
81c2858
! 	    col_print(buf2, sizeof(buf2), (int)STRLEN(p), linetabsize(p));
81c2858
  
81c2858
  	    if (char_count_cursor == byte_count_cursor
81c2858
  		    && char_count == byte_count)
81c2858
! 		vim_snprintf((char *)IObuff, IOSIZE,
81c2858
! 		    _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"),
81c2858
  		    (char *)buf1, (char *)buf2,
81c2858
  		    (long)curwin->w_cursor.lnum,
81c2858
  		    (long)curbuf->b_ml.ml_line_count,
81c2858
  		    word_count_cursor, word_count,
81c2858
  		    byte_count_cursor, byte_count);
81c2858
  	    else
81c2858
! 		vim_snprintf((char *)IObuff, IOSIZE,
81c2858
! 		    _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Char %ld of %ld; Byte %ld of %ld"),
81c2858
  		    (char *)buf1, (char *)buf2,
81c2858
  		    (long)curwin->w_cursor.lnum,
81c2858
  		    (long)curbuf->b_ml.ml_line_count,
81c2858
*** ../vim-7.2.166/src/os_unix.c	2009-03-02 02:44:54.000000000 +0100
81c2858
--- src/os_unix.c	2009-05-05 17:35:58.000000000 +0200
81c2858
***************
81c2858
*** 199,205 ****
81c2858
  #endif
81c2858
  
81c2858
  #ifndef SIG_ERR
81c2858
! # define SIG_ERR	((RETSIGTYPE (*)())-1)
81c2858
  #endif
81c2858
  
81c2858
  /* volatile because it is used in signal handler sig_winch(). */
81c2858
--- 199,207 ----
81c2858
  #endif
81c2858
  
81c2858
  #ifndef SIG_ERR
81c2858
! # ifndef S_SPLINT_S
81c2858
! #  define SIG_ERR	((RETSIGTYPE (*)())-1)
81c2858
! # endif
81c2858
  #endif
81c2858
  
81c2858
  /* volatile because it is used in signal handler sig_winch(). */
81c2858
***************
81c2858
*** 441,447 ****
81c2858
  
81c2858
  #if defined(HAVE_TOTAL_MEM) || defined(PROTO)
81c2858
  # ifdef HAVE_SYS_RESOURCE_H
81c2858
! #  include <sys/resource.h>
81c2858
  # endif
81c2858
  # if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL)
81c2858
  #  include <sys/sysctl.h>
81c2858
--- 443,451 ----
81c2858
  
81c2858
  #if defined(HAVE_TOTAL_MEM) || defined(PROTO)
81c2858
  # ifdef HAVE_SYS_RESOURCE_H
81c2858
! #  ifndef S_SPLINT_S  /* splint crashes on bits/resource.h */
81c2858
! #   include <sys/resource.h>
81c2858
! #  endif
81c2858
  # endif
81c2858
  # if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL)
81c2858
  #  include <sys/sysctl.h>
81c2858
*** ../vim-7.2.166/src/os_unix.h	2008-06-20 18:06:36.000000000 +0200
81c2858
--- src/os_unix.h	2009-05-05 17:07:45.000000000 +0200
81c2858
***************
81c2858
*** 53,59 ****
81c2858
  #endif
81c2858
  
81c2858
  #ifdef HAVE_UNISTD_H
81c2858
! # include <unistd.h>
81c2858
  #endif
81c2858
  
81c2858
  #ifdef HAVE_LIBC_H
81c2858
--- 53,61 ----
81c2858
  #endif
81c2858
  
81c2858
  #ifdef HAVE_UNISTD_H
81c2858
! # ifndef S_SPLINT_S  /* splint crashes on bits/confname.h */
81c2858
! #  include <unistd.h>
81c2858
! # endif
81c2858
  #endif
81c2858
  
81c2858
  #ifdef HAVE_LIBC_H
81c2858
*** ../vim-7.2.166/src/proto/buffer.pro	2008-11-15 14:10:23.000000000 +0100
81c2858
--- src/proto/buffer.pro	2009-05-13 12:23:41.000000000 +0200
81c2858
***************
81c2858
*** 37,49 ****
81c2858
  int otherfile __ARGS((char_u *ffname));
81c2858
  void buf_setino __ARGS((buf_T *buf));
81c2858
  void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
81c2858
! void col_print __ARGS((char_u *buf, int col, int vcol));
81c2858
  void maketitle __ARGS((void));
81c2858
  void resettitle __ARGS((void));
81c2858
  void free_titles __ARGS((void));
81c2858
  int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
81c2858
! void get_rel_pos __ARGS((win_T *wp, char_u *str));
81c2858
! int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
81c2858
  char_u *fix_fname __ARGS((char_u *fname));
81c2858
  void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
81c2858
  char_u *alist_name __ARGS((aentry_T *aep));
81c2858
--- 37,48 ----
81c2858
  int otherfile __ARGS((char_u *ffname));
81c2858
  void buf_setino __ARGS((buf_T *buf));
81c2858
  void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
81c2858
! void col_print __ARGS((char_u *buf, size_t buflen, int col, int vcol));
81c2858
  void maketitle __ARGS((void));
81c2858
  void resettitle __ARGS((void));
81c2858
  void free_titles __ARGS((void));
81c2858
  int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
81c2858
! void get_rel_pos __ARGS((win_T *wp, char_u *buf, int buflen));
81c2858
  char_u *fix_fname __ARGS((char_u *fname));
81c2858
  void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
81c2858
  char_u *alist_name __ARGS((aentry_T *aep));
81c2858
***************
81c2858
*** 54,61 ****
81c2858
  void write_viminfo_bufferlist __ARGS((FILE *fp));
81c2858
  char *buf_spname __ARGS((buf_T *buf));
81c2858
  void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
81c2858
! int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
81c2858
! int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
81c2858
  linenr_T buf_delsign __ARGS((buf_T *buf, int id));
81c2858
  int buf_findsign __ARGS((buf_T *buf, int id));
81c2858
  int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
81c2858
--- 53,60 ----
81c2858
  void write_viminfo_bufferlist __ARGS((FILE *fp));
81c2858
  char *buf_spname __ARGS((buf_T *buf));
81c2858
  void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
81c2858
! linenr_T buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
81c2858
! int buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
81c2858
  linenr_T buf_delsign __ARGS((buf_T *buf, int id));
81c2858
  int buf_findsign __ARGS((buf_T *buf, int id));
81c2858
  int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
81c2858
*** ../vim-7.2.166/src/proto/edit.pro	2008-01-16 20:03:13.000000000 +0100
81c2858
--- src/proto/edit.pro	2009-05-05 20:51:56.000000000 +0200
81c2858
***************
81c2858
*** 8,14 ****
81c2858
  void backspace_until_column __ARGS((int col));
81c2858
  int vim_is_ctrl_x_key __ARGS((int c));
81c2858
  int ins_compl_add_infercase __ARGS((char_u *str, int len, int icase, char_u *fname, int dir, int flags));
81c2858
! void set_completion __ARGS((int startcol, list_T *list));
81c2858
  void ins_compl_show_pum __ARGS((void));
81c2858
  char_u *find_word_start __ARGS((char_u *ptr));
81c2858
  char_u *find_word_end __ARGS((char_u *ptr));
81c2858
--- 8,14 ----
81c2858
  void backspace_until_column __ARGS((int col));
81c2858
  int vim_is_ctrl_x_key __ARGS((int c));
81c2858
  int ins_compl_add_infercase __ARGS((char_u *str, int len, int icase, char_u *fname, int dir, int flags));
81c2858
! void set_completion __ARGS((colnr_T startcol, list_T *list));
81c2858
  void ins_compl_show_pum __ARGS((void));
81c2858
  char_u *find_word_start __ARGS((char_u *ptr));
81c2858
  char_u *find_word_end __ARGS((char_u *ptr));
81c2858
*** ../vim-7.2.166/src/screen.c	2009-03-18 19:07:09.000000000 +0100
81c2858
--- src/screen.c	2009-05-05 17:42:45.000000000 +0200
81c2858
***************
81c2858
*** 9481,9493 ****
81c2858
      win_T	*wp;
81c2858
      int		always;
81c2858
  {
81c2858
!     char_u	buffer[70];
81c2858
      int		row;
81c2858
      int		fillchar;
81c2858
      int		attr;
81c2858
      int		empty_line = FALSE;
81c2858
      colnr_T	virtcol;
81c2858
      int		i;
81c2858
      int		o;
81c2858
  #ifdef FEAT_VERTSPLIT
81c2858
      int		this_ru_col;
81c2858
--- 9481,9495 ----
81c2858
      win_T	*wp;
81c2858
      int		always;
81c2858
  {
81c2858
! #define RULER_BUF_LEN 70
81c2858
!     char_u	buffer[RULER_BUF_LEN];
81c2858
      int		row;
81c2858
      int		fillchar;
81c2858
      int		attr;
81c2858
      int		empty_line = FALSE;
81c2858
      colnr_T	virtcol;
81c2858
      int		i;
81c2858
+     size_t	len;
81c2858
      int		o;
81c2858
  #ifdef FEAT_VERTSPLIT
81c2858
      int		this_ru_col;
81c2858
***************
81c2858
*** 9602,9612 ****
81c2858
  	 * Some sprintfs return the length, some return a pointer.
81c2858
  	 * To avoid portability problems we use strlen() here.
81c2858
  	 */
81c2858
! 	sprintf((char *)buffer, "%ld,",
81c2858
  		(wp->w_buffer->b_ml.ml_flags & ML_EMPTY)
81c2858
  		    ? 0L
81c2858
  		    : (long)(wp->w_cursor.lnum));
81c2858
! 	col_print(buffer + STRLEN(buffer),
81c2858
  			empty_line ? 0 : (int)wp->w_cursor.col + 1,
81c2858
  			(int)virtcol + 1);
81c2858
  
81c2858
--- 9604,9615 ----
81c2858
  	 * Some sprintfs return the length, some return a pointer.
81c2858
  	 * To avoid portability problems we use strlen() here.
81c2858
  	 */
81c2858
! 	vim_snprintf((char *)buffer, RULER_BUF_LEN, "%ld,",
81c2858
  		(wp->w_buffer->b_ml.ml_flags & ML_EMPTY)
81c2858
  		    ? 0L
81c2858
  		    : (long)(wp->w_cursor.lnum));
81c2858
! 	len = STRLEN(buffer);
81c2858
! 	col_print(buffer + len, RULER_BUF_LEN - len,
81c2858
  			empty_line ? 0 : (int)wp->w_cursor.col + 1,
81c2858
  			(int)virtcol + 1);
81c2858
  
81c2858
***************
81c2858
*** 9616,9622 ****
81c2858
  	 * screen up on some terminals).
81c2858
  	 */
81c2858
  	i = (int)STRLEN(buffer);
81c2858
! 	get_rel_pos(wp, buffer + i + 1);
81c2858
  	o = i + vim_strsize(buffer + i + 1);
81c2858
  #ifdef FEAT_WINDOWS
81c2858
  	if (wp->w_status_height == 0)	/* can't use last char of screen */
81c2858
--- 9619,9625 ----
81c2858
  	 * screen up on some terminals).
81c2858
  	 */
81c2858
  	i = (int)STRLEN(buffer);
81c2858
! 	get_rel_pos(wp, buffer + i + 1, RULER_BUF_LEN - i - 1);
81c2858
  	o = i + vim_strsize(buffer + i + 1);
81c2858
  #ifdef FEAT_WINDOWS
81c2858
  	if (wp->w_status_height == 0)	/* can't use last char of screen */
81c2858
***************
81c2858
*** 9643,9649 ****
81c2858
  		    buffer[i++] = fillchar;
81c2858
  		++o;
81c2858
  	    }
81c2858
! 	    get_rel_pos(wp, buffer + i);
81c2858
  	}
81c2858
  	/* Truncate at window boundary. */
81c2858
  #ifdef FEAT_MBYTE
81c2858
--- 9646,9652 ----
81c2858
  		    buffer[i++] = fillchar;
81c2858
  		++o;
81c2858
  	    }
81c2858
! 	    get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i);
81c2858
  	}
81c2858
  	/* Truncate at window boundary. */
81c2858
  #ifdef FEAT_MBYTE
81c2858
*** ../vim-7.2.166/src/structs.h	2008-11-15 16:05:30.000000000 +0100
81c2858
--- src/structs.h	2009-05-05 18:20:36.000000000 +0200
81c2858
***************
81c2858
*** 33,41 ****
81c2858
  } pos_T;
81c2858
  
81c2858
  #ifdef FEAT_VIRTUALEDIT
81c2858
! # define INIT_POS_T {0, 0, 0}
81c2858
  #else
81c2858
! # define INIT_POS_T {0, 0}
81c2858
  #endif
81c2858
  
81c2858
  /*
81c2858
--- 33,41 ----
81c2858
  } pos_T;
81c2858
  
81c2858
  #ifdef FEAT_VIRTUALEDIT
81c2858
! # define INIT_POS_T(l, c, ca) {l, c, ca}
81c2858
  #else
81c2858
! # define INIT_POS_T(l, c, ca) {l, c}
81c2858
  #endif
81c2858
  
81c2858
  /*
81c2858
***************
81c2858
*** 1166,1172 ****
81c2858
      char_u	*b_fname;	/* current file name */
81c2858
  
81c2858
  #ifdef UNIX
81c2858
!     int		b_dev;		/* device number (-1 if not set) */
81c2858
      ino_t	b_ino;		/* inode number */
81c2858
  #endif
81c2858
  #ifdef FEAT_CW_EDITOR
81c2858
--- 1166,1172 ----
81c2858
      char_u	*b_fname;	/* current file name */
81c2858
  
81c2858
  #ifdef UNIX
81c2858
!     dev_t	b_dev;		/* device number (-1 if not set) */
81c2858
      ino_t	b_ino;		/* inode number */
81c2858
  #endif
81c2858
  #ifdef FEAT_CW_EDITOR
81c2858
***************
81c2858
*** 1645,1651 ****
81c2858
--- 1645,1655 ----
81c2858
  #endif
81c2858
  #ifdef FEAT_DIFF
81c2858
      diff_T	    *tp_first_diff;
81c2858
+ # ifdef S_SPLINT_S  /* splint doesn't understand the array of pointers */
81c2858
+     buf_T	    **tp_diffbuf;
81c2858
+ # else
81c2858
      buf_T	    *(tp_diffbuf[DB_COUNT]);
81c2858
+ # endif
81c2858
      int		    tp_diff_invalid;	/* list of diffs is outdated */
81c2858
  #endif
81c2858
      frame_T	    *tp_snapshot;    /* window layout snapshot */
81c2858
*** ../vim-7.2.166/src/version.c	2009-04-29 18:44:38.000000000 +0200
81c2858
--- src/version.c	2009-05-13 12:06:36.000000000 +0200
81c2858
***************
81c2858
*** 678,679 ****
81c2858
--- 678,681 ----
81c2858
  {   /* Add new patch number below this line */
81c2858
+ /**/
81c2858
+     167,
81c2858
  /**/
81c2858
81c2858
-- 
81c2858
Snoring is prohibited unless all bedroom windows are closed and securely
81c2858
locked.
81c2858
		[real standing law in Massachusetts, United States of America]
81c2858
81c2858
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
81c2858
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81c2858
\\\        download, build and distribute -- http://www.A-A-P.org        ///
81c2858
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///