diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ab24dc..ea555bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(libravatarserv - VERSION 0.3.0 + VERSION 0.3.1 LANGUAGES CXX ) diff --git a/README.md b/README.md index 8d99473..1026fcb 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ HTTPS. libravatarserv looks in each of `${XDG_DATA_DIRS}` for a directory named `libravatarserv`. You can force a different directory by setting the environment -variable `${AVATAR_DIR}`. +variable `${LIBRAVATARSERV_DIR}` (until 0.3.0 `${AVATAR_DIR}`). The image files are named like your email address, no file extension. If you want to deliver a default image for unknown email addresses, name it `default`. diff --git a/src/libravatarserv.cpp b/src/libravatarserv.cpp index 6a564fc..df09080 100644 --- a/src/libravatarserv.cpp +++ b/src/libravatarserv.cpp @@ -83,17 +83,16 @@ int main() bool find_avatar_dir() { - const char *envdir = std::getenv("AVATAR_DIR"); - if (envdir != nullptr) + const char *envdir = std::getenv("LIBRAVATARSERV_DIR"); + if (envdir == nullptr) { - if (fs::is_directory(envdir)) - { - avatar_dir = envdir; - } - else - { - return false; - } + // TODO: Remove AVATAR_DIR in 1.0.0 + // DEPRECATED because it is potentially used by another program + envdir = std::getenv("AVATAR_DIR"); + } + if (envdir != nullptr && fs::is_directory(envdir)) + { + avatar_dir = envdir; } else {