To: [email protected]
Subject: Patch 5.7a.005
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.7a.005
Problem:    When ":s//~/" doesn't find a match it reports "[NULL]" for the
           pattern.
Solution:   Use get_search_pat() to obtain the actually used pattern.
Files:      src/ex_cmds.c, src/proto/search.pro, src/search.c


*** ../vim-5.7a.4/src/ex_cmds.c Wed Jun  7 16:13:24 2000
--- src/ex_cmds.c       Tue Jun 20 15:55:51 2000
***************
*** 3505,3511 ****
       else if (got_match)     /* did find something but nothing substituted */
           MSG("");
       else if (do_error)      /* nothing found */
!           emsg2(e_patnotf2, pat);
     }

     vim_free(prog);
--- 3511,3517 ----
       else if (got_match)     /* did find something but nothing substituted */
           MSG("");
       else if (do_error)      /* nothing found */
!           emsg2(e_patnotf2, get_search_pat());
     }

     vim_free(prog);
*** ../vim-5.7a.4/src/proto/search.pro  Sat Jun 10 11:55:38 2000
--- src/proto/search.pro        Tue Jun 20 15:55:38 2000
***************
*** 1,5 ****
--- 1,6 ----
 /* search.c */
 vim_regexp *search_regcomp __ARGS((char_u *pat, int pat_save, int pat_use, int options));
+ char_u *get_search_pat __ARGS((void));
 void save_search_patterns __ARGS((void));
 void restore_search_patterns __ARGS((void));
 void set_reg_ic __ARGS((char_u *pat));
*** ../vim-5.7a.4/src/search.c  Mon Jun 19 21:31:05 2000
--- src/search.c        Tue Jun 20 15:55:33 2000
***************
*** 183,188 ****
--- 183,197 ----
     return vim_regcomp(pat, magic);
 }

+ /*
+  * Get search pattern used by search_regcomp().
+  */
+     char_u *
+ get_search_pat()
+ {
+     return mr_pattern;
+ }
+
     static void
 save_re_pat(idx, pat, magic)
     int               idx;
*** ../vim-5.7a.4/src/version.c Mon Jun 19 21:31:05 2000
--- src/version.c       Tue Jun 20 15:56:56 2000
***************
*** 420,421 ****
--- 420,423 ----
 {   /* Add new patch number below this line */
+ /**/
+     5,
 /**/

--
hundred-and-one symptoms of being an internet addict:
66. You create a homepage with the impression to cure the afflicted...but
   your hidden agenda is to receive more e-mail.

/-/-- Bram Moolenaar --- [email protected] --- http://www.moolenaar.net --\-\
\-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/