Karsten Hopp f93751
To: vim_dev@googlegroups.com
Karsten Hopp f93751
Subject: Patch 7.3.161
Karsten Hopp f93751
Fcc: outbox
Karsten Hopp f93751
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f93751
Mime-Version: 1.0
Karsten Hopp f93751
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f93751
Content-Transfer-Encoding: 8bit
Karsten Hopp f93751
------------
Karsten Hopp f93751
Karsten Hopp f93751
Patch 7.3.161
Karsten Hopp f93751
Problem:    Items on the stack may be too big.
Karsten Hopp f93751
Solution:   Make items static or allocate them.
Karsten Hopp f93751
Files:	    src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
Karsten Hopp f93751
	    src/fileio.c, src/hardcopy.c, src/quickfix.c, src/main.c,
Karsten Hopp f93751
	    src/netbeans.c, src/spell.c, src/tag.c, src/vim.h, src/xxd/xxd.c
Karsten Hopp f93751
Karsten Hopp f93751
Karsten Hopp f93751
*** ../vim-7.3.160/src/eval.c	2011-04-11 13:46:07.000000000 +0200
Karsten Hopp f93751
--- src/eval.c	2011-04-11 21:05:50.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 11100,11117 ****
Karsten Hopp f93751
      typval_T	*argvars UNUSED;
Karsten Hopp f93751
      typval_T	*rettv;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	cwd[MAXPATHL];
Karsten Hopp f93751
  
Karsten Hopp f93751
      rettv->v_type = VAR_STRING;
Karsten Hopp f93751
!     if (mch_dirname(cwd, MAXPATHL) == FAIL)
Karsten Hopp f93751
! 	rettv->vval.v_string = NULL;
Karsten Hopp f93751
!     else
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	rettv->vval.v_string = vim_strsave(cwd);
Karsten Hopp f93751
  #ifdef BACKSLASH_IN_FILENAME
Karsten Hopp f93751
! 	if (rettv->vval.v_string != NULL)
Karsten Hopp f93751
! 	    slash_adjust(rettv->vval.v_string);
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
      }
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
--- 11100,11121 ----
Karsten Hopp f93751
      typval_T	*argvars UNUSED;
Karsten Hopp f93751
      typval_T	*rettv;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*cwd;
Karsten Hopp f93751
  
Karsten Hopp f93751
      rettv->v_type = VAR_STRING;
Karsten Hopp f93751
!     rettv->vval.v_string = NULL;
Karsten Hopp f93751
!     cwd = alloc(MAXPATHL);
Karsten Hopp f93751
!     if (cwd != NULL)
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	if (mch_dirname(cwd, MAXPATHL) != FAIL)
Karsten Hopp f93751
! 	{
Karsten Hopp f93751
! 	    rettv->vval.v_string = vim_strsave(cwd);
Karsten Hopp f93751
  #ifdef BACKSLASH_IN_FILENAME
Karsten Hopp f93751
! 	    if (rettv->vval.v_string != NULL)
Karsten Hopp f93751
! 		slash_adjust(rettv->vval.v_string);
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
+ 	}
Karsten Hopp f93751
+ 	vim_free(cwd);
Karsten Hopp f93751
      }
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 14938,14943 ****
Karsten Hopp f93751
--- 14942,14950 ----
Karsten Hopp f93751
      typval_T	*rettv;
