diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/suggestions.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/suggestions.c b/Python/suggestions.c index d4e9dc2..2fd6714 100644 --- a/Python/suggestions.c +++ b/Python/suggestions.c @@ -102,7 +102,10 @@ calculate_suggestions(PyObject *dir, if (current_distance == -1) { return NULL; } - if (current_distance == 0 || current_distance > MAX_DISTANCE) { + if (current_distance == 0 || + current_distance > MAX_DISTANCE || + current_distance * 2 > name_size) + { continue; } if (!suggestion || current_distance < suggestion_distance) { |