[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] virsh: Clarify escape sequence



On 03.04.2012 16:39, Eric Blake wrote:
> On 04/03/2012 07:10 AM, Michal Privoznik wrote:
>> Currently, we put no strains on escape sequence possibly leaving users
>> with console that cannot be terminated. However, not all ASCII
>> characters can be used as escape sequence. Only those falling in
>> @ - _ can be; implement and document this constraint.
> 
>>  vshGetEscapeChar(const char *s)
>>  {
>>      if (*s == '^')
>> -        return CONTROL(s[1]);
>> +        return CONTROL(c_islower(s[1]) ? c_toupper(s[1]) : s[1]);
> 
> Unlike toupper(), c_toupper() is safe even on non-alphabetic characters
> (that's part of why gnulib wrote "c-ctype.h"); you can shorten this to:
>       ('@' <= c && c <= '_');

> 
> ACK with nit fixed.
> 

Fixed and pushed. Thanks.

Michal


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]