Karsten Hopp f93751
  {
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
+ #ifdef HAVE_READLINK
Karsten Hopp f93751
+     char_u	*buf = NULL;
Karsten Hopp f93751
+ #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      p = get_tv_string(&argvars[0]);
Karsten Hopp f93751
  #ifdef FEAT_SHORTCUT
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 14953,14959 ****
Karsten Hopp f93751
  #else
Karsten Hopp f93751
  # ifdef HAVE_READLINK
Karsten Hopp f93751
      {
Karsten Hopp f93751
- 	char_u	buf[MAXPATHL + 1];
Karsten Hopp f93751
  	char_u	*cpy;
Karsten Hopp f93751
  	int	len;
Karsten Hopp f93751
  	char_u	*remain = NULL;
Karsten Hopp f93751
--- 14960,14965 ----
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 14981,14986 ****
Karsten Hopp f93751
--- 14987,14996 ----
Karsten Hopp f93751
  	    q[-1] = NUL;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
+ 	buf = alloc(MAXPATHL + 1);
Karsten Hopp f93751
+ 	if (buf == NULL)
Karsten Hopp f93751
+ 	    goto fail;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
  	for (;;)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    for (;;)
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 15124,15129 ****
Karsten Hopp f93751
--- 15134,15140 ----
Karsten Hopp f93751
  
Karsten Hopp f93751
  #ifdef HAVE_READLINK
Karsten Hopp f93751
  fail:
Karsten Hopp f93751
+     vim_free(buf);
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
      rettv->v_type = VAR_STRING;
Karsten Hopp f93751
  }
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 17604,17621 ****
Karsten Hopp f93751
      typval_T	*argvars UNUSED;
Karsten Hopp f93751
      typval_T	*rettv;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	fname[MAXPATHL + 1];
Karsten Hopp f93751
      tagname_T	tn;
Karsten Hopp f93751
      int		first;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp f93751
  	return;
Karsten Hopp f93751
  
Karsten Hopp f93751
      for (first = TRUE; ; first = FALSE)
Karsten Hopp f93751
  	if (get_tagfname(&tn, first, fname) == FAIL
Karsten Hopp f93751
  		|| list_append_string(rettv->vval.v_list, fname, -1) == FAIL)
Karsten Hopp f93751
  	    break;
Karsten Hopp f93751
      tagname_free(&tn;;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
--- 17615,17636 ----
Karsten Hopp f93751
      typval_T	*argvars UNUSED;
Karsten Hopp f93751
      typval_T	*rettv;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*fname;
Karsten Hopp f93751
      tagname_T	tn;
Karsten Hopp f93751
      int		first;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (rettv_list_alloc(rettv) == FAIL)
Karsten Hopp f93751
  	return;
Karsten Hopp f93751
+     fname = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (fname == NULL)
Karsten Hopp f93751
+ 	return;
Karsten Hopp f93751
  
Karsten Hopp f93751
      for (first = TRUE; ; first = FALSE)
Karsten Hopp f93751
  	if (get_tagfname(&tn, first, fname) == FAIL
Karsten Hopp f93751
  		|| list_append_string(rettv->vval.v_list, fname, -1) == FAIL)
Karsten Hopp f93751
  	    break;
Karsten Hopp f93751
      tagname_free(&tn;;
Karsten Hopp f93751
+     vim_free(fname);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
*** ../vim-7.3.160/src/ex_cmds.c	2011-02-01 13:48:47.000000000 +0100
Karsten Hopp f93751
--- src/ex_cmds.c	2011-04-11 20:51:34.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2777,2783 ****
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	    if (p_confirm || cmdmod.confirm)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u	buff[IOSIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
Karsten Hopp f93751
  		if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
Karsten Hopp f93751
--- 2777,2783 ----
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	    if (p_confirm || cmdmod.confirm)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u	buff[DIALOG_MSG_SIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
Karsten Hopp f93751
  		if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2795,2801 ****
Karsten Hopp f93751
  	/* For ":w! filename" check that no swap file exists for "filename". */
Karsten Hopp f93751
  	if (other && !emsg_silent)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    char_u	dir[MAXPATHL];
Karsten Hopp f93751
  	    char_u	*p;
Karsten Hopp f93751
  	    int		r;
Karsten Hopp f93751
  	    char_u	*swapname;
Karsten Hopp f93751
--- 2795,2801 ----
Karsten Hopp f93751
  	/* For ":w! filename" check that no swap file exists for "filename". */
Karsten Hopp f93751
  	if (other && !emsg_silent)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    char_u	*dir;
Karsten Hopp f93751
  	    char_u	*p;
Karsten Hopp f93751
  	    int		r;
Karsten Hopp f93751
  	    char_u	*swapname;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2806,2825 ****
Karsten Hopp f93751
  	     * Use 'shortname' of the current buffer, since there is no buffer
Karsten Hopp f93751
  	     * for the written file. */
Karsten Hopp f93751
  	    if (*p_dir == NUL)
Karsten Hopp f93751
  		STRCPY(dir, ".");
Karsten Hopp f93751
  	    else
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		p = p_dir;
Karsten Hopp f93751
  		copy_option_part(&p, dir, MAXPATHL, ",");
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    swapname = makeswapname(fname, ffname, curbuf, dir);
Karsten Hopp f93751
  	    r = vim_fexists(swapname);
Karsten Hopp f93751
  	    if (r)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  		if (p_confirm || cmdmod.confirm)
Karsten Hopp f93751
  		{
Karsten Hopp f93751
! 		    char_u	buff[IOSIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		    dialog_msg(buff,
Karsten Hopp f93751
  			    _("Swap file \"%s\" exists, overwrite anyway?"),
Karsten Hopp f93751
--- 2806,2834 ----
Karsten Hopp f93751
  	     * Use 'shortname' of the current buffer, since there is no buffer
Karsten Hopp f93751
  	     * for the written file. */
Karsten Hopp f93751
  	    if (*p_dir == NUL)
Karsten Hopp f93751
+ 	    {
Karsten Hopp f93751
+ 		dir = alloc(5);
Karsten Hopp f93751
+ 		if (dir == NULL)
Karsten Hopp f93751
+ 		    return FAIL;
Karsten Hopp f93751
  		STRCPY(dir, ".");
Karsten Hopp f93751
+ 	    }
Karsten Hopp f93751
  	    else
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
+ 		dir = alloc(MAXPATHL);
Karsten Hopp f93751
+ 		if (dir == NULL)
Karsten Hopp f93751
+ 		    return FAIL;
Karsten Hopp f93751
  		p = p_dir;
Karsten Hopp f93751
  		copy_option_part(&p, dir, MAXPATHL, ",");
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    swapname = makeswapname(fname, ffname, curbuf, dir);
Karsten Hopp f93751
+ 	    vim_free(dir);
Karsten Hopp f93751
  	    r = vim_fexists(swapname);
Karsten Hopp f93751
  	    if (r)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  		if (p_confirm || cmdmod.confirm)
Karsten Hopp f93751
  		{
Karsten Hopp f93751
! 		    char_u	buff[DIALOG_MSG_SIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		    dialog_msg(buff,
Karsten Hopp f93751
  			    _("Swap file \"%s\" exists, overwrite anyway?"),
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2969,2975 ****
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    char_u	buff[IOSIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  	    if (buf->b_p_ro)
Karsten Hopp f93751
  		dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
Karsten Hopp f93751
--- 2978,2984 ----
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    char_u	buff[DIALOG_MSG_SIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  	    if (buf->b_p_ro)
Karsten Hopp f93751
  		dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
Karsten Hopp f93751
*** ../vim-7.3.160/src/ex_cmds2.c	2011-02-25 14:46:06.000000000 +0100
Karsten Hopp f93751
--- src/ex_cmds2.c	2011-04-11 20:51:40.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 1492,1498 ****
Karsten Hopp f93751
      buf_T	*buf;
Karsten Hopp f93751
      int		checkall;	/* may abandon all changed buffers */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	buff[IOSIZE];
Karsten Hopp f93751
      int		ret;
Karsten Hopp f93751
      buf_T	*buf2;
Karsten Hopp f93751
  
Karsten Hopp f93751
--- 1492,1498 ----
Karsten Hopp f93751
      buf_T	*buf;
Karsten Hopp f93751
      int		checkall;	/* may abandon all changed buffers */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	buff[DIALOG_MSG_SIZE];
Karsten Hopp f93751
      int		ret;
Karsten Hopp f93751
      buf_T	*buf2;
Karsten Hopp f93751
  
Karsten Hopp f93751
*** ../vim-7.3.160/src/ex_docmd.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/ex_docmd.c	2011-04-11 21:20:35.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 5093,5106 ****
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	    if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u	buff[IOSIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		if (n == 1)
Karsten Hopp f93751
  		    vim_strncpy(buff,
Karsten Hopp f93751
  			    (char_u *)_("1 more file to edit.  Quit anyway?"),
Karsten Hopp f93751
! 								  IOSIZE - 1);
Karsten Hopp f93751
  		else
Karsten Hopp f93751
! 		    vim_snprintf((char *)buff, IOSIZE,
Karsten Hopp f93751
  			      _("%d more files to edit.  Quit anyway?"), n);
Karsten Hopp f93751
  		if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
Karsten Hopp f93751
  		    return OK;
Karsten Hopp f93751
--- 5093,5106 ----
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
Karsten Hopp f93751
  	    if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u	buff[DIALOG_MSG_SIZE];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		if (n == 1)
Karsten Hopp f93751
  		    vim_strncpy(buff,
Karsten Hopp f93751
  			    (char_u *)_("1 more file to edit.  Quit anyway?"),
Karsten Hopp f93751
! 							 DIALOG_MSG_SIZE - 1);
Karsten Hopp f93751
  		else
Karsten Hopp f93751
! 		    vim_snprintf((char *)buff, DIALOG_MSG_SIZE,
Karsten Hopp f93751
  			      _("%d more files to edit.  Quit anyway?"), n);
Karsten Hopp f93751
  		if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
Karsten Hopp f93751
  		    return OK;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 8926,8960 ****
Karsten Hopp f93751
  		failed = TRUE;
Karsten Hopp f93751
  	    if (eap->cmdidx == CMD_mksession)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u dirnow[MAXPATHL];	/* current directory */
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		/*
Karsten Hopp f93751
! 		 * Change to session file's dir.
Karsten Hopp f93751
! 		 */
Karsten Hopp f93751
! 		if (mch_dirname(dirnow, MAXPATHL) == FAIL
Karsten Hopp f93751
! 					    || mch_chdir((char *)dirnow) != 0)
Karsten Hopp f93751
! 		    *dirnow = NUL;
Karsten Hopp f93751
! 		if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR))
Karsten Hopp f93751
! 		{
Karsten Hopp f93751
! 		    if (vim_chdirfile(fname) == OK)
Karsten Hopp f93751
! 			shorten_fnames(TRUE);
Karsten Hopp f93751
! 		}
Karsten Hopp f93751
! 		else if (*dirnow != NUL
Karsten Hopp f93751
! 			&& (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
Karsten Hopp f93751
  		{
Karsten Hopp f93751
! 		    if (mch_chdir((char *)globaldir) == 0)
Karsten Hopp f93751
! 			shorten_fnames(TRUE);
Karsten Hopp f93751
! 		}
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		failed |= (makeopens(fd, dirnow) == FAIL);
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		/* restore original dir */
Karsten Hopp f93751
! 		if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
Karsten Hopp f93751
  			|| ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
Karsten Hopp f93751
! 		{
Karsten Hopp f93751
! 		    if (mch_chdir((char *)dirnow) != 0)
Karsten Hopp f93751
! 			EMSG(_(e_prev_dir));
Karsten Hopp f93751
! 		    shorten_fnames(TRUE);
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    else
Karsten Hopp f93751
--- 8926,8967 ----
Karsten Hopp f93751
  		failed = TRUE;
Karsten Hopp f93751
  	    if (eap->cmdidx == CMD_mksession)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		char_u *dirnow;	 /* current directory */
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		dirnow = alloc(MAXPATHL);
Karsten Hopp f93751
! 		if (dirnow == NULL)
Karsten Hopp f93751
! 		    failed = TRUE;
Karsten Hopp f93751
! 		else
Karsten Hopp f93751
  		{
Karsten Hopp f93751
! 		    /*
Karsten Hopp f93751
! 		     * Change to session file's dir.
Karsten Hopp f93751
! 		     */
Karsten Hopp f93751
! 		    if (mch_dirname(dirnow, MAXPATHL) == FAIL
Karsten Hopp f93751
! 					    || mch_chdir((char *)dirnow) != 0)
Karsten Hopp f93751
! 			*dirnow = NUL;
Karsten Hopp f93751
! 		    if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR))
Karsten Hopp f93751
! 		    {
Karsten Hopp f93751
! 			if (vim_chdirfile(fname) == OK)
Karsten Hopp f93751
! 			    shorten_fnames(TRUE);
Karsten Hopp f93751
! 		    }
Karsten Hopp f93751
! 		    else if (*dirnow != NUL
Karsten Hopp f93751
! 			   && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
Karsten Hopp f93751
! 		    {
Karsten Hopp f93751
! 			if (mch_chdir((char *)globaldir) == 0)
Karsten Hopp f93751
! 			    shorten_fnames(TRUE);
Karsten Hopp f93751
! 		    }
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		    failed |= (makeopens(fd, dirnow) == FAIL);
Karsten Hopp f93751
  
Karsten Hopp f93751
! 		    /* restore original dir */
Karsten Hopp f93751
! 		    if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
Karsten Hopp f93751
  			|| ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
Karsten Hopp f93751
! 		    {
Karsten Hopp f93751
! 			if (mch_chdir((char *)dirnow) != 0)
Karsten Hopp f93751
! 			    EMSG(_(e_prev_dir));
Karsten Hopp f93751
! 			shorten_fnames(TRUE);
Karsten Hopp f93751
! 		    }
Karsten Hopp f93751
! 		    vim_free(dirnow);
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    else
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 8985,8994 ****
Karsten Hopp f93751
  	else if (eap->cmdidx == CMD_mksession)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* successful session write - set this_session var */
Karsten Hopp f93751
! 	    char_u	tbuf[MAXPATHL];
Karsten Hopp f93751
  
Karsten Hopp f93751
! 	    if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK)
Karsten Hopp f93751
! 		set_vim_var_string(VV_THIS_SESSION, tbuf, -1);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  #ifdef MKSESSION_NL
Karsten Hopp f93751
--- 8992,9006 ----
Karsten Hopp f93751
  	else if (eap->cmdidx == CMD_mksession)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* successful session write - set this_session var */
Karsten Hopp f93751
! 	    char_u	*tbuf;
Karsten Hopp f93751
  
Karsten Hopp f93751
! 	    tbuf = alloc(MAXPATHL);
Karsten Hopp f93751
! 	    if (tbuf != NULL)
Karsten Hopp f93751
! 	    {
Karsten Hopp f93751
! 		if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK)
Karsten Hopp f93751
! 		    set_vim_var_string(VV_THIS_SESSION, tbuf, -1);
Karsten Hopp f93751
! 		vim_free(tbuf);
Karsten Hopp f93751
! 	    }
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  #ifdef MKSESSION_NL
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 10677,10683 ****
Karsten Hopp f93751
      unsigned	*flagp;
Karsten Hopp f93751
  {
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
!     char_u	buf[MAXPATHL];
Karsten Hopp f93751
      char_u	*s;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (gap->ga_len == 0)
Karsten Hopp f93751
--- 10689,10695 ----
Karsten Hopp f93751
      unsigned	*flagp;
Karsten Hopp f93751
  {
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
!     char_u	*buf = NULL;
Karsten Hopp f93751
      char_u	*s;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (gap->ga_len == 0)
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 10692,10702 ****
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    if (fullname)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		(void)vim_FullName(s, buf, MAXPATHL, FALSE);
Karsten Hopp f93751
! 		s = buf;
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL)
Karsten Hopp f93751
  		return FAIL;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
      }
Karsten Hopp f93751
      return put_eol(fd);
Karsten Hopp f93751
--- 10704,10722 ----
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    if (fullname)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		buf = alloc(MAXPATHL);
Karsten Hopp f93751
! 		if (buf != NULL)
Karsten Hopp f93751
! 		{
Karsten Hopp f93751
! 		    (void)vim_FullName(s, buf, MAXPATHL, FALSE);
Karsten Hopp f93751
! 		    s = buf;
Karsten Hopp f93751
! 		}
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL)
Karsten Hopp f93751
+ 	    {
Karsten Hopp f93751
+ 		vim_free(buf);
Karsten Hopp f93751
  		return FAIL;
Karsten Hopp f93751
+ 	    }
Karsten Hopp f93751
+ 	    vim_free(buf);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
      }
Karsten Hopp f93751
      return put_eol(fd);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 10925,10931 ****
Karsten Hopp f93751
  
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
Karsten Hopp f93751
  /*
Karsten Hopp f93751
!  * Make a dialog message in "buff[IOSIZE]".
Karsten Hopp f93751
   * "format" must contain "%s".
Karsten Hopp f93751
   */
Karsten Hopp f93751
      void
Karsten Hopp f93751
--- 10945,10951 ----
Karsten Hopp f93751
  
Karsten Hopp f93751
  #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
Karsten Hopp f93751
  /*
Karsten Hopp f93751
!  * Make a dialog message in "buff[DIALOG_MSG_SIZE]".
Karsten Hopp f93751
   * "format" must contain "%s".
Karsten Hopp f93751
   */
Karsten Hopp f93751
      void
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 10936,10942 ****
Karsten Hopp f93751
  {
Karsten Hopp f93751
      if (fname == NULL)
Karsten Hopp f93751
  	fname = (char_u *)_("Untitled");
Karsten Hopp f93751
!     vim_snprintf((char *)buff, IOSIZE, format, fname);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
--- 10956,10962 ----
Karsten Hopp f93751
  {
Karsten Hopp f93751
      if (fname == NULL)
Karsten Hopp f93751
  	fname = (char_u *)_("Untitled");
Karsten Hopp f93751
!     vim_snprintf((char *)buff, DIALOG_MSG_SIZE, format, fname);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
*** ../vim-7.3.160/src/fileio.c	2011-02-25 16:52:13.000000000 +0100
Karsten Hopp f93751
--- src/fileio.c	2011-04-11 18:35:10.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 6023,6037 ****
Karsten Hopp f93751
  shorten_fname1(full_path)
Karsten Hopp f93751
      char_u	*full_path;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	dirname[MAXPATHL];
Karsten Hopp f93751
      char_u	*p = full_path;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (mch_dirname(dirname, MAXPATHL) == OK)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	p = shorten_fname(full_path, dirname);
Karsten Hopp f93751
  	if (p == NULL || *p == NUL)
Karsten Hopp f93751
  	    p = full_path;
Karsten Hopp f93751
      }
Karsten Hopp f93751
      return p;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
--- 6023,6041 ----
Karsten Hopp f93751
  shorten_fname1(full_path)
Karsten Hopp f93751
      char_u	*full_path;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*dirname;
Karsten Hopp f93751
      char_u	*p = full_path;
Karsten Hopp f93751
  
Karsten Hopp f93751
+     dirname = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (dirname == NULL)
Karsten Hopp f93751
+ 	return full_path;
Karsten Hopp f93751
      if (mch_dirname(dirname, MAXPATHL) == OK)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	p = shorten_fname(full_path, dirname);
Karsten Hopp f93751
  	if (p == NULL || *p == NUL)
Karsten Hopp f93751
  	    p = full_path;
Karsten Hopp f93751
      }
Karsten Hopp f93751
+     vim_free(dirname);
Karsten Hopp f93751
      return p;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
*** ../vim-7.3.160/src/hardcopy.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/hardcopy.c	2011-04-11 18:23:38.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 1759,1765 ****
Karsten Hopp f93751
      char	*name;
Karsten Hopp f93751
      struct prt_ps_resource_S *resource;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	buffer[MAXPATHL + 1];
Karsten Hopp f93751
  
Karsten Hopp f93751
      vim_strncpy(resource->name, (char_u *)name, 63);
Karsten Hopp f93751
      /* Look for named resource file in runtimepath */
Karsten Hopp f93751
--- 1759,1770 ----
Karsten Hopp f93751
      char	*name;
Karsten Hopp f93751
      struct prt_ps_resource_S *resource;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*buffer;
Karsten Hopp f93751
!     int		retval;
Karsten Hopp f93751
! 
Karsten Hopp f93751
!     buffer = alloc(MAXPATHL + 1);
Karsten Hopp f93751
!     if (buffer == NULL)
Karsten Hopp f93751
! 	return FALSE;
Karsten Hopp f93751
  
Karsten Hopp f93751
      vim_strncpy(resource->name, (char_u *)name, 63);
Karsten Hopp f93751
      /* Look for named resource file in runtimepath */
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 1768,1776 ****
Karsten Hopp f93751
      vim_strcat(buffer, (char_u *)name, MAXPATHL);
Karsten Hopp f93751
      vim_strcat(buffer, (char_u *)".ps", MAXPATHL);
Karsten Hopp f93751
      resource->filename[0] = NUL;
Karsten Hopp f93751
!     return (do_in_runtimepath(buffer, FALSE, prt_resource_name,
Karsten Hopp f93751
  							   resource->filename)
Karsten Hopp f93751
  	    && resource->filename[0] != NUL);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /* PS CR and LF characters have platform independent values */
Karsten Hopp f93751
--- 1773,1783 ----
Karsten Hopp f93751
      vim_strcat(buffer, (char_u *)name, MAXPATHL);
Karsten Hopp f93751
      vim_strcat(buffer, (char_u *)".ps", MAXPATHL);
Karsten Hopp f93751
      resource->filename[0] = NUL;
Karsten Hopp f93751
!     retval = (do_in_runtimepath(buffer, FALSE, prt_resource_name,
Karsten Hopp f93751
  							   resource->filename)
Karsten Hopp f93751
  	    && resource->filename[0] != NUL);
Karsten Hopp f93751
+     vim_free(buffer);
Karsten Hopp f93751
+     return retval;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /* PS CR and LF characters have platform independent values */
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2848,2862 ****
Karsten Hopp f93751
      double      right;
Karsten Hopp f93751
      double      top;
Karsten Hopp f93751
      double      bottom;
Karsten Hopp f93751
!     struct prt_ps_resource_S res_prolog;
Karsten Hopp f93751
!     struct prt_ps_resource_S res_encoding;
Karsten Hopp f93751
      char	buffer[256];
Karsten Hopp f93751
      char_u      *p_encoding;
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
!     struct prt_ps_resource_S res_cidfont;
Karsten Hopp f93751
!     struct prt_ps_resource_S res_cmap;
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      /*
Karsten Hopp f93751
       * PS DSC Header comments - no PS code!
Karsten Hopp f93751
--- 2855,2887 ----
Karsten Hopp f93751
      double      right;
Karsten Hopp f93751
      double      top;
Karsten Hopp f93751
      double      bottom;
Karsten Hopp f93751
!     struct prt_ps_resource_S *res_prolog;
Karsten Hopp f93751
!     struct prt_ps_resource_S *res_encoding;
Karsten Hopp f93751
      char	buffer[256];
Karsten Hopp f93751
      char_u      *p_encoding;
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
!     struct prt_ps_resource_S *res_cidfont;
Karsten Hopp f93751
!     struct prt_ps_resource_S *res_cmap;
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
+     int		retval = FALSE;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
+     res_prolog = (struct prt_ps_resource_S *)
Karsten Hopp f93751
+ 				      alloc(sizeof(struct prt_ps_resource_S));
Karsten Hopp f93751
+     res_encoding = (struct prt_ps_resource_S *)
Karsten Hopp f93751
+ 				      alloc(sizeof(struct prt_ps_resource_S));
Karsten Hopp f93751
+ #ifdef FEAT_MBYTE
Karsten Hopp f93751
+     res_cidfont = (struct prt_ps_resource_S *)
Karsten Hopp f93751
+ 				      alloc(sizeof(struct prt_ps_resource_S));
Karsten Hopp f93751
+     res_cmap = (struct prt_ps_resource_S *)
Karsten Hopp f93751
+ 				      alloc(sizeof(struct prt_ps_resource_S));
Karsten Hopp f93751
+ #endif
Karsten Hopp f93751
+     if (res_prolog == NULL || res_encoding == NULL
Karsten Hopp f93751
+ #ifdef FEAT_MBYTE
Karsten Hopp f93751
+ 	    || res_cidfont == NULL || res_cmap == NULL
Karsten Hopp f93751
+ #endif
Karsten Hopp f93751
+        )
Karsten Hopp f93751
+ 	goto theend;
Karsten Hopp f93751
  
Karsten Hopp f93751
      /*
Karsten Hopp f93751
       * PS DSC Header comments - no PS code!
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2932,2958 ****
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Search for external resources VIM supplies */
Karsten Hopp f93751
!     if (!prt_find_resource("prolog", &res_prolog))
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
!     if (!prt_open_resource(&res_prolog))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
!     if (!prt_check_resource(&res_prolog, PRT_PROLOG_VERSION))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Look for required version of multi-byte printing procset */
Karsten Hopp f93751
! 	if (!prt_find_resource("cidfont", &res_cidfont))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(&res_cidfont))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
! 	if (!prt_check_resource(&res_cidfont, PRT_CID_PROLOG_VERSION))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
--- 2957,2983 ----
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Search for external resources VIM supplies */
Karsten Hopp f93751
!     if (!prt_find_resource("prolog", res_prolog))
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
!     if (!prt_open_resource(res_prolog))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
!     if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Look for required version of multi-byte printing procset */
Karsten Hopp f93751
! 	if (!prt_find_resource("cidfont", res_cidfont))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(res_cidfont))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
! 	if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2968,2974 ****
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  	p_encoding = enc_skip(p_penc);
Karsten Hopp f93751
  	if (*p_encoding == NUL
Karsten Hopp f93751
! 		|| !prt_find_resource((char *)p_encoding, &res_encoding))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* 'printencoding' not set or not supported - find alternate */
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
--- 2993,2999 ----
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  	p_encoding = enc_skip(p_penc);
Karsten Hopp f93751
  	if (*p_encoding == NUL
Karsten Hopp f93751
! 		|| !prt_find_resource((char *)p_encoding, res_encoding))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* 'printencoding' not set or not supported - find alternate */
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2977,2989 ****
Karsten Hopp f93751
  	    p_encoding = enc_skip(p_enc);
Karsten Hopp f93751
  	    props = enc_canon_props(p_encoding);
Karsten Hopp f93751
  	    if (!(props & ENC_8BIT)
Karsten Hopp f93751
! 		    || !prt_find_resource((char *)p_encoding, &res_encoding))
Karsten Hopp f93751
  		/* 8-bit 'encoding' is not supported */
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		/* Use latin1 as default printing encoding */
Karsten Hopp f93751
  		p_encoding = (char_u *)"latin1";
Karsten Hopp f93751
! 		if (!prt_find_resource((char *)p_encoding, &res_encoding))
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  			    p_encoding);
Karsten Hopp f93751
--- 3002,3014 ----
Karsten Hopp f93751
  	    p_encoding = enc_skip(p_enc);
Karsten Hopp f93751
  	    props = enc_canon_props(p_encoding);
Karsten Hopp f93751
  	    if (!(props & ENC_8BIT)
Karsten Hopp f93751
! 		    || !prt_find_resource((char *)p_encoding, res_encoding))
Karsten Hopp f93751
  		/* 8-bit 'encoding' is not supported */
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		/* Use latin1 as default printing encoding */
Karsten Hopp f93751
  		p_encoding = (char_u *)"latin1";
Karsten Hopp f93751
! 		if (!prt_find_resource((char *)p_encoding, res_encoding))
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  			    p_encoding);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2991,2997 ****
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(&res_encoding))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	/* For the moment there are no checks on encoding resource files to
Karsten Hopp f93751
  	 * perform */
Karsten Hopp f93751
--- 3016,3022 ----
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(res_encoding))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	/* For the moment there are no checks on encoding resource files to
Karsten Hopp f93751
  	 * perform */
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3005,3017 ****
Karsten Hopp f93751
  	if (prt_use_courier)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* Include ASCII range encoding vector */
Karsten Hopp f93751
! 	    if (!prt_find_resource(prt_ascii_encoding, &res_encoding))
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  							  prt_ascii_encoding);
Karsten Hopp f93751
  		return FALSE;
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
! 	    if (!prt_open_resource(&res_encoding))
Karsten Hopp f93751
  		return FALSE;
Karsten Hopp f93751
  	    /* For the moment there are no checks on encoding resource files to
Karsten Hopp f93751
  	     * perform */
Karsten Hopp f93751
--- 3030,3042 ----
Karsten Hopp f93751
  	if (prt_use_courier)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* Include ASCII range encoding vector */
Karsten Hopp f93751
! 	    if (!prt_find_resource(prt_ascii_encoding, res_encoding))
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  							  prt_ascii_encoding);
Karsten Hopp f93751
  		return FALSE;
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
! 	    if (!prt_open_resource(res_encoding))
Karsten Hopp f93751
  		return FALSE;
Karsten Hopp f93751
  	    /* For the moment there are no checks on encoding resource files to
Karsten Hopp f93751
  	     * perform */
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3034,3077 ****
Karsten Hopp f93751
      if (prt_out_mbyte && prt_custom_cmap)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Find user supplied CMap */
Karsten Hopp f93751
! 	if (!prt_find_resource(prt_cmap, &res_cmap))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  								    prt_cmap);
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(&res_cmap))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* List resources supplied */
Karsten Hopp f93751
!     STRCPY(buffer, res_prolog.title);
Karsten Hopp f93751
      STRCAT(buffer, " ");
Karsten Hopp f93751
!     STRCAT(buffer, res_prolog.version);
Karsten Hopp f93751
      prt_dsc_resources("DocumentSuppliedResources", "procset", buffer);
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	STRCPY(buffer, res_cidfont.title);
Karsten Hopp f93751
  	STRCAT(buffer, " ");
Karsten Hopp f93751
! 	STRCAT(buffer, res_cidfont.version);
Karsten Hopp f93751
  	prt_dsc_resources(NULL, "procset", buffer);
Karsten Hopp f93751
  
Karsten Hopp f93751
  	if (prt_custom_cmap)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    STRCPY(buffer, res_cmap.title);
Karsten Hopp f93751
  	    STRCAT(buffer, " ");
Karsten Hopp f93751
! 	    STRCAT(buffer, res_cmap.version);
Karsten Hopp f93751
  	    prt_dsc_resources(NULL, "cmap", buffer);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
      }
