home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / src / replace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  462 b   |  27 lines

  1. /*
  2.  *  Copyright (c) 1992, 1994 John E. Davis  (davis@amy.tch.harvard.edu)
  3.  *  All Rights Reserved.
  4.  */
  5. #include <stdio.h>
  6. #include <string.h>
  7.  
  8. #include "config.h"
  9. #include "buffer.h"
  10. #include "replace.h"
  11. #include "search.h"
  12. #include "screen.h"
  13. #include "ins.h"
  14.  
  15. int replace_next(char *old, char *neew)
  16. {
  17.    int n;
  18.  
  19.     if (search(old, 1, 0) == 0) return(0);
  20.  
  21.    n = strlen(old);
  22.    deln(&n);
  23.    ins_chars((unsigned char *) neew, strlen(neew));
  24.    return(1);
  25. }
  26.  
  27.