fortran/95509 - fix spellcheck-operator.f90 regression
authorTom Tromey <tromey@adacore.com>
Fri, 5 Jun 2020 12:40:14 +0000 (06:40 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 5 Jun 2020 17:44:24 +0000 (11:44 -0600)
My earlier patch to add case handling to the spell checker caused a
Fortran regression.  I believe I must have misread the test results.

This patch fixes the problem by changing the cutoff.  I chose this
value because the previous patch effectively multiplied the result of
get_edit_distance by 2 (unless a case change is involved).

gcc/fortran/ChangeLog:

PR fortran/95509
* misc.c (gfc_closest_fuzzy_match): Update cutoff value
computation.

gcc/fortran/misc.c

index 0fc25df..46c6277 100644 (file)
@@ -397,7 +397,7 @@ gfc_closest_fuzzy_match (const char *typo, char **candidates)
      likely to be meaningless.  */
   if (best)
     {
-      unsigned int cutoff = MAX (tl, strlen (best)) / 2;
+      unsigned int cutoff = MAX (tl, strlen (best));
 
       if (best_distance > cutoff)
        {