Karsten Hopp f93751
      if (!prt_out_mbyte || prt_use_courier)
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	STRCPY(buffer, res_encoding.title);
Karsten Hopp f93751
  	STRCAT(buffer, " ");
Karsten Hopp f93751
! 	STRCAT(buffer, res_encoding.version);
Karsten Hopp f93751
  	prt_dsc_resources(NULL, "encoding", buffer);
Karsten Hopp f93751
      }
Karsten Hopp f93751
      prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
Karsten Hopp f93751
--- 3059,3102 ----
Karsten Hopp f93751
      if (prt_out_mbyte && prt_custom_cmap)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Find user supplied CMap */
Karsten Hopp f93751
! 	if (!prt_find_resource(prt_cmap, res_cmap))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
Karsten Hopp f93751
  								    prt_cmap);
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
! 	if (!prt_open_resource(res_cmap))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* List resources supplied */
Karsten Hopp f93751
!     STRCPY(buffer, res_prolog->title);
Karsten Hopp f93751
      STRCAT(buffer, " ");
Karsten Hopp f93751
!     STRCAT(buffer, res_prolog->version);
Karsten Hopp f93751
      prt_dsc_resources("DocumentSuppliedResources", "procset", buffer);
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	STRCPY(buffer, res_cidfont->title);
Karsten Hopp f93751
  	STRCAT(buffer, " ");
