Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.1.222
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.222 (after 7.1.217)
Problem:    Wildcards in argument of ":helptags" are not expanded.  (Marcel
	    Svitalsky)
Solution:   Expand wildcards in the directory name.
Files:	    src/ex_cmds.c


*** ../vim-7.1.221/src/ex_cmds.c	Fri Jan 11 21:00:49 2008
--- src/ex_cmds.c	Sat Jan 12 21:40:51 2008
***************
*** 6106,6111 ****
--- 6106,6113 ----
  #ifdef FEAT_MULTI_LANG
      char_u	lang[2];
  #endif
+     expand_T	xpc;
+     char_u	*dirname;
      char_u	ext[5];
      char_u	fname[8];
      int		filecount;
***************
*** 6119,6125 ****
  	eap->arg = skipwhite(eap->arg + 3);
      }
  
!     if (!mch_isdir(eap->arg))
      {
  	EMSG2(_("E150: Not a directory: %s"), eap->arg);
  	return;
--- 6121,6131 ----
  	eap->arg = skipwhite(eap->arg + 3);
      }
  
!     ExpandInit(&xpc);
!     xpc.xp_context = EXPAND_DIRECTORIES;
!     dirname = ExpandOne(&xpc, eap->arg, NULL,
! 			    WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
!     if (dirname == NULL || !mch_isdir(dirname))
      {
  	EMSG2(_("E150: Not a directory: %s"), eap->arg);
  	return;
***************
*** 6127,6133 ****
  
  #ifdef FEAT_MULTI_LANG
      /* Get a list of all files in the directory. */
!     STRCPY(NameBuff, eap->arg);
      add_pathsep(NameBuff);
      STRCAT(NameBuff, "*");
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
--- 6133,6139 ----
  
  #ifdef FEAT_MULTI_LANG
      /* Get a list of all files in the directory. */
!     STRCPY(NameBuff, dirname);
      add_pathsep(NameBuff);
      STRCAT(NameBuff, "*");
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
***************
*** 6135,6140 ****
--- 6141,6147 ----
  	    || filecount == 0)
      {
  	EMSG2("E151: No match: %s", NameBuff);
+ 	vim_free(dirname);
  	return;
      }
  
***************
*** 6200,6206 ****
  	    ext[1] = fname[5];
  	    ext[2] = fname[6];
  	}
! 	helptags_one(eap->arg, ext, fname, add_help_tags);
      }
  
      ga_clear(&ga);
--- 6207,6213 ----
  	    ext[1] = fname[5];
  	    ext[2] = fname[6];
  	}
! 	helptags_one(dirname, ext, fname, add_help_tags);
      }
  
      ga_clear(&ga);
***************
*** 6208,6215 ****
  
  #else
      /* No language support, just use "*.txt" and "tags". */
!     helptags_one(eap->arg, (char_u *)".txt", (char_u *)"tags", add_help_tags);
  #endif
  }
  
      static void
--- 6215,6223 ----
  
  #else
      /* No language support, just use "*.txt" and "tags". */
!     helptags_one(dirname, (char_u *)".txt", (char_u *)"tags", add_help_tags);
  #endif
+     vim_free(dirname);
  }
  
      static void
*** ../vim-7.1.221/src/version.c	Sat Jan 12 18:13:05 2008
--- src/version.c	Sun Jan 13 13:27:04 2008
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     222,
  /**/

-- 
   Arthur pulls Pin out.  The MONK blesses the grenade as ...
ARTHUR:  (quietly) One, two, five ...
GALAHAD: Three, sir!
ARTHUR:  Three.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///