GUACAMOLE-1961: Detect accented letters as a part of word.

This commit is contained in:
Corentin SORIANO 2024-10-08 13:58:25 +02:00 committed by corentin-soriano
parent d328610473
commit 2edcd055bd
No known key found for this signature in database
2 changed files with 13 additions and 1 deletions

View File

@ -1607,7 +1607,7 @@ int guac_terminal_send_key(guac_terminal* term, int keysym, int pressed) {
/**
* Determines if the given character is part of a word.
* Match these chars :[0-9A-Za-z\$\-\.\/_~]
* Match these chars :[0-9A-Za-z\$\-\.\/_~] and accented letters.
* This allows a path, variable name or IP address to be treated as a word.
*
* @param ascii_char
@ -1621,6 +1621,8 @@ static bool guac_terminal_is_part_of_word(int ascii_char) {
return ((ascii_char >= '0' && ascii_char <= '9') ||
(ascii_char >= 'A' && ascii_char <= 'Z') ||
(ascii_char >= 'a' && ascii_char <= 'z') ||
(ascii_char >= GUAC_TERMINAL_LATIN1_CAPITAL_AGRAVE &&
ascii_char <= GUAC_TERMINAL_LATIN1_Y_UMLAUT) ||
(ascii_char == '$') ||
(ascii_char == '-') ||
(ascii_char == '.') ||

View File

@ -111,6 +111,16 @@
*/
#define GUAC_TERMINAL_PIPE_AUTOFLUSH 2
/**
* Latin 1 capital A grave, it's the first character of the accented range.
*/
#define GUAC_TERMINAL_LATIN1_CAPITAL_AGRAVE 192
/**
* Latin 1 small y umlaut, it's the latest character of the accented range.
*/
#define GUAC_TERMINAL_LATIN1_Y_UMLAUT 255
/**
* Represents a terminal emulator which uses a given Guacamole client to
* render itself.