Karsten Hopp f93751
! 	STRCAT(buffer, res_cidfont->version);
Karsten Hopp f93751
  	prt_dsc_resources(NULL, "procset", buffer);
Karsten Hopp f93751
  
Karsten Hopp f93751
  	if (prt_custom_cmap)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    STRCPY(buffer, res_cmap->title);
Karsten Hopp f93751
  	    STRCAT(buffer, " ");
Karsten Hopp f93751
! 	    STRCAT(buffer, res_cmap->version);
Karsten Hopp f93751
  	    prt_dsc_resources(NULL, "cmap", buffer);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
      }
Karsten Hopp f93751
      if (!prt_out_mbyte || prt_use_courier)
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
      {
Karsten Hopp f93751
! 	STRCPY(buffer, res_encoding->title);
Karsten Hopp f93751
  	STRCAT(buffer, " ");
Karsten Hopp f93751
! 	STRCAT(buffer, res_encoding->version);
Karsten Hopp f93751
  	prt_dsc_resources(NULL, "encoding", buffer);
Karsten Hopp f93751
      }
Karsten Hopp f93751
      prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3114,3128 ****
Karsten Hopp f93751
      prt_dsc_noarg("BeginProlog");
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Add required procsets - NOTE: order is important! */
Karsten Hopp f93751
!     if (!prt_add_resource(&res_prolog))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Add CID font procset, and any user supplied CMap */
Karsten Hopp f93751
! 	if (!prt_add_resource(&res_cidfont))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
! 	if (prt_custom_cmap && !prt_add_resource(&res_cmap))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
--- 3139,3153 ----
Karsten Hopp f93751
      prt_dsc_noarg("BeginProlog");
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Add required procsets - NOTE: order is important! */
Karsten Hopp f93751
!     if (!prt_add_resource(res_prolog))
Karsten Hopp f93751
  	return FALSE;
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
      if (prt_out_mbyte)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	/* Add CID font procset, and any user supplied CMap */
Karsten Hopp f93751
! 	if (!prt_add_resource(res_cidfont))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
! 	if (prt_custom_cmap && !prt_add_resource(res_cmap))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3132,3138 ****
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  	/* There will be only one Roman font encoding to be included in the PS
Karsten Hopp f93751
  	 * file. */
Karsten Hopp f93751
! 	if (!prt_add_resource(&res_encoding))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  
Karsten Hopp f93751
      prt_dsc_noarg("EndProlog");
Karsten Hopp f93751
--- 3157,3163 ----
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
  	/* There will be only one Roman font encoding to be included in the PS
Karsten Hopp f93751
  	 * file. */
Karsten Hopp f93751
! 	if (!prt_add_resource(res_encoding))
Karsten Hopp f93751
  	    return FALSE;
Karsten Hopp f93751
  
Karsten Hopp f93751
      prt_dsc_noarg("EndProlog");
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3248,3254 ****
Karsten Hopp f93751
      prt_dsc_noarg("EndSetup");
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Fail if any problems writing out to the PS file */
Karsten Hopp f93751
!     return !prt_file_error;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
      void
Karsten Hopp f93751
--- 3273,3289 ----
Karsten Hopp f93751
      prt_dsc_noarg("EndSetup");
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Fail if any problems writing out to the PS file */
Karsten Hopp f93751
!     retval = !prt_file_error;
Karsten Hopp f93751
! 
Karsten Hopp f93751
! theend:
Karsten Hopp f93751
!     vim_free(res_prolog);
Karsten Hopp f93751
!     vim_free(res_encoding);
Karsten Hopp f93751
! #ifdef FEAT_MBYTE
Karsten Hopp f93751
!     vim_free(res_cidfont);
Karsten Hopp f93751
!     vim_free(res_cmap);
Karsten Hopp f93751
! #endif
Karsten Hopp f93751
! 
Karsten Hopp f93751
!     return retval;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
      void
Karsten Hopp f93751
*** ../vim-7.3.160/src/quickfix.c	2010-12-02 15:33:10.000000000 +0100
Karsten Hopp f93751
--- src/quickfix.c	2011-04-11 17:54:07.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3049,3056 ****
Karsten Hopp f93751
      int		flags = 0;
Karsten Hopp f93751
      colnr_T	col;
Karsten Hopp f93751
      long	tomatch;
Karsten Hopp f93751
!     char_u	dirname_start[MAXPATHL];
Karsten Hopp f93751
!     char_u	dirname_now[MAXPATHL];
Karsten Hopp f93751
      char_u	*target_dir = NULL;
Karsten Hopp f93751
  #ifdef FEAT_AUTOCMD
Karsten Hopp f93751
      char_u	*au_name =  NULL;
Karsten Hopp f93751
--- 3049,3056 ----
Karsten Hopp f93751
      int		flags = 0;
Karsten Hopp f93751
      colnr_T	col;
Karsten Hopp f93751
      long	tomatch;
Karsten Hopp f93751
!     char_u	*dirname_start = NULL;
Karsten Hopp f93751
!     char_u	*dirname_now = NULL;
Karsten Hopp f93751
      char_u	*target_dir = NULL;
Karsten Hopp f93751
  #ifdef FEAT_AUTOCMD
Karsten Hopp f93751
      char_u	*au_name =  NULL;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3128,3133 ****
Karsten Hopp f93751
--- 3128,3138 ----
Karsten Hopp f93751
  	goto theend;
Karsten Hopp f93751
      }
Karsten Hopp f93751
  
Karsten Hopp f93751
+     dirname_start = alloc(MAXPATHL);
Karsten Hopp f93751
+     dirname_now = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (dirname_start == NULL || dirname_now == NULL)
Karsten Hopp f93751
+ 	goto theend;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
      /* Remember the current directory, because a BufRead autocommand that does
Karsten Hopp f93751
       * ":lcd %:p:h" changes the meaning of short path names. */
Karsten Hopp f93751
      mch_dirname(dirname_start, MAXPATHL);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3364,3369 ****
Karsten Hopp f93751
--- 3369,3376 ----
Karsten Hopp f93751
      }
Karsten Hopp f93751
  
Karsten Hopp f93751
  theend:
Karsten Hopp f93751
+     vim_free(dirname_now);
Karsten Hopp f93751
+     vim_free(dirname_start);
Karsten Hopp f93751
      vim_free(target_dir);
Karsten Hopp f93751
      vim_free(regmatch.regprog);
Karsten Hopp f93751
  }
Karsten Hopp f93751
*** ../vim-7.3.160/src/main.c	2011-03-22 18:10:34.000000000 +0100
Karsten Hopp f93751
--- src/main.c	2011-04-11 18:06:06.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3814,3820 ****
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
      char_u	*inicmd = NULL;
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
!     char_u	cwd[MAXPATHL];
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (filec > 0 && filev[0][0] == '+')
Karsten Hopp f93751
      {
Karsten Hopp f93751
--- 3814,3820 ----
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
      char_u	*inicmd = NULL;
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
!     char_u	*cwd;
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (filec > 0 && filev[0][0] == '+')
Karsten Hopp f93751
      {
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3827,3841 ****
Karsten Hopp f93751
  	mainerr_arg_missing((char_u *)filev[-1]);
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Temporarily cd to the current directory to handle relative file names. */
Karsten Hopp f93751
      if (mch_dirname(cwd, MAXPATHL) != OK)
Karsten Hopp f93751
  	return NULL;
Karsten Hopp f93751
!     if ((p = vim_strsave_escaped_ext(cwd,
Karsten Hopp f93751
  #ifdef BACKSLASH_IN_FILENAME
Karsten Hopp f93751
  		    "",  /* rem_backslash() will tell what chars to escape */
Karsten Hopp f93751
  #else
Karsten Hopp f93751
  		    PATH_ESC_CHARS,
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
! 		    '\\', TRUE)) == NULL)
Karsten Hopp f93751
  	return NULL;
Karsten Hopp f93751
      ga_init2(&ga, 1, 100);
Karsten Hopp f93751
      ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
Karsten Hopp f93751
--- 3827,3849 ----
Karsten Hopp f93751
  	mainerr_arg_missing((char_u *)filev[-1]);
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Temporarily cd to the current directory to handle relative file names. */
Karsten Hopp f93751
+     cwd = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (cwd == NULL)
Karsten Hopp f93751
+ 	return NULL;
Karsten Hopp f93751
      if (mch_dirname(cwd, MAXPATHL) != OK)
Karsten Hopp f93751
+     {
Karsten Hopp f93751
+ 	vim_free(cwd);
Karsten Hopp f93751
  	return NULL;
Karsten Hopp f93751
!     }
Karsten Hopp f93751
!     p = vim_strsave_escaped_ext(cwd,
Karsten Hopp f93751
  #ifdef BACKSLASH_IN_FILENAME
Karsten Hopp f93751
  		    "",  /* rem_backslash() will tell what chars to escape */
Karsten Hopp f93751
  #else
Karsten Hopp f93751
  		    PATH_ESC_CHARS,
Karsten Hopp f93751
  #endif
Karsten Hopp f93751
! 		    '\\', TRUE);
Karsten Hopp f93751
!     vim_free(cwd);
Karsten Hopp f93751
!     if (p == NULL)
Karsten Hopp f93751
  	return NULL;
Karsten Hopp f93751
      ga_init2(&ga, 1, 100);
Karsten Hopp f93751
      ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
Karsten Hopp f93751
*** ../vim-7.3.160/src/netbeans.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/netbeans.c	2011-04-11 18:27:08.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2891,2897 ****
Karsten Hopp f93751
      char_u	*text;
Karsten Hopp f93751
      linenr_T	lnum;
Karsten Hopp f93751
      int		col;
Karsten Hopp f93751
!     char	buf[MAXPATHL * 2 + 25];
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Don't do anything when 'ballooneval' is off, messages scrolled the
Karsten Hopp f93751
--- 2891,2897 ----
Karsten Hopp f93751
      char_u	*text;
Karsten Hopp f93751
      linenr_T	lnum;
Karsten Hopp f93751
      int		col;
Karsten Hopp f93751
!     char	*buf;
Karsten Hopp f93751
      char_u	*p;
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* Don't do anything when 'ballooneval' is off, messages scrolled the
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 2905,2919 ****
Karsten Hopp f93751
  	 * length. */
Karsten Hopp f93751
  	if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    p = nb_quote(text);
Karsten Hopp f93751
! 	    if (p != NULL)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		vim_snprintf(buf, sizeof(buf),
Karsten Hopp f93751
! 				       "0:balloonText=%d \"%s\"\n", r_cmdno, p);
Karsten Hopp f93751
! 		vim_free(p);
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
- 	    nbdebug(("EVT: %s", buf));
Karsten Hopp f93751
- 	    nb_send(buf, "netbeans_beval_cb");
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	vim_free(text);
Karsten Hopp f93751
      }
Karsten Hopp f93751
--- 2905,2924 ----
Karsten Hopp f93751
  	 * length. */
Karsten Hopp f93751
  	if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
! 	    buf = (char *)alloc(MAXPATHL * 2 + 25);
Karsten Hopp f93751
! 	    if (buf != NULL)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
! 		p = nb_quote(text);
Karsten Hopp f93751
! 		if (p != NULL)
Karsten Hopp f93751
! 		{
Karsten Hopp f93751
! 		    vim_snprintf(buf, MAXPATHL * 2 + 25,
Karsten Hopp f93751
! 				     "0:balloonText=%d \"%s\"\n", r_cmdno, p);
Karsten Hopp f93751
! 		    vim_free(p);
Karsten Hopp f93751
! 		}
Karsten Hopp f93751
! 		nbdebug(("EVT: %s", buf));
Karsten Hopp f93751
! 		nb_send(buf, "netbeans_beval_cb");
Karsten Hopp f93751
! 		vim_free(buf);
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	vim_free(text);
Karsten Hopp f93751
      }
