diff options
author | Brendan Cully <brendan@kublai.com> | 2007-03-02 21:12:33 -0800 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2007-03-02 21:12:33 -0800 |
commit | 262b2b63b9936f6d7d71ee6ced62e857a64a9606 (patch) | |
tree | 2706001c805cbc9188255fa3963041444f1d5db6 /init.c | |
parent | 3e680e6ca4a04391ec3434ccb1b7f91675f0e336 (diff) |
Add $umask for mailboxes and attachments.
init.c could really use some refactoring.
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1980,7 +1980,10 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) val = *ptr < 0 ? -*ptr : 0; /* user requested the value of this variable */ - snprintf (err->data, err->dsize, "%s=%d", MuttVars[idx].option, val); + if (mutt_strcmp (MuttVars[idx].option, "umask") == 0) + snprintf (err->data, err->dsize, "%s=0%o", MuttVars[idx].option, val); + else + snprintf (err->data, err->dsize, "%s=%d", MuttVars[idx].option, val); break; } @@ -2566,7 +2569,10 @@ static int var_to_string (int idx, char* val, size_t len) if (mutt_strcmp (MuttVars[idx].option, "wrapmargin") == 0) sval = sval > 0 ? 0 : -sval; - snprintf (tmp, sizeof (tmp), "%d", sval); + if (mutt_strcmp (MuttVars[idx].option, "umask") == 0) + snprintf (tmp, sizeof (tmp), "0%o", sval); + else + snprintf (tmp, sizeof (tmp), "%d", sval); } else if (DTYPE (MuttVars[idx].type) == DT_SORT) { |