… | |
… | |
25 | * - extensive modifications |
25 | * - extensive modifications |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
27 | * Copyright (c) 2001 Marius Gedminas |
27 | * Copyright (c) 2001 Marius Gedminas |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
30 | * Copyright (c) 2003-2011 Marc Lehmann <schmorp@schmorp.de> |
30 | * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> |
31 | * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> |
31 | * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> |
32 | * |
32 | * |
33 | * This program is free software; you can redistribute it and/or modify |
33 | * This program is free software; you can redistribute it and/or modify |
34 | * it under the terms of the GNU General Public License as published by |
34 | * it under the terms of the GNU General Public License as published by |
35 | * the Free Software Foundation; either version 2 of the License, or |
35 | * the Free Software Foundation; either version 2 of the License, or |
… | |
… | |
3227 | rxvt_term::get_to_st (unicode_t &ends_how) |
3227 | rxvt_term::get_to_st (unicode_t &ends_how) |
3228 | { |
3228 | { |
3229 | unicode_t ch; |
3229 | unicode_t ch; |
3230 | bool seen_esc = false; |
3230 | bool seen_esc = false; |
3231 | unsigned int n = 0; |
3231 | unsigned int n = 0; |
3232 | wchar_t string[STRING_MAX]; |
3232 | wchar_t string[CBUFSIZ]; |
3233 | |
3233 | |
3234 | while ((ch = cmd_getc ()) != NOCHAR) |
3234 | while ((ch = cmd_getc ()) != NOCHAR) |
3235 | { |
3235 | { |
3236 | if (seen_esc) |
3236 | if (seen_esc) |
3237 | { |
3237 | { |
… | |
… | |
3252 | else if (ch < 0x20) |
3252 | else if (ch < 0x20) |
3253 | return NULL; /* other control character - exit */ |
3253 | return NULL; /* other control character - exit */ |
3254 | |
3254 | |
3255 | seen_esc = false; |
3255 | seen_esc = false; |
3256 | |
3256 | |
3257 | if (n >= STRING_MAX - 1) |
3257 | if (n >= sizeof (string) - 1) |
3258 | // stop at some sane length |
3258 | // stop at some sane length |
3259 | return NULL; |
3259 | return NULL; |
3260 | |
3260 | |
3261 | string[n++] = ch; |
3261 | string[n++] = ch; |
3262 | } |
3262 | } |
… | |
… | |
3379 | &nitems, &bytes_after, &value) == Success |
3379 | &nitems, &bytes_after, &value) == Success |
3380 | && actual_type != None |
3380 | && actual_type != None |
3381 | && actual_format == 8) |
3381 | && actual_format == 8) |
3382 | str = (const char *)(value); |
3382 | str = (const char *)(value); |
3383 | |
3383 | |
3384 | tt_printf ("\033]%d;%s%c", op, str, resp); |
3384 | tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp); |
3385 | |
3385 | |
3386 | XFree (value); |
3386 | XFree (value); |
3387 | } |
3387 | } |
3388 | else |
3388 | else |
3389 | { |
3389 | { |