Karsten Hopp f93751
*** ../vim-7.3.160/src/spell.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/spell.c	2011-04-11 18:00:49.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 8590,8596 ****
Karsten Hopp f93751
      spellinfo_T	*spin;
Karsten Hopp f93751
      char_u	*wfname;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	fname[MAXPATHL];
Karsten Hopp f93751
      int		len;
Karsten Hopp f93751
      slang_T	*slang;
Karsten Hopp f93751
      int		free_slang = FALSE;
Karsten Hopp f93751
--- 8590,8596 ----
Karsten Hopp f93751
      spellinfo_T	*spin;
Karsten Hopp f93751
      char_u	*wfname;
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*fname = NULL;
Karsten Hopp f93751
      int		len;
Karsten Hopp f93751
      slang_T	*slang;
Karsten Hopp f93751
      int		free_slang = FALSE;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 8654,8659 ****
Karsten Hopp f93751
--- 8654,8662 ----
Karsten Hopp f93751
       * Write the .sug file.
Karsten Hopp f93751
       * Make the file name by changing ".spl" to ".sug".
Karsten Hopp f93751
       */
Karsten Hopp f93751
+     fname = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (fname == NULL)
Karsten Hopp f93751
+ 	goto theend;
Karsten Hopp f93751
      vim_strncpy(fname, wfname, MAXPATHL - 1);
Karsten Hopp f93751
      len = (int)STRLEN(fname);
Karsten Hopp f93751
      fname[len - 2] = 'u';
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 8661,8666 ****
Karsten Hopp f93751
--- 8664,8670 ----
Karsten Hopp f93751
      sug_write(spin, fname);
Karsten Hopp f93751
  
Karsten Hopp f93751
  theend:
Karsten Hopp f93751
+     vim_free(fname);
Karsten Hopp f93751
      if (free_slang)
Karsten Hopp f93751
  	slang_free(slang);
Karsten Hopp f93751
      free_blocks(spin->si_blocks);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9106,9113 ****
Karsten Hopp f93751
      int		overwrite;	    /* overwrite existing output file */
Karsten Hopp f93751
      int		added_word;	    /* invoked through "zg" */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	fname[MAXPATHL];
Karsten Hopp f93751
!     char_u	wfname[MAXPATHL];
Karsten Hopp f93751
      char_u	**innames;
Karsten Hopp f93751
      int		incount;
Karsten Hopp f93751
      afffile_T	*(afile[8]);
Karsten Hopp f93751
--- 9110,9117 ----
Karsten Hopp f93751
      int		overwrite;	    /* overwrite existing output file */
Karsten Hopp f93751
      int		added_word;	    /* invoked through "zg" */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*fname = NULL;
Karsten Hopp f93751
!     char_u	*wfname;
Karsten Hopp f93751
      char_u	**innames;
Karsten Hopp f93751
      int		incount;
Karsten Hopp f93751
      afffile_T	*(afile[8]);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9135,9140 ****
Karsten Hopp f93751
--- 9139,9148 ----
Karsten Hopp f93751
      innames = &fnames[1];
Karsten Hopp f93751
      incount = fcount - 1;
Karsten Hopp f93751
  
Karsten Hopp f93751
+     wfname = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (wfname == NULL)
Karsten Hopp f93751
+ 	return;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
      if (fcount >= 1)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	len = (int)STRLEN(fnames[0]);
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9144,9167 ****
Karsten Hopp f93751
  	     * "path/en.latin1.add.spl". */
Karsten Hopp f93751
  	    innames = &fnames[0];
Karsten Hopp f93751
  	    incount = 1;
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, sizeof(wfname), "%s.spl", fnames[0]);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else if (fcount == 1)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
Karsten Hopp f93751
  	    innames = &fnames[0];
Karsten Hopp f93751
  	    incount = 1;
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
Karsten Hopp f93751
  		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* Name ends in ".spl", use as the file name. */
Karsten Hopp f93751
! 	    vim_strncpy(wfname, fnames[0], sizeof(wfname) - 1);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else
Karsten Hopp f93751
  	    /* Name should be language, make the file name from it. */
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
Karsten Hopp f93751
  		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
Karsten Hopp f93751
  
Karsten Hopp f93751
  	/* Check for .ascii.spl. */
Karsten Hopp f93751
--- 9152,9175 ----
Karsten Hopp f93751
  	     * "path/en.latin1.add.spl". */
Karsten Hopp f93751
  	    innames = &fnames[0];
Karsten Hopp f93751
  	    incount = 1;
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, MAXPATHL, "%s.spl", fnames[0]);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else if (fcount == 1)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
Karsten Hopp f93751
  	    innames = &fnames[0];
Karsten Hopp f93751
  	    incount = 1;
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
Karsten Hopp f93751
  		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    /* Name ends in ".spl", use as the file name. */
Karsten Hopp f93751
! 	    vim_strncpy(wfname, fnames[0], MAXPATHL - 1);
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	else
Karsten Hopp f93751
  	    /* Name should be language, make the file name from it. */
Karsten Hopp f93751
! 	    vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
Karsten Hopp f93751
  		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
Karsten Hopp f93751
  
Karsten Hopp f93751
  	/* Check for .ascii.spl. */
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9186,9199 ****
Karsten Hopp f93751
  	if (!overwrite && mch_stat((char *)wfname, &st) >= 0)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG(_(e_exists));
