diff options
author | Damien Riegel <damien.riegel@gmail.com> | 2016-11-13 18:45:35 -0800 |
---|---|---|
committer | Damien Riegel <damien.riegel@gmail.com> | 2016-11-13 18:45:35 -0800 |
commit | b17cd67312913bc98269840652bc5c54eba9fc20 (patch) | |
tree | f87bc27026f556809b7236620e4dba22cd72a6e7 /compress.c | |
parent | e9de20435e17fa7bf5edb62fe5af19ae60158d9b (diff) |
search muttrc file according to XDG Base Specification (closes #3207)
First of all, the MUTT_VERSION symbol is now concatenated (when
possible) at compile time.
Then, the logic to find the config file has been changed a bit to remove
unnecessary calls to access(), so now each possible locations for the
config file is only tested once, and it stops as soon as a valid one has
been found. So instead of:
access("/home/dkc/.muttrc-1.7.1", F_OK) = -1 ENOENT (No such file or directory)
access("/home/dkc/.muttrc", F_OK) = 0
access("/home/dkc/.muttrc", F_OK) = 0
access("/home/dkc/.muttrc", F_OK) = 0
[... Tests for Muttrc ... ]
access("/home/dkc/.muttrc", F_OK) = 0
We now have:
access("/home/dkc/.muttrc-1.7+13 (f658e517960e)", F_OK) = -1 ENOENT (No such file or directory)
access("/home/dkc/.muttrc", F_OK) = 0
It also cleans up the case where -F is passed on the command line but
points to a non-existent file by moving the error path closer to the
actual fail condition.
Finally, it adds partial support for the XDG Base Directory
Specification. mutt will now try to locate its config at:
$XDG_CONFIG_HOME/mutt/muttrc-MUTT_VERSION
$XDG_CONFIG_HOME/mutt/muttrc.
If XDG_CONFIG_HOME is not set, it will use '~/.config' as a default.
Diffstat (limited to 'compress.c')
0 files changed, 0 insertions, 0 deletions