/*
 *  Copyright (c) 1992, 1993 John E. Davis  (davis@amy.tch.harvard.edu)
 *  All Rights Reserved.
 */
#include <stdio.h>
#include <string.h>

#include "config.h"
#include "buffer.h"
#include "replace.h"
#include "search.h"
#include "screen.h"
#include "ins.h"

int replace_next(char *old, char *neew)
{
   int n;

    if (search(old, 1, 0) == 0) return(0);

    /* In the future, I will make this somewhat smart in the following way:
       If neew = "Hello" and old = "heLLo" then replace it with "Hello".
       But if old is "World" and neew is "hello", then replace it with "Hello".
       */
   n = strlen(old);
   deln(&n);
   ins_chars((unsigned char *) neew, strlen(neew));
   return(1);
}

