#include "tweak.h"

char *strstr (char *str, char *sub)
{
	int sublen;

	sublen = strlen (sub);
	while (*str)
	{
		if (! strncmp (str, sub, sublen))
			return (str);
		str++;
	}
	return ( (char*) 0 );
}

#ifdef NEED_STRDUP

#include <stdio.h>
#include "my-string.h"

char *strdup PROTO1(char *, str)
{
  char *nstr;

  if (str == (char*)0) return str;

  nstr = (char*)malloc((unsigned int)(strlen(str) + 1));

  if (nstr == (char*)0) {
    fprintf(stderr, "strdup(): not enough memory to duplicate `%s'\n", str);
    exit(1);
  }

  strcpy(nstr, str);

  return nstr;
}
#endif
