Mercurial > pidgin
annotate console/libgnt/gntkeys.c @ 14939:06ae7ffc47e3
[gaim-migrate @ 17711]
This should prevent D-BUS from having to deal with any non-UTF-8
strings emitted by Gaim signals, which should therefore prevent its
early exit. Strings will be salvaged via gaim_utf8_salvage before
emission, and an error will be logged. IRC (and any other protocols
spitting out invalid UTF-8 to signals) should yet be fixed to emit
some sort of binary blob, rather than a UTF-8 string, but this will
make D-BUS robust to any future transgressions.
This is completely untested.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 09 Nov 2006 16:35:06 +0000 |
parents | c01f62c83647 |
children | 99112cd4a2f4 |
rev | line source |
---|---|
14091
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 #include "gntkeys.h" |
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 |
14877
c01f62c83647
[gaim-migrate @ 17646]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14876
diff
changeset
|
3 #include <stdlib.h> |
14091
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 #include <string.h> |
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 |
14876
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
6 const char *term; |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
7 |
14091
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 void gnt_keys_refine(char *text) |
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 { |
14876
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
10 if (*text == 27 && *(text + 1) == '[' && *(text + 3) == '\0' && |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
11 (*(text + 2) >= 'A' || *(text + 2) <= 'D')) { |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
12 if (term == NULL) |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
13 term = getenv("TERM"); |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
14 /* Apparently this is necessary for urxvt and screen */ |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
15 if (strcmp(term, "screen") == 0 || strcmp(term, "rxvt-unicode") == 0) |
70623f0d5cdc
[gaim-migrate @ 17645]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14091
diff
changeset
|
16 *(text + 1) = 'O'; |
14091
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 } |
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 } |
ae4cbed1b309
[gaim-migrate @ 16715]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 |