diff --git a/src/util/Makefile.in b/src/util/Makefile.in
index 9c617fe..29a4ffb 100755
--- a/src/util/Makefile.in
+++ b/src/util/Makefile.in
@@ -29,7 +29,8 @@ all: $(BINDIR)/asciipasswd \
$(BINDIR)/shopconv \
$(BINDIR)/sign \
$(BINDIR)/split \
- $(BINDIR)/wld2html
+ $(BINDIR)/wld2html \
+ $(BINDIR)/webster
asciipasswd: $(BINDIR)/asciipasswd
diff --git a/src/util/webster.c b/src/util/webster.c
index 0e0bb87..b234452 100755
--- a/src/util/webster.c
+++ b/src/util/webster.c
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
}
pid = atoi(argv[2]);
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"lynx -accept_all_cookies -source http://www.thefreedictionary.com/%s"
" >webster.html", argv[1]);
system(buf);
@@ -41,9 +41,9 @@ int main(int argc, char **argv)
void parse_webster_html(char *arg) {
FILE *infile, *outfile;
char scanbuf[MEM_USE], outline[MEM_USE], *p, *q;
-
+
outfile = fopen("websterinfo", "w");
- if (!outfile)
+ if (!outfile)
exit(1);
infile = fopen("webster.html", "r");
@@ -54,13 +54,13 @@ void parse_webster_html(char *arg) {
}
unlink("webster.html"); /* We can still read */
-
+
for ( ; get_line(infile, buf)!=0; ) {
-
- if (strncmp(buf, "", 37) != 0)
+
+ if (strncmp(buf, "", 40) != 0)
continue; // read until we hit the line with results in it.
-
- p = buf+37;
+
+ p = buf+40;
if (strncmp(p, "
", 4) == 0)
{
@@ -71,9 +71,9 @@ void parse_webster_html(char *arg) {
{
while (strncmp(p, "ds-list", 7)) //seek to the definition
p++;
-
+
strncpy(scanbuf, p, sizeof(scanbuf)); // strtok on a copy.
-
+
p = strtok(scanbuf, ">"); // chop the line at the end of tags:
word becomes "
"); // skip the rest of this tag.
@@ -82,51 +82,51 @@ void parse_webster_html(char *arg) {
while (1)
{
q = outline;
-
+
while (*p != '<')
{
assert(p < scanbuf+sizeof(scanbuf));
*q++ = *p++;
- }
+ }
if (!strncmp(p, "
tag or a