view console/libgnt/gntkeys.c @ 14102:14e14f1ef1d8

[gaim-migrate @ 16732] Jabber crashed when getting info from someone on your buddy list if the JID consists only of the domain identifer. For example, add "quser.alpha.qunu.com" to your buddy list then get their info. This fixes the crashing. I'm not really sure if the fix is correct. Can someone familiar with Jabber please look over this? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 13 Aug 2006 05:50:19 +0000
parents ae4cbed1b309
children 70623f0d5cdc
line wrap: on
line source

#include "gntkeys.h"

#include <string.h>

void gnt_keys_refine(char *text)
{
	if (text[0] == 27)
	{
		/* These are for urxvt */
		if (strcmp(text + 1, "Oa") == 0)
		{
			strcpy(text + 1, GNT_KEY_CTRL_UP);
		}
		else if (strcmp(text + 1, "Ob") == 0)
		{
			strcpy(text + 1, GNT_KEY_CTRL_DOWN);
		}
	}
	else if ((unsigned char)text[0] == 195)
	{
		/* These for xterm */
		if (text[2] == 0)
		{
			text[0] = 27;
			text[1] -= 64;
		}
	}
}