ispell incorrectly handles plurals (or is that plurales?)

geoff at desint.UUCP geoff at desint.UUCP
Sat Feb 28 19:16:30 AEST 1987


Well, that didn't take as long as I thought it was going to.  As I said
before, disregard Bill Randle's latest bug fix (the one for "activityes").
Instead, apply this one.  It also incorporates the mask typo Bill found.

Problem:  ispell.c has a typo in a mask (0x7 instead of 0x7f).

Problem:  ispell.c issues the egrep command with "-i", instead of leaving it
	  to EGREPCMD in config.h, causing problems if you don't have -i.

Problem:  good.c incorrectly thinks "es" is an acceptable pluralization for
	  just about any word, instead of limiting it to those ending
	  in S, X, Z, or H.

Fix:	  Run this article through patch.  From rn, type "|patch -d dir",
	  where dir is the directory where you have ispell.  From other
	  newsreaders, save it in a file and type "patch -d dir < file".
	  If your egrep has the -i switch, you will also have to
	  modify EGREPCMD in config.h to include the -i switch there.
	  I don't include a patch for that.

Index: good.c

*** good.c.old	Sat Feb 28 01:06:31 1987
--- good.c	Sat Feb 28 01:06:34 1987
***************
*** 392,398
  		return;
  	case 'E': /* S (except simple adding of an S) */
  		p[-2] = 0;	/* drop the ES */
! 		if ((dent = lookup (w, strlen (w))) != NULL) {
  			if (dent->s_flag)
  				wordok = 1;;
  			return;

--- 395,402 -----
  		return;
  	case 'E': /* S (except simple adding of an S) */
  		p[-2] = 0;	/* drop the ES */
! 		if (index ("SXZH", p[-3]) != NULL
! 		    && (dent = lookup (w, strlen (w))) != NULL) {
  			if (dent->s_flag)
  				wordok = 1;;
  			return;


Index: ispell.c

*** ispell.c.old	Sat Feb 28 01:06:52 1987
--- ispell.c	Sat Feb 28 01:06:56 1987
***************
*** 206,212
  		case 'w':
  			num[3] = '\0';
  #ifdef NO8BIT
! 			mask = 0x7;
  #else
  			mask = 0xff;
  #endif

--- 210,216 -----
  		case 'w':
  			num[3] = '\0';
  #ifdef NO8BIT
! 			mask = 0x7f;
  #else
  			mask = 0xff;
  #endif
***************
*** 885,891
  #ifdef LOOK
  		if (wild)
  			/* string has wild card characters */
! 			sprintf (cmd, "%s -i '^%s$' %s", EGREPCMD, grepstr, WORDS);
  		else
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);

--- 889,895 -----
  #ifdef LOOK
  		if (wild)
  			/* string has wild card characters */
! 			sprintf (cmd, "%s '^%s$' %s", EGREPCMD, grepstr, WORDS);
  		else
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
***************
*** 890,896
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
  #else
! 		sprintf (cmd, "%s -i '^%s$' %s", EGREPCMD, grepstr, WORDS);
  #endif
  		shellescape (cmd);
  	}

--- 894,900 -----
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
  #else
! 		sprintf (cmd, "%s '^%s$' %s", EGREPCMD, grepstr, WORDS);
  #endif
  		shellescape (cmd);
  	}
-- 

	Geoff Kuenning
	{hplabs,ihnp4}!trwrb!desint!geoff



More information about the Comp.sources.bugs mailing list