Karsten Hopp f93751
! 	    return;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	if (mch_isdir(wfname))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG2(_(e_isadir2), wfname);
Karsten Hopp f93751
! 	    return;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
  	/*
Karsten Hopp f93751
  	 * Init the aff and dic pointers.
Karsten Hopp f93751
  	 * Get the region names if there are more than 2 arguments.
Karsten Hopp f93751
--- 9194,9211 ----
Karsten Hopp f93751
  	if (!overwrite && mch_stat((char *)wfname, &st) >= 0)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG(_(e_exists));
Karsten Hopp f93751
! 	    goto theend;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	if (mch_isdir(wfname))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG2(_(e_isadir2), wfname);
Karsten Hopp f93751
! 	    goto theend;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
+ 	fname = alloc(MAXPATHL);
Karsten Hopp f93751
+ 	if (fname == NULL)
Karsten Hopp f93751
+ 	    goto theend;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
  	/*
Karsten Hopp f93751
  	 * Init the aff and dic pointers.
Karsten Hopp f93751
  	 * Get the region names if there are more than 2 arguments.
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9209,9215 ****
Karsten Hopp f93751
  						|| innames[i][len - 3] != '_')
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    EMSG2(_("E755: Invalid region in %s"), innames[i]);
Karsten Hopp f93751
! 		    return;
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  		spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
Karsten Hopp f93751
  		spin.si_region_name[i * 2 + 1] =
Karsten Hopp f93751
--- 9221,9227 ----
Karsten Hopp f93751
  						|| innames[i][len - 3] != '_')
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    EMSG2(_("E755: Invalid region in %s"), innames[i]);
Karsten Hopp f93751
! 		    goto theend;
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  		spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
Karsten Hopp f93751
  		spin.si_region_name[i * 2 + 1] =
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9226,9232 ****
Karsten Hopp f93751
  		|| spin.si_prefroot == NULL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    free_blocks(spin.si_blocks);
Karsten Hopp f93751
! 	    return;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
  	/* When not producing a .add.spl file clear the character table when
Karsten Hopp f93751
--- 9238,9244 ----
Karsten Hopp f93751
  		|| spin.si_prefroot == NULL)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    free_blocks(spin.si_blocks);
Karsten Hopp f93751
! 	    goto theend;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
  	/* When not producing a .add.spl file clear the character table when
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9247,9253 ****
Karsten Hopp f93751
  	    spin.si_conv.vc_type = CONV_NONE;
Karsten Hopp f93751
  	    spin.si_region = 1 << i;
Karsten Hopp f93751
  
Karsten Hopp f93751
! 	    vim_snprintf((char *)fname, sizeof(fname), "%s.aff", innames[i]);
Karsten Hopp f93751
  	    if (mch_stat((char *)fname, &st) >= 0)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		/* Read the .aff file.  Will init "spin->si_conv" based on the
Karsten Hopp f93751
--- 9259,9265 ----
Karsten Hopp f93751
  	    spin.si_conv.vc_type = CONV_NONE;
Karsten Hopp f93751
  	    spin.si_region = 1 << i;
Karsten Hopp f93751
  
Karsten Hopp f93751
! 	    vim_snprintf((char *)fname, MAXPATHL, "%s.aff", innames[i]);
Karsten Hopp f93751
  	    if (mch_stat((char *)fname, &st) >= 0)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		/* Read the .aff file.  Will init "spin->si_conv" based on the
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9258,9264 ****
Karsten Hopp f93751
  		else
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    /* Read the .dic file and store the words in the trees. */
Karsten Hopp f93751
! 		    vim_snprintf((char *)fname, sizeof(fname), "%s.dic",
Karsten Hopp f93751
  								  innames[i]);
Karsten Hopp f93751
  		    if (spell_read_dic(&spin, fname, afile[i]) == FAIL)
Karsten Hopp f93751
  			error = TRUE;
Karsten Hopp f93751
--- 9270,9276 ----
Karsten Hopp f93751
  		else
Karsten Hopp f93751
  		{
Karsten Hopp f93751
  		    /* Read the .dic file and store the words in the trees. */
Karsten Hopp f93751
! 		    vim_snprintf((char *)fname, MAXPATHL, "%s.dic",
Karsten Hopp f93751
  								  innames[i]);
Karsten Hopp f93751
  		    if (spell_read_dic(&spin, fname, afile[i]) == FAIL)
Karsten Hopp f93751
  			error = TRUE;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9340,9345 ****
Karsten Hopp f93751
--- 9352,9361 ----
Karsten Hopp f93751
  	    spell_make_sugfile(&spin, wfname);
Karsten Hopp f93751
  
Karsten Hopp f93751
      }
Karsten Hopp f93751
+ 
Karsten Hopp f93751
+ theend:
Karsten Hopp f93751
+     vim_free(fname);
Karsten Hopp f93751
+     vim_free(wfname);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9392,9398 ****
Karsten Hopp f93751
      buf_T	*buf = NULL;
Karsten Hopp f93751
      int		new_spf = FALSE;
Karsten Hopp f93751
      char_u	*fname;
Karsten Hopp f93751
!     char_u	fnamebuf[MAXPATHL];
Karsten Hopp f93751
      char_u	line[MAXWLEN * 2];
Karsten Hopp f93751
      long	fpos, fpos_next = 0;
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
--- 9408,9414 ----
Karsten Hopp f93751
      buf_T	*buf = NULL;
Karsten Hopp f93751
      int		new_spf = FALSE;
Karsten Hopp f93751
      char_u	*fname;
Karsten Hopp f93751
!     char_u	*fnamebuf = NULL;
Karsten Hopp f93751
      char_u	line[MAXWLEN * 2];
Karsten Hopp f93751
      long	fpos, fpos_next = 0;
Karsten Hopp f93751
      int		i;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9422,9427 ****
Karsten Hopp f93751
--- 9438,9446 ----
Karsten Hopp f93751
  	    EMSG2(_(e_notset), "spellfile");
Karsten Hopp f93751
  	    return;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
+ 	fnamebuf = alloc(MAXPATHL);
Karsten Hopp f93751
+ 	if (fnamebuf == NULL)
Karsten Hopp f93751
+ 	    return;
Karsten Hopp f93751
  
Karsten Hopp f93751
  	for (spf = curwin->w_s->b_p_spf, i = 1; *spf != NUL; ++i)
Karsten Hopp f93751
  	{
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9431,9436 ****
Karsten Hopp f93751
--- 9450,9456 ----
Karsten Hopp f93751
  	    if (*spf == NUL)
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		EMSGN(_("E765: 'spellfile' does not have %ld entries"), idx);
Karsten Hopp f93751
+ 		vim_free(fnamebuf);
Karsten Hopp f93751
  		return;
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	}
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9442,9447 ****
Karsten Hopp f93751
--- 9462,9468 ----
Karsten Hopp f93751
  	if (buf != NULL && bufIsChanged(buf))
Karsten Hopp f93751
  	{
Karsten Hopp f93751
  	    EMSG(_(e_bufloaded));
Karsten Hopp f93751
+ 	    vim_free(fnamebuf);
Karsten Hopp f93751
  	    return;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9536,9541 ****
Karsten Hopp f93751
--- 9557,9563 ----
Karsten Hopp f93751
  
Karsten Hopp f93751
  	redraw_all_later(SOME_VALID);
Karsten Hopp f93751
      }
Karsten Hopp f93751
+     vim_free(fnamebuf);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9544,9550 ****
Karsten Hopp f93751
      static void
Karsten Hopp f93751
  init_spellfile()
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	buf[MAXPATHL];
Karsten Hopp f93751
      int		l;
Karsten Hopp f93751
      char_u	*fname;
Karsten Hopp f93751
      char_u	*rtp;
Karsten Hopp f93751
--- 9566,9572 ----
Karsten Hopp f93751
      static void
Karsten Hopp f93751
  init_spellfile()
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*buf;
Karsten Hopp f93751
      int		l;
Karsten Hopp f93751
      char_u	*fname;
Karsten Hopp f93751
      char_u	*rtp;
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9554,9559 ****
Karsten Hopp f93751
--- 9576,9585 ----
Karsten Hopp f93751
  
Karsten Hopp f93751
      if (*curwin->w_s->b_p_spl != NUL && curwin->w_s->b_langp.ga_len > 0)
Karsten Hopp f93751
      {
Karsten Hopp f93751
+ 	buf = alloc(MAXPATHL);
Karsten Hopp f93751
+ 	if (buf == NULL)
Karsten Hopp f93751
+ 	    return;
Karsten Hopp f93751
+ 
Karsten Hopp f93751
  	/* Find the end of the language name.  Exclude the region.  If there
Karsten Hopp f93751
  	 * is a path separator remember the start of the tail. */
Karsten Hopp f93751
  	for (lend = curwin->w_s->b_p_spl; *lend != NUL
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9597,9603 ****
Karsten Hopp f93751
  				 "/%.*s", (int)(lend - lstart), lstart);
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  		l = (int)STRLEN(buf);
Karsten Hopp f93751
! 		fname = LANGP_ENTRY(curwin->w_s->b_langp, 0)->lp_slang->sl_fname;
Karsten Hopp f93751
  		vim_snprintf((char *)buf + l, MAXPATHL - l, ".%s.add",
Karsten Hopp f93751
  			fname != NULL
Karsten Hopp f93751
  			  && strstr((char *)gettail(fname), ".ascii.") != NULL
Karsten Hopp f93751
--- 9623,9630 ----
Karsten Hopp f93751
  				 "/%.*s", (int)(lend - lstart), lstart);
Karsten Hopp f93751
  		}
Karsten Hopp f93751
  		l = (int)STRLEN(buf);
Karsten Hopp f93751
! 		fname = LANGP_ENTRY(curwin->w_s->b_langp, 0)
Karsten Hopp f93751
! 							 ->lp_slang->sl_fname;
Karsten Hopp f93751
  		vim_snprintf((char *)buf + l, MAXPATHL - l, ".%s.add",
Karsten Hopp f93751
  			fname != NULL
Karsten Hopp f93751
  			  && strstr((char *)gettail(fname), ".ascii.") != NULL
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 9607,9612 ****
Karsten Hopp f93751
--- 9634,9641 ----
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
  	    aspath = FALSE;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
+ 
Karsten Hopp f93751
+ 	vim_free(buf);
Karsten Hopp f93751
      }
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
*** ../vim-7.3.160/src/tag.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/tag.c	2011-04-11 20:54:36.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 775,791 ****
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		list_T	*list;
Karsten Hopp f93751
  		char_u	tag_name[128 + 1];
