mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 07:04:12 +00:00 
			
		
		
		
	fixed accidentally correcting to some directories with short name length
This commit is contained in:
		| @@ -76,7 +76,8 @@ def get_new_command(command, settings): | |||||||
|             cwd = os.path.split(cwd)[0] |             cwd = os.path.split(cwd)[0] | ||||||
|             continue |             continue | ||||||
|         best_match = min(_get_sub_dirs(cwd), key=lambda x: _dam_lev_dist(directory, x)) |         best_match = min(_get_sub_dirs(cwd), key=lambda x: _dam_lev_dist(directory, x)) | ||||||
|         if _dam_lev_dist(directory, best_match) > MAX_ALLOWED_STR_DIST: |         best_dist = _dam_lev_dist(directory, best_match) | ||||||
|  |         if best_dist > MAX_ALLOWED_STR_DIST or best_dist >= len(best_match): | ||||||
|             return cd_mkdir.get_new_command(command, settings) |             return cd_mkdir.get_new_command(command, settings) | ||||||
|         else: |         else: | ||||||
|             cwd = os.path.join(cwd, best_match) |             cwd = os.path.join(cwd, best_match) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user