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