Karsten Hopp 069261
To: vim_dev@googlegroups.com
Karsten Hopp 069261
Subject: Patch 7.3.1187
Karsten Hopp 069261
Fcc: outbox
Karsten Hopp 069261
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 069261
Mime-Version: 1.0
Karsten Hopp 069261
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 069261
Content-Transfer-Encoding: 8bit
Karsten Hopp 069261
------------
Karsten Hopp 069261
Karsten Hopp 069261
Patch 7.3.1187 (after 7.3.1170)
Karsten Hopp 069261
Problem:    "s:" is recognized but "<SID>" is not. (ZyX)
Karsten Hopp 069261
Solution:   Translate "<SID>" like "s:".
Karsten Hopp 069261
Files:	    src/eval.c
Karsten Hopp 069261
Karsten Hopp 069261
Karsten Hopp 069261
*** ../vim-7.3.1186/src/eval.c	2013-06-12 22:08:54.000000000 +0200
Karsten Hopp 069261
--- src/eval.c	2013-06-13 21:15:58.000000000 +0200
Karsten Hopp 069261
***************
Karsten Hopp 069261
*** 10976,10996 ****
Karsten Hopp 069261
  	EMSG2(_("E700: Unknown function: %s"), s);
Karsten Hopp 069261
      else
Karsten Hopp 069261
      {
Karsten Hopp 069261
! 	if (STRNCMP(s, "s:", 2) == 0)
Karsten Hopp 069261
  	{
Karsten Hopp 069261
  	    char	sid_buf[25];
Karsten Hopp 069261
  
Karsten Hopp 069261
! 	    /* Expand s: into <SNR>nr_, so that the function can also be
Karsten Hopp 069261
! 	     * called from another script. Using trans_function_name() would
Karsten Hopp 069261
! 	     * also work, but some plugins depend on the name being printable
Karsten Hopp 069261
! 	     * text. */
Karsten Hopp 069261
  	    sprintf(sid_buf, "<SNR>%ld_", (long)current_SID);
Karsten Hopp 069261
  	    rettv->vval.v_string =
Karsten Hopp 069261
! 			    alloc((int)(STRLEN(sid_buf) + STRLEN(s + 2) + 1));
Karsten Hopp 069261
  	    if (rettv->vval.v_string != NULL)
Karsten Hopp 069261
  	    {
Karsten Hopp 069261
  		STRCPY(rettv->vval.v_string, sid_buf);
Karsten Hopp 069261
! 		STRCAT(rettv->vval.v_string, s + 2);
Karsten Hopp 069261
  	    }
Karsten Hopp 069261
  	}
Karsten Hopp 069261
  	else
Karsten Hopp 069261
--- 10976,10997 ----
Karsten Hopp 069261
  	EMSG2(_("E700: Unknown function: %s"), s);
Karsten Hopp 069261
      else
Karsten Hopp 069261
      {
Karsten Hopp 069261
! 	if (STRNCMP(s, "s:", 2) == 0 || STRNCMP(s, "<SID>", 5) == 0)
Karsten Hopp 069261
  	{
Karsten Hopp 069261
  	    char	sid_buf[25];
Karsten Hopp 069261
+ 	    int		off = *s == 's' ? 2 : 5;
Karsten Hopp 069261
  
Karsten Hopp 069261
! 	    /* Expand s: and <SID> into <SNR>nr_, so that the function can
Karsten Hopp 069261
! 	     * also be called from another script. Using trans_function_name()
Karsten Hopp 069261
! 	     * would also work, but some plugins depend on the name being
Karsten Hopp 069261
! 	     * printable text. */
Karsten Hopp 069261
  	    sprintf(sid_buf, "<SNR>%ld_", (long)current_SID);
Karsten Hopp 069261
  	    rettv->vval.v_string =
Karsten Hopp 069261
! 			    alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1));
Karsten Hopp 069261
  	    if (rettv->vval.v_string != NULL)
Karsten Hopp 069261
  	    {
Karsten Hopp 069261
  		STRCPY(rettv->vval.v_string, sid_buf);
Karsten Hopp 069261
! 		STRCAT(rettv->vval.v_string, s + off);
Karsten Hopp 069261
  	    }
Karsten Hopp 069261
  	}
Karsten Hopp 069261
  	else
Karsten Hopp 069261
*** ../vim-7.3.1186/src/version.c	2013-06-13 20:57:44.000000000 +0200
Karsten Hopp 069261
--- src/version.c	2013-06-13 21:18:28.000000000 +0200
Karsten Hopp 069261
***************
Karsten Hopp 069261
*** 730,731 ****
Karsten Hopp 069261
--- 730,733 ----
Karsten Hopp 069261
  {   /* Add new patch number below this line */
Karsten Hopp 069261
+ /**/
Karsten Hopp 069261
+     1187,
Karsten Hopp 069261
  /**/
Karsten Hopp 069261
Karsten Hopp 069261
-- 
Karsten Hopp 069261
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 069261
189. You put your e-mail address in the upper left-hand corner of envelopes.
Karsten Hopp 069261
Karsten Hopp 069261
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 069261
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 069261
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 069261
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///