Look for ~/.config/avrdude/avrduce.rc configuration file (#1131)

* Look for ~/.config/avrdude/config configuration file

Traditionally per-user configuration files have been placed
in user's home directory with their names beginnig with a dot
to hide them from some tools like ls(1). However, the number
of programs following this convention have grown over time
to the point where the number of hidden files becomes inconvenient to
some users. For this reason the XDG Base Directory Specification[1]
specifies an alternate place to store configuration files under
~/.config directory.

This patch enables avrdude to look for ~/.config/avrdude/config
configuration file, if ~/.avrduderc doesn't exist.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html

* Safely concatenate directories and configurations files and minor changes in docs

* Make stats variable available for WIN32 again in main.c

* Utilise full usr_config[] array space

* Check for xdg-style avrdude.rc file first before fallback ~/.avrduderc

Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
This commit is contained in:
steelman
2022-10-23 22:52:54 +02:00
committed by GitHub
parent b864d7e73a
commit 34fa2faba5
5 changed files with 59 additions and 29 deletions

View File

@@ -26,6 +26,7 @@
#define USER_CONF_FILE "avrdude.rc"
#else
#define USER_CONF_FILE ".avrduderc"
#define XDG_USER_CONF_FILE "avrdude/avrdude.rc"
#endif
extern char *progname; // name of program, for messages