… | |
… | |
79 | *p++ = w; |
79 | *p++ = w; |
80 | else if (w < 0x000800) |
80 | else if (w < 0x000800) |
81 | *p++ = 0xc0 | ( w >> 6), |
81 | *p++ = 0xc0 | ( w >> 6), |
82 | *p++ = 0x80 | ( w & 0x3f); |
82 | *p++ = 0x80 | ( w & 0x3f); |
83 | else if (w < 0x010000) |
83 | else if (w < 0x010000) |
84 | *p++ = 0xe0 | ( w >> 12 ), |
84 | *p++ = 0xe0 | ( w >> 12), |
85 | *p++ = 0x80 | ((w >> 6) & 0x3f), |
85 | *p++ = 0x80 | ((w >> 6) & 0x3f), |
86 | *p++ = 0x80 | ( w & 0x3f); |
86 | *p++ = 0x80 | ( w & 0x3f); |
87 | else if (w < 0x110000) |
87 | else if (w < 0x110000) |
88 | *p++ = 0xf0 | ( w >> 18), |
88 | *p++ = 0xf0 | ( w >> 18), |
89 | *p++ = 0x80 | ((w >> 12) & 0x3f), |
89 | *p++ = 0x80 | ((w >> 12) & 0x3f), |
… | |
… | |
235 | } |
235 | } |
236 | |
236 | |
237 | /* |
237 | /* |
238 | * remove leading/trailing space in place. |
238 | * remove leading/trailing space in place. |
239 | */ |
239 | */ |
240 | char * |
240 | char * |
241 | rxvt_strtrim (char *str) NOTHROW |
241 | rxvt_strtrim (char *str) NOTHROW |
242 | { |
242 | { |
243 | char *r, *s; |
243 | char *r, *s; |
244 | |
244 | |
245 | if (!str || !*str) /* shortcut */ |
245 | if (!str || !*str) /* shortcut */ |
… | |
… | |
262 | } |
262 | } |
263 | |
263 | |
264 | /* |
264 | /* |
265 | * Split a comma-separated string into an array, stripping leading and |
265 | * Split a comma-separated string into an array, stripping leading and |
266 | * trailing spaces from each entry. Empty strings are properly returned |
266 | * trailing spaces from each entry. Empty strings are properly returned |
267 | * Caller should free each entry and array when done |
|
|
268 | */ |
267 | */ |
269 | char ** |
268 | char ** |
270 | rxvt_splitcommastring (const char *cs) NOTHROW |
269 | rxvt_splitcommastring (const char *cs) NOTHROW |
271 | { |
270 | { |
272 | int l, n, p; |
271 | int l, n, p; |
273 | const char *s, *t; |
272 | const char *s, *t; |
274 | char **ret; |
273 | char **ret; |