[3882] in Athena Bugs
rt 6.4R: ispell (various problems fixed)
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Wed Jan 3 09:42:14 1990
Date: Wed, 3 Jan 90 09:41:49 -0500
From: Jonathan I. Kamens <jik@PIT-MANAGER.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, testers@ATHENA.MIT.EDU
System name: pit-manager
Type and version: RTPC-ROMPC 6.4R
Display type: apa16
megapel
I started on a rewrite of the ispell man page last night, and in the
process found it necessary to look at the sources for ispell. Doing
that motivated me to make several important changes to the files
ispell.c and term.c in the sources. Changes to both files are listed
below, and a patch can be found in /mit/jik/src/ispell/patch-file.
The changes to ispell.c are extensive, and I do not expect them to
get into 6.4R before it goes out into the field because there is not
enough time for the staff to test them. However, the changes to
term.c are simple and address a bug report recently sent in about
ispell not using TIOCGWINSZ to get the window size. If possible, I
would like to see those changes make it into the release, although it
is not of the highest importance that they do.
jik
CHANGES
ispell.c:
1 Added #include <strings.h> in order to use the rindex() function.
2 Reorganized the variables declared at the top of the file and added
lots of comments in order to make it clear what each variable is
used for.
3 Fixed inaccuracies in the usage() message and (IMPORTANT) added a
missing argument to an fprintf.
4 Added #define'd (based on DEBUG_FILE) facility for some debugging
output to a file (not enabled by default).
5 The program name that prints out is now the last part of argv[0],
not argv[0] in its entirety.
6 Added "-n" flag to specify that the input should be processes as
nroff/troff text, and disabled nroff/troff processing by default
(IMPORTANT).
7 Added better command-line parsing to more often detect illegal
command lines.
8 Changed certain buffers from constant sizes to malloc()'d and
realloc()'d sizes because they need to grow in rare situations.
This prevents coredumps when spell-checking files with very long
lines (IMPORTANT).
9 Changed the context display code so that the program does not
attempt to improperly display lines that are longer than the width
of the screen (IMPORTANT).
10 Modified inserttoken procedure (and the places that call it) so
that it correctly deals with changing the sizes of buffers as
necessary (this change was made necessary by changes number 8 and
9).
11 Changed a few 0 to '\0' for neatness.
The code in this file could use a rewrite to improve its modularity.
I don't think that the work I've done has hurt the modularity any, but
then again, there wasn't much to start with.
term.c:
1 Added support for TIOCGWINSZ to determine window size (IMPORTANT).
2 Fixed onstop() procedure so that it does the right thing when using
"-s -a".