[BACK]Return to re_search.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/re_search.c between version 1.35 and 1.36

version 1.35, 2020/07/22 13:29:05 version 1.36, 2021/04/22 19:50:55
Line 211 
Line 211 
         return (TRUE);          return (TRUE);
 }  }
   
   int
   re_repl(int f, int n)
   {
           int     rcnt = 0;               /* replacements made so far     */
           int     plen, s;                /* length of found string       */
           char    news[NPAT];             /* replacement string           */
   
           if ((s = re_readpattern("RE Replace")) != TRUE)
                   return (s);
           if (eread("Replace %s with: ", news, NPAT,
               EFNUL | EFNEW | EFCR, re_pat) == NULL)
                   return (ABORT);
   
           while (re_forwsrch() == TRUE) {
                   plen = regex_match[0].rm_eo - regex_match[0].rm_so;
                   if (re_doreplace((RSIZE)plen, news) == FALSE)
                           return (FALSE);
                   rcnt++;
           }
   
           curwp->w_rflag |= WFFULL;
           update(CMODE);
           if (!inmacro)
                   ewprintf("(%d replacement(s) done)", rcnt);
   
           return(TRUE);
   }
   
 /*  /*
  * Routine re_doreplace calls lreplace to make replacements needed by   * Routine re_doreplace calls lreplace to make replacements needed by
  * re_query replace.  Its reason for existence is to deal with \1, \2. etc.   * re_query replace.  Its reason for existence is to deal with \1, \2. etc.

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36