Changeset 5458:f93dcd689032
- Timestamp:
- 2008-07-21 00:11:40 (3 months ago)
- Author:
- Rocco Rutte <pdmef@…>
- Branch:
- HEAD
- Message:
-
Encode lines written to $alias_file in $config_charset if set. Closes #3095
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5455
|
r5458
|
|
| | 1 | 2008-07-10 09:38 -0400 Aron Griffis <agriffis@n01se.net> (7729b1ad530c) |
| | 2 | |
| | 3 | * copy.c, protos.h, sendlib.c: Unify mutt_write_references |
| | 4 | |
| | 5 | copy.c and sendlib.c have independent and different implementations |
| | 6 | of writing references to a file. Choose the one in sendlib since |
| | 7 | it's conservative with mallocs and supports trimming the list. |
| | 8 | |
| | 9 | Signed-off-by: Aron Griffis <agriffis@n01se.net> |
| | 10 | |
| | 11 | 2008-07-10 09:38 -0400 Aron Griffis <agriffis@n01se.net> (651ffe277dfd) |
| | 12 | |
| | 13 | * copy.c: Clean up error handling in mutt_copy_header |
| | 14 | |
| | 15 | mutt_copy_header unnecessarily tests the result of each fputc/fputs |
| | 16 | (well, most of them anyway, it's not consistent). This obfuscates |
| | 17 | the code and hides bugs. Remove these extraneous checks since |
| | 18 | ferror/feof are checked at the bottom of the function, and get rid |
| | 19 | of all the early returns. |
| | 20 | |
| | 21 | Signed-off-by: Aron Griffis <agriffis@n01se.net> |
| | 22 | |
| | 23 | 2008-07-17 19:48 +0200 Rocco Rutte <pdmef@gmx.net> (f135d64e0082) |
| | 24 | |
| | 25 | * ChangeLog, query.c: Cleanup unused vars changeset ba0d96408425 |
| | 26 | didn't remove |
| | 27 | |
| 1 | 28 | 2008-07-11 11:34 +0200 Rocco Rutte <pdmef@gmx.net> (cc67b008038c) |
| 2 | 29 | |
-
|
r5417
|
r5458
|
|
| 212 | 212 | } |
| 213 | 213 | |
| | 214 | static void recode_buf (char *buf, size_t buflen) |
| | 215 | { |
| | 216 | char *s; |
| | 217 | |
| | 218 | if (!ConfigCharset || !*ConfigCharset || !Charset) |
| | 219 | return; |
| | 220 | s = safe_strdup (buf); |
| | 221 | if (!s) |
| | 222 | return; |
| | 223 | if (mutt_convert_string (&s, Charset, ConfigCharset, 0) == 0) |
| | 224 | strfcpy (buf, s, buflen); |
| | 225 | FREE(&s); |
| | 226 | } |
| | 227 | |
| 214 | 228 | void mutt_create_alias (ENVELOPE *cur, ADDRESS *iadr) |
| 215 | 229 | { |
| … |
… |
|
| 356 | 370 | else |
| 357 | 371 | strfcpy (buf, new->name, sizeof (buf)); |
| | 372 | recode_buf (buf, sizeof (buf)); |
| 358 | 373 | fprintf (rc, "alias %s ", buf); |
| 359 | 374 | buf[0] = 0; |
| 360 | 375 | rfc822_write_address (buf, sizeof (buf), new->addr, 0); |
| | 376 | recode_buf (buf, sizeof (buf)); |
| 361 | 377 | write_safe_address (rc, buf); |
| 362 | 378 | fputc ('\n', rc); |
-
|
r5431
|
r5458
|
|
| 104 | 104 | ** .pp |
| 105 | 105 | ** The default file in which to save aliases created by the |
| 106 | | ** ``$create-alias'' function. |
| | 106 | ** ``$create-alias'' function. Entries added to this file are |
| | 107 | ** encoded in the charsacter set specified by $$config_charset if it |
| | 108 | ** is set or the current character set otherwise. |
| 107 | 109 | ** .pp |
| 108 | 110 | ** \fBNote:\fP Mutt will not automatically source this file; you must |
| … |
… |
|
| 373 | 375 | ** .pp |
| 374 | 376 | ** When defined, Mutt will recode commands in rc files from this |
| 375 | | ** encoding. |
| | 377 | ** encoding to the current charsacter set and aliases written to |
| | 378 | ** $$alias_file from the current character set. |
| 376 | 379 | */ |
| 377 | 380 | { "confirmappend", DT_BOOL, R_NONE, OPTCONFIRMAPPEND, 1 }, |