GUACAMOLE-470: Merge support named colors in color-scheme configuration.

This commit is contained in:
Nick Couchman 2018-08-24 12:15:58 -04:00
commit a1ba91b01d

View File

@ -761,8 +761,13 @@ static int guac_terminal_named_color_search(const void* a, const void* b) {
/* Skip any spaces in key (name will never have spaces) */ /* Skip any spaces in key (name will never have spaces) */
while (*key && isspace(*key)) key++; while (*key && isspace(*key)) key++;
/* Treat semi-colon as string terminator, to support parsing color
names within a larger string (e.g. within the terminal color-scheme
configuration string). */
const int keyChar = (*key == ';') ? '\0' : tolower(*key);
/* Compare, ignoring case (name is already known to be lowercase) */ /* Compare, ignoring case (name is already known to be lowercase) */
int difference = tolower(*key) - *name; int difference = keyChar - *name;
if (difference) if (difference)
return difference; return difference;