… | |
… | |
56 | static char curlocale[128], savelocale[128]; |
56 | static char curlocale[128], savelocale[128]; |
57 | |
57 | |
58 | bool |
58 | bool |
59 | rxvt_set_locale (const char *locale) NOTHROW |
59 | rxvt_set_locale (const char *locale) NOTHROW |
60 | { |
60 | { |
|
|
61 | int size = strlen (locale) + 1; |
|
|
62 | |
|
|
63 | if (size > sizeof (curlocale)) |
|
|
64 | rxvt_fatal ("locale string too long, aborting.\n"); |
|
|
65 | |
61 | if (!locale || !strncmp (locale, curlocale, 128)) |
66 | if (!locale || !memcmp (locale, curlocale, size)) |
62 | return false; |
67 | return false; |
63 | |
68 | |
64 | strncpy (curlocale, locale, 128); |
69 | memcpy (curlocale, locale, size); |
65 | setlocale (LC_CTYPE, curlocale); |
70 | setlocale (LC_CTYPE, curlocale); |
66 | return true; |
71 | return true; |
67 | } |
72 | } |
68 | |
73 | |
69 | void |
74 | void |
… | |
… | |
265 | } |
270 | } |
266 | |
271 | |
267 | clear (); |
272 | clear (); |
268 | } |
273 | } |
269 | |
274 | |
270 | delete pix_colors_focused; |
275 | delete [] pix_colors_focused; |
271 | #if OFF_FOCUS_FADING |
276 | #if OFF_FOCUS_FADING |
272 | delete pix_colors_unfocused; |
277 | delete [] pix_colors_unfocused; |
273 | #endif |
278 | #endif |
274 | |
279 | |
275 | displays.put (display); |
280 | displays.put (display); |
276 | |
281 | |
277 | scr_release (); |
282 | scr_release (); |
… | |
… | |
807 | delete fontset[0]; |
812 | delete fontset[0]; |
808 | fontset[0] = fs; |
813 | fontset[0] = fs; |
809 | |
814 | |
810 | prop = (*fs)[1]->properties (); |
815 | prop = (*fs)[1]->properties (); |
811 | prop.height += lineSpace; |
816 | prop.height += lineSpace; |
|
|
817 | |
812 | fs->set_prop (prop); |
818 | fs->set_prop (prop, false); |
813 | |
819 | |
814 | fwidth = prop.width; |
820 | fwidth = prop.width; |
815 | fheight = prop.height; |
821 | fheight = prop.height; |
816 | fbase = prop.ascent; |
822 | fbase = prop.ascent; |
817 | |
823 | |
… | |
… | |
836 | if (SET_STYLE (0, style) & RS_Bold) prop2.weight = rxvt_fontprop::bold; |
842 | if (SET_STYLE (0, style) & RS_Bold) prop2.weight = rxvt_fontprop::bold; |
837 | if (SET_STYLE (0, style) & RS_Italic) prop2.slant = rxvt_fontprop::italic; |
843 | if (SET_STYLE (0, style) & RS_Italic) prop2.slant = rxvt_fontprop::italic; |
838 | } |
844 | } |
839 | |
845 | |
840 | fs->populate (res); |
846 | fs->populate (res); |
841 | fs->set_prop (prop2); |
847 | fs->set_prop (prop2, true); |
842 | } |
848 | } |
843 | #else |
849 | #else |
844 | fontset[style] = fontset[0]; |
850 | fontset[style] = fontset[0]; |
845 | #endif |
851 | #endif |
846 | } |
852 | } |