mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
If joined channel had some low-ascii (color codes), they were displayed
wrong in statusbar and prompt. Also, if you're invited to some channel, print the lowascii so that you can see them (^B, etc.) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@400 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
58397c1ca9
commit
39282a342f
6 changed files with 40 additions and 14 deletions
|
|
@ -506,3 +506,24 @@ int dec2octal(int decimal)
|
|||
|
||||
return octal;
|
||||
}
|
||||
|
||||
/* convert all low-ascii (<32) to ^<A..> combinations */
|
||||
char *show_lowascii(const char *channel)
|
||||
{
|
||||
char *str, *p;
|
||||
|
||||
str = p = g_malloc(strlen(channel)*2+1);
|
||||
while (*channel != '\0') {
|
||||
if ((unsigned char) *channel >= 32)
|
||||
*p++ = *channel;
|
||||
else {
|
||||
*p++ = '^';
|
||||
*p++ = *channel + 'A'-1;
|
||||
}
|
||||
channel++;
|
||||
}
|
||||
*p = '\0';
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,4 +65,7 @@ char *replace_chars(char *str, char from, char to);
|
|||
int octal2dec(int octal);
|
||||
int dec2octal(int decimal);
|
||||
|
||||
/* convert all low-ascii (<32) to ^<A..> combinations */
|
||||
char *show_lowascii(const char *channel);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue