*** eval.c.orig	Tue Sep 04 22:22:42 2007
--- eval.c	Tue Sep 04 22:30:27 2007
***************
*** 14015,14020 ****
--- 14015,14023 ----
  	options |= SEARCH_START;
      if (flags & SP_END)
  	options |= SEARCH_END;
+     /* Force 'W' if 'r' is in flags. */
+     if (flags & SP_REPEAT)
+ 	p_ws = FALSE;
  
      /* Optional extra argument: line number to stop searching. */
      if (argvars[1].v_type != VAR_UNKNOWN
***************
*** 14275,14280 ****
--- 14278,14286 ----
      {
  	n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
  					       options, RE_SEARCH, lnum_stop);
+ 	/* Clear flag for match at start position: it only makes sense
+ 	 * for the very first search. */
+ 	options &= !SEARCH_START;
  	if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
  	    /* didn't find it or found the first match again: FAIL */
  	    break;
