File: gntkeys.c

package info (click to toggle)
gaim 1%3A2.0.0%2Bbeta5-10etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 41,040 kB
  • ctags: 18,935
  • sloc: ansic: 212,177; sh: 8,785; makefile: 2,509; python: 857; cs: 176; perl: 152; tcl: 86; pascal: 66; xml: 11
file content (19 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "gntkeys.h"

#include <stdlib.h>
#include <string.h>

const char *term;

void gnt_keys_refine(char *text)
{
	if (*text == 27 && *(text + 1) == '[' && *(text + 3) == '\0' &&
			(*(text + 2) >= 'A' || *(text + 2) <= 'D')) {
		if (term == NULL)
			term = getenv("TERM");
		/* Apparently this is necessary for urxvt and screen */
		if (strcmp(term, "screen") == 0 || strcmp(term, "rxvt-unicode") == 0)
			*(text + 1) = 'O';
	}
}