Karsten Hopp d7f210
To: vim-dev@vim.org
Karsten Hopp d7f210
Subject: Patch 7.1.222
Karsten Hopp d7f210
Fcc: outbox
Karsten Hopp d7f210
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp d7f210
Mime-Version: 1.0
Karsten Hopp d7f210
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp d7f210
Content-Transfer-Encoding: 8bit
Karsten Hopp d7f210
------------
Karsten Hopp d7f210
Karsten Hopp d7f210
Patch 7.1.222 (after 7.1.217)
Karsten Hopp d7f210
Problem:    Wildcards in argument of ":helptags" are not expanded.  (Marcel
Karsten Hopp d7f210
	    Svitalsky)
Karsten Hopp d7f210
Solution:   Expand wildcards in the directory name.
Karsten Hopp d7f210
Files:	    src/ex_cmds.c
Karsten Hopp d7f210
Karsten Hopp d7f210
Karsten Hopp d7f210
*** ../vim-7.1.221/src/ex_cmds.c	Fri Jan 11 21:00:49 2008
Karsten Hopp d7f210
--- src/ex_cmds.c	Sat Jan 12 21:40:51 2008
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6106,6111 ****
Karsten Hopp d7f210
--- 6106,6113 ----
Karsten Hopp d7f210
  #ifdef FEAT_MULTI_LANG
Karsten Hopp d7f210
      char_u	lang[2];
Karsten Hopp d7f210
  #endif
Karsten Hopp d7f210
+     expand_T	xpc;
Karsten Hopp d7f210
+     char_u	*dirname;
Karsten Hopp d7f210
      char_u	ext[5];
Karsten Hopp d7f210
      char_u	fname[8];
Karsten Hopp d7f210
      int		filecount;
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6119,6125 ****
Karsten Hopp d7f210
  	eap->arg = skipwhite(eap->arg + 3);
Karsten Hopp d7f210
      }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
!     if (!mch_isdir(eap->arg))
Karsten Hopp d7f210
      {
Karsten Hopp d7f210
  	EMSG2(_("E150: Not a directory: %s"), eap->arg);
Karsten Hopp d7f210
  	return;
Karsten Hopp d7f210
--- 6121,6131 ----
Karsten Hopp d7f210
  	eap->arg = skipwhite(eap->arg + 3);
Karsten Hopp d7f210
      }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
!     ExpandInit(&xpc);
Karsten Hopp d7f210
!     xpc.xp_context = EXPAND_DIRECTORIES;
Karsten Hopp d7f210
!     dirname = ExpandOne(&xpc, eap->arg, NULL,
Karsten Hopp d7f210
! 			    WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
Karsten Hopp d7f210
!     if (dirname == NULL || !mch_isdir(dirname))
Karsten Hopp d7f210
      {
Karsten Hopp d7f210
  	EMSG2(_("E150: Not a directory: %s"), eap->arg);
Karsten Hopp d7f210
  	return;
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6127,6133 ****
Karsten Hopp d7f210
  
Karsten Hopp d7f210
  #ifdef FEAT_MULTI_LANG
Karsten Hopp d7f210
      /* Get a list of all files in the directory. */
Karsten Hopp d7f210
!     STRCPY(NameBuff, eap->arg);
Karsten Hopp d7f210
      add_pathsep(NameBuff);
Karsten Hopp d7f210
      STRCAT(NameBuff, "*");
Karsten Hopp d7f210
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
Karsten Hopp d7f210
--- 6133,6139 ----
Karsten Hopp d7f210
  
Karsten Hopp d7f210
  #ifdef FEAT_MULTI_LANG
Karsten Hopp d7f210
      /* Get a list of all files in the directory. */
Karsten Hopp d7f210
!     STRCPY(NameBuff, dirname);
Karsten Hopp d7f210
      add_pathsep(NameBuff);
Karsten Hopp d7f210
      STRCAT(NameBuff, "*");
Karsten Hopp d7f210
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6135,6140 ****
Karsten Hopp d7f210
--- 6141,6147 ----
Karsten Hopp d7f210
  	    || filecount == 0)
Karsten Hopp d7f210
      {
Karsten Hopp d7f210
  	EMSG2("E151: No match: %s", NameBuff);
Karsten Hopp d7f210
+ 	vim_free(dirname);
Karsten Hopp d7f210
  	return;
Karsten Hopp d7f210
      }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6200,6206 ****
Karsten Hopp d7f210
  	    ext[1] = fname[5];
Karsten Hopp d7f210
  	    ext[2] = fname[6];
Karsten Hopp d7f210
  	}
Karsten Hopp d7f210
! 	helptags_one(eap->arg, ext, fname, add_help_tags);
Karsten Hopp d7f210
      }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
      ga_clear(&ga);
Karsten Hopp d7f210
--- 6207,6213 ----
Karsten Hopp d7f210
  	    ext[1] = fname[5];
Karsten Hopp d7f210
  	    ext[2] = fname[6];
Karsten Hopp d7f210
  	}
Karsten Hopp d7f210
! 	helptags_one(dirname, ext, fname, add_help_tags);
Karsten Hopp d7f210
      }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
      ga_clear(&ga);
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 6208,6215 ****
Karsten Hopp d7f210
  
Karsten Hopp d7f210
  #else
Karsten Hopp d7f210
      /* No language support, just use "*.txt" and "tags". */
Karsten Hopp d7f210
!     helptags_one(eap->arg, (char_u *)".txt", (char_u *)"tags", add_help_tags);
Karsten Hopp d7f210
  #endif
Karsten Hopp d7f210
  }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
      static void
Karsten Hopp d7f210
--- 6215,6223 ----
Karsten Hopp d7f210
  
Karsten Hopp d7f210
  #else
Karsten Hopp d7f210
      /* No language support, just use "*.txt" and "tags". */
Karsten Hopp d7f210
!     helptags_one(dirname, (char_u *)".txt", (char_u *)"tags", add_help_tags);
Karsten Hopp d7f210
  #endif
Karsten Hopp d7f210
+     vim_free(dirname);
Karsten Hopp d7f210
  }
Karsten Hopp d7f210
  
Karsten Hopp d7f210
      static void
Karsten Hopp d7f210
*** ../vim-7.1.221/src/version.c	Sat Jan 12 18:13:05 2008
Karsten Hopp d7f210
--- src/version.c	Sun Jan 13 13:27:04 2008
Karsten Hopp d7f210
***************
Karsten Hopp d7f210
*** 668,669 ****
Karsten Hopp d7f210
--- 668,671 ----
Karsten Hopp d7f210
  {   /* Add new patch number below this line */
Karsten Hopp d7f210
+ /**/
Karsten Hopp d7f210
+     222,
Karsten Hopp d7f210
  /**/
Karsten Hopp d7f210
Karsten Hopp d7f210
-- 
Karsten Hopp d7f210
   Arthur pulls Pin out.  The MONK blesses the grenade as ...
Karsten Hopp d7f210
ARTHUR:  (quietly) One, two, five ...
Karsten Hopp d7f210
GALAHAD: Three, sir!
Karsten Hopp d7f210
ARTHUR:  Three.
Karsten Hopp d7f210
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp d7f210
Karsten Hopp d7f210
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp d7f210
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp d7f210
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp d7f210
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///