$NetBSD: patch-ab,v 1.3 2012/11/23 12:11:41 joerg Exp $ --- splotch.c.orig 2000-10-23 11:37:56.000000000 +0000 +++ splotch.c @@ -17,9 +17,12 @@ #define NAME "Eliza" /* name of robot */ #define SP_HIST 4 /* number of slots in old key queue */ #define TEMPLSIZ 2000 /* maximum number of templates */ -#define DICTFILE "/usr/share/elizatalk/main.dict" /* name of dictionary file */ -#define SYNFILE "/usr/share/elizatalk/syn.dict" /* name of dictionary file */ -#define WORDSDIR "/usr/share/elizatalk/words" /* name of words directory without '/' at the end*/ +#ifndef ELIZADIR +#define ELIZADIR "/usr/share/elizatalk" +#endif +#define DICTFILE ELIZADIR "/main.dict" /* name of dictionary file */ +#define SYNFILE ELIZADIR "/syn.dict" /* name of dictionary file */ +#define WORDSDIR ELIZADIR "/words" /* name of words directory without '/' at the end*/ #define DEBUG 0 /* debug flag */ #define VERBOSE 0 /* verbose errors */ #define DEB 0 @@ -40,10 +43,11 @@ FILE *dfile; /* file poi int maxtempl; /* templ[maxtempl] is last entry */ int oldkeywd[SP_HIST]; /* queue of indices of most recent keys */ -char *strcasestr(); char *phrasefind(); char *lower(); +void shift(int base, int delta); + /*************************************************************************** ask(person, question) takes two null terminated strings, one is the question and the other is the person who asked the question. The function @@ -549,7 +553,7 @@ char *lower(s) char *s; { int i; - char tmp[400]; + static char tmp[400]; for (i=0; s[i]; ++i) tmp[i] = tolower(s[i]); @@ -642,30 +646,6 @@ char fname[50]; -/********************************* -strcasestr() -**********************************/ -char *strcasestr (s1, s2) -char *s1, *s2; -{ - - char n1[256], n2[256]; - int j; - - for (j=0;s1[j] != '\0';j++) - n1[j] = toupper (s1[j]); - n1[j] = '\0'; - for (j=0;s2[j] != '\0';j++) - n2[j] = toupper (s2[j]); - n2[j] = '\0'; - - return (strstr (n1, n2)); -} - - - - - @@ -706,7 +686,7 @@ trytempl(question) firstime=0; } else - key=strtok(key[strlen(key)], ":\n"); + key=strtok(0, ":\n"); if (key == NULL) { done=1; break; @@ -893,7 +873,7 @@ gswap(old, new) } - +void shift(base, delta) int base, delta; {