summaryrefslogtreecommitdiff
path: root/misc/elizatalk/patches/patch-ab
blob: 3d57f97fd7f0916f42cdd54b5e8d43ae0ad89b2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$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;
 {