[comp.sources.bugs] Ispell Bug

buehring@home.csc.ti.com (Walt Buehring) (05/20/88)

Greetings,

I just received the following information regarding a bug in ispell:

) I've been told by one of our hackers that the tree.c routine
) smashes the personal dictionary each time it is run.
) 
) He says he changed the fopen( .. ,"w") to be fopen( .., "a"), but
) even this doesn't fix things.
) 
) Don't know if you are interested in looking into this, but I
) thought I could at least pass the information on anyways.

I posted the original ispell but did not write it, nor have I been
involved with the later versions that I understand have been posted.
I do not know in which version the above bug occurs, but I've never
encountered it in the original version.

\/\/alt

Walt Buehring
Texas Instruments - Computer Science Center

ARPA:  Buehring@CSC.TI.COM
UUCP:  {smu, texsun, im4u, rice} ! ti-csl ! buehring

geoff@desint.UUCP (Geoff Kuenning) (05/22/88)

In article <49451@ti-csl.CSNET> buehring@home.UUCP (Walt Buehring) writes:

> I just received the following information regarding a bug in ispell:
> 
> ) I've been told by one of our hackers that the tree.c routine
> ) smashes the personal dictionary each time it is run.
...
> I do not know in which version the above bug occurs, but I've never
> encountered it in the original version.

The bug is in ispell version 2.0.00 and 2.0.01, May 1987 Beta posting.  It is
the main reason why users of version 2 want patch #2, which cures this
problem.  Patch #2 to ispell is available from the comp.sources.misc
archives.  Persons who do not have archive access (few;  the archives are
accessible through both uucp and ftp) may get the patch from me, but please
keep in mind that the money for sending it comes out of my own personal
pocket.
-- 
	Geoff Kuenning   geoff@ITcorp.com   {uunet,trwrb}!desint!geoff

lfk@mbio.med.upenn.edu (Lee Kolakowski) (07/24/89)

Has anyone noticed that when ispell is running on more that one file
it forgets the ~/.ispell_words contents and continually thinks those
words are mispelled, so I fixed this by a for f in *; do ispell $f
loop. 

Any ideas, fixes or magic incantations?


--

Frank Kolakowski 

=====================================================================
|lfk@mbio.med.upenn.edu                 ||      Lee F. Kolakowski   |
|kolakowski@mscf.med.upenn.             ||	Univ. of Penna.     |
|c/o jes@eniac.seas.upenn.edu		||	Dept of Chemistry   |
|kolakowski@c.chem.upenn.edu		||	231 South 34th St.  |
|bcooperman.kolakowski@bionet-20.arpa	||	Phila, PA 19104     |
|AT&T:	1-215-898-2927			||--------------------------|
|#include <litigate.h>			||      One-Liner Here!     |
=====================================================================

aryeh@eddie.MIT.EDU (Aryeh M. Weiss) (09/15/89)

In Article 1976 of comp.sources.bugs, Frank Kolakowski writes:

> Has anyone noticed that when ispell is running on more that one file
> it forgets the ~/.ispell_words contents and continually thinks those
> words are mispelled, so I fixed this by a for f in *; do ispell $f
> loop. 
> 
> Any ideas, fixes or magic incantations?
> 
> Frank Kolakowski 

This has been driving me nuts for a long time.  I found that the
actual events were (1) invoke ispell with multiple files, (2) while
correcting words add to personal dictionary (via `I'), (3) when ispell
goes on to next file, ispell has forgotten words in personal
dictionary.

Cause: after ispell is done with a file it writes out the personal
dictionary (to ~/.ispell_words) IF the dictionary has been updated by
the user.  In doing so ispell fiddles with the case of the words in
memory.  Internally ispell handles everything in UPPER CASE, using
some bit flags to keep track of capitalization, but in writing out the
file it converts the words to lower case.  (This actually only occurs
if the CAPITILIZATION compile flag is turned on.)  Later when comparing words
it can't find matches between words in the file it is scanning and the
PD because of the case mismatch.  The fix: convert word in PD back to
UC after write in tree.c:

#! /bin/sh
# To extract, remove mail header lines and type "sh filename"
echo x - ispell.diffs
sed -e 's/^X//' > ispell.diffs << '!FaR!OuT!'
X*** tree.c	Thu Sep 14 14:28:15 1989
X--- tree.c~	Thu Sep 14 14:32:44 1989
X***************
X*** 660,666 ****
X  			cent->word[0] = toupper (cent->word[0]);
X  		toutword (cent->word, cent);
X  	}
X- 	upcase (cent->word);	/* return word to uppercase -- EF (89/09/13) */
X  #else
X  	toutword (cent->word, cent);
X  #endif
X--- 660,665 ----
X*** version.h	Thu Sep 14 14:34:31 1989
X--- version.h~	Thu Sep 14 15:04:37 1989
X***************
X*** 1,2 ****
X  static char Version_ID[] =
X!     "@(#) Ispell Version 2.0.02, May 1987 Beta posting";
X--- 1,2 ----
X  static char Version_ID[] =
X!     "@(#) Ispell Version 2.0.01, May 1987 Beta posting";
!FaR!OuT!
exit
-- 
aryeh@eddie.mit.edu
mit-eddie!lees-rif!aryeh

geoff@desint.UUCP (Geoff Kuenning) (09/20/89)

In article <12707@eddie.MIT.EDU> eliot%lees-rif@eddie.MIT.EDU
(Eliot Frank) writes:

> In Article 1976 of comp.sources.bugs, Frank Kolakowski writes:
> 
> > Has anyone noticed that when ispell is running on more that one file
> > it forgets the ~/.ispell_words contents and continually thinks those
> > words are mispelled, so I fixed this by a for f in *; do ispell $f
> > loop. 

This has long ago been fixed by patch #2 to ispell, which is available
from at least some of the archives (e.g., osu-cis) or from me.  I have
sent a copy to Eliot Frank and will send one to anyone else who wants
one;  just write.
-- 
	Geoff Kuenning   geoff@ITcorp.com   uunet!desint!geoff