mirror of
				https://github.com/troglobit/editline.git
				synced 2025-10-31 08:18:11 +08:00 
			
		
		
		
	Avoid continuously duplicate commands in history
When adding a command to history, if CONFIG_UNIQUE_HISTORY is defined, always compare current command with the last entry in history.
This commit is contained in:
		| @@ -1130,7 +1130,7 @@ static void hist_add(const char *p) | ||||
|     char *s; | ||||
|  | ||||
| #ifdef CONFIG_UNIQUE_HISTORY | ||||
|     if (H.Pos && strcmp(p, H.Lines[H.Pos - 1]) == 0) | ||||
|     if (H.Size && strcmp(p, H.Lines[H.Size - 1]) == 0) | ||||
|         return; | ||||
| #endif | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Abit
					Abit