Karsten Hopp f93751
! 		char_u	fname[MAXPATHL + 1];
Karsten Hopp f93751
! 		char_u	cmd[CMDBUFFSIZE + 1];
Karsten Hopp f93751
  
Karsten Hopp f93751
  		/*
Karsten Hopp f93751
  		 * Add the matching tags to the location list for the current
Karsten Hopp f93751
  		 * window.
Karsten Hopp f93751
  		 */
Karsten Hopp f93751
  
Karsten Hopp f93751
  		list = list_alloc();
Karsten Hopp f93751
! 		if (list == NULL)
Karsten Hopp f93751
  		    goto end_do_tag;
Karsten Hopp f93751
  
Karsten Hopp f93751
  		for (i = 0; i < num_matches; ++i)
Karsten Hopp f93751
  		{
Karsten Hopp f93751
--- 775,799 ----
Karsten Hopp f93751
  	    {
Karsten Hopp f93751
  		list_T	*list;
Karsten Hopp f93751
  		char_u	tag_name[128 + 1];
Karsten Hopp f93751
! 		char_u	*fname;
Karsten Hopp f93751
! 		char_u	*cmd;
Karsten Hopp f93751
  
Karsten Hopp f93751
  		/*
Karsten Hopp f93751
  		 * Add the matching tags to the location list for the current
Karsten Hopp f93751
  		 * window.
Karsten Hopp f93751
  		 */
Karsten Hopp f93751
  
Karsten Hopp f93751
+ 		fname = alloc(MAXPATHL + 1);
Karsten Hopp f93751
+ 		cmd = alloc(CMDBUFFSIZE + 1);
Karsten Hopp f93751
  		list = list_alloc();
Karsten Hopp f93751
! 		if (list == NULL || fname == NULL || cmd == NULL)
Karsten Hopp f93751
! 		{
Karsten Hopp f93751
! 		    vim_free(cmd);
Karsten Hopp f93751
! 		    vim_free(fname);
Karsten Hopp f93751
! 		    if (list != NULL)
Karsten Hopp f93751
! 			list_free(list, TRUE);
Karsten Hopp f93751
  		    goto end_do_tag;
Karsten Hopp f93751
+ 		}
Karsten Hopp f93751
  
Karsten Hopp f93751
  		for (i = 0; i < num_matches; ++i)
Karsten Hopp f93751
  		{
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 911,916 ****
Karsten Hopp f93751
--- 919,926 ----
Karsten Hopp f93751
  		set_errorlist(curwin, list, ' ', IObuff);
Karsten Hopp f93751
  
Karsten Hopp f93751
  		list_free(list, TRUE);
Karsten Hopp f93751
+ 		vim_free(fname);
Karsten Hopp f93751
+ 		vim_free(cmd);
Karsten Hopp f93751
  
Karsten Hopp f93751
  		cur_match = 0;		/* Jump to the first tag */
Karsten Hopp f93751
  	    }
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3777,3784 ****
Karsten Hopp f93751
      char_u  *start;		/* start of the value */
Karsten Hopp f93751
      char_u  *end;		/* after the value; can be NULL */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	buf[MAXPATHL];
Karsten Hopp f93751
      int		len = 0;
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* check that the field name doesn't exist yet */
Karsten Hopp f93751
      if (dict_find(dict, (char_u *)field_name, -1) != NULL)
Karsten Hopp f93751
--- 3787,3795 ----
Karsten Hopp f93751
      char_u  *start;		/* start of the value */
Karsten Hopp f93751
      char_u  *end;		/* after the value; can be NULL */
Karsten Hopp f93751
  {
Karsten Hopp f93751
!     char_u	*buf;
Karsten Hopp f93751
      int		len = 0;
Karsten Hopp f93751
+     int		retval;
Karsten Hopp f93751
  
Karsten Hopp f93751
      /* check that the field name doesn't exist yet */
Karsten Hopp f93751
      if (dict_find(dict, (char_u *)field_name, -1) != NULL)
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3791,3796 ****
Karsten Hopp f93751
--- 3802,3810 ----
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	return FAIL;
Karsten Hopp f93751
      }
Karsten Hopp f93751
+     buf = alloc(MAXPATHL);
Karsten Hopp f93751
+     if (buf == NULL)
Karsten Hopp f93751
+ 	return FAIL;
Karsten Hopp f93751
      if (start != NULL)
Karsten Hopp f93751
      {
Karsten Hopp f93751
  	if (end == NULL)
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 3800,3811 ****
Karsten Hopp f93751
  		--end;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	len = (int)(end - start);
Karsten Hopp f93751
! 	if (len > (int)sizeof(buf) - 1)
Karsten Hopp f93751
! 	    len = sizeof(buf) - 1;
Karsten Hopp f93751
  	vim_strncpy(buf, start, len);
Karsten Hopp f93751
      }
Karsten Hopp f93751
      buf[len] = NUL;
Karsten Hopp f93751
!     return dict_add_nr_str(dict, field_name, 0L, buf);
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
--- 3814,3827 ----
Karsten Hopp f93751
  		--end;
Karsten Hopp f93751
  	}
Karsten Hopp f93751
  	len = (int)(end - start);
Karsten Hopp f93751
! 	if (len > MAXPATHL - 1)
Karsten Hopp f93751
! 	    len = MAXPATHL - 1;
Karsten Hopp f93751
  	vim_strncpy(buf, start, len);
Karsten Hopp f93751
      }
Karsten Hopp f93751
      buf[len] = NUL;
Karsten Hopp f93751
!     retval = dict_add_nr_str(dict, field_name, 0L, buf);
Karsten Hopp f93751
!     vim_free(buf);
Karsten Hopp f93751
!     return retval;
Karsten Hopp f93751
  }
Karsten Hopp f93751
  
Karsten Hopp f93751
  /*
Karsten Hopp f93751
*** ../vim-7.3.160/src/vim.h	2010-12-30 12:30:26.000000000 +0100
Karsten Hopp f93751
--- src/vim.h	2011-04-11 20:50:54.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 1435,1440 ****
Karsten Hopp f93751
--- 1435,1442 ----
Karsten Hopp f93751
  
Karsten Hopp f93751
  #define IOSIZE	   (1024+1)	/* file i/o and sprintf buffer size */
Karsten Hopp f93751
  
Karsten Hopp f93751
+ #define DIALOG_MSG_SIZE 1000	/* buffer size for dialog_msg() */
Karsten Hopp f93751
+ 
Karsten Hopp f93751
  #ifdef FEAT_MBYTE
Karsten Hopp f93751
  # define MSG_BUF_LEN 480	/* length of buffer for small messages */
Karsten Hopp f93751
  # define MSG_BUF_CLEN  (MSG_BUF_LEN / 6)    /* cell length (worst case: utf-8
Karsten Hopp f93751
*** ../vim-7.3.160/src/xxd/xxd.c	2011-04-02 14:44:50.000000000 +0200
Karsten Hopp f93751
--- src/xxd/xxd.c	2011-04-11 16:40:48.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 476,482 ****
Karsten Hopp f93751
    int octspergrp = -1;	/* number of octets grouped in output */
Karsten Hopp f93751
    int grplen;		/* total chars per octet group */
Karsten Hopp f93751
    long length = -1, n = 0, seekoff = 0;
Karsten Hopp f93751
!   char l[LLEN+1];
Karsten Hopp f93751
    char *pp;
Karsten Hopp f93751
  
Karsten Hopp f93751
  #ifdef AMIGA
Karsten Hopp f93751
--- 476,482 ----
Karsten Hopp f93751
    int octspergrp = -1;	/* number of octets grouped in output */
Karsten Hopp f93751
    int grplen;		/* total chars per octet group */
Karsten Hopp f93751
    long length = -1, n = 0, seekoff = 0;
Karsten Hopp f93751
!   static char l[LLEN+1];  /* static because it may be too big for stack */
Karsten Hopp f93751
    char *pp;
Karsten Hopp f93751
  
Karsten Hopp f93751
  #ifdef AMIGA
Karsten Hopp f93751
*** ../vim-7.3.160/src/version.c	2011-04-11 16:56:29.000000000 +0200
Karsten Hopp f93751
--- src/version.c	2011-04-11 21:15:33.000000000 +0200
Karsten Hopp f93751
***************
Karsten Hopp f93751
*** 716,717 ****
Karsten Hopp f93751
--- 716,719 ----
Karsten Hopp f93751
  {   /* Add new patch number below this line */
Karsten Hopp f93751
+ /**/
Karsten Hopp f93751
+     161,
Karsten Hopp f93751
  /**/
Karsten Hopp f93751
Karsten Hopp f93751
-- 
Karsten Hopp f93751
The process for understanding customers primarily involves sitting around with
Karsten Hopp f93751
other marketing people and talking about what you would to if you were dumb
Karsten Hopp f93751
enough to be a customer.
Karsten Hopp f93751
				(Scott Adams - The Dilbert principle)
Karsten Hopp f93751
Karsten Hopp f93751
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f93751
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f93751
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f93751
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///