Skip to content

Commit

Permalink
GUACAMOLE-1961: Detect accented letters as a part of word.
Browse files Browse the repository at this point in the history
  • Loading branch information
corentin-soriano committed Nov 4, 2024
1 parent 03d0d3f commit 8b7ab07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/terminal/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,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
Expand All @@ -1624,6 +1624,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 == '.') ||
Expand Down
10 changes: 10 additions & 0 deletions src/terminal/terminal/terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8b7ab07

Please sign in to comment.