diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-01-04 09:56:12 -0600 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-01-04 09:56:12 -0600 |
commit | 0b400af9519444deef4cc6ad2c43c30e2092ab4f (patch) | |
tree | e6b0d78a2c292a7df5724f150e123b55d7871819 /include/libfud.hpp | |
parent | 253385f4bca5ccd2fee22fea8333dfe435c0df0a (diff) |
Fix bug related to string copying.
Diffstat (limited to 'include/libfud.hpp')
-rw-r--r-- | include/libfud.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libfud.hpp b/include/libfud.hpp index f0a2517..542c836 100644 --- a/include/libfud.hpp +++ b/include/libfud.hpp @@ -18,8 +18,9 @@ #ifndef LIBFUD_HPP #define LIBFUD_HPP -#include "fud_array.hpp" #include "fud_allocator.hpp" +#include "fud_array.hpp" +#include "fud_option.hpp" #include "fud_result.hpp" #include "fud_status.hpp" #include "fud_string.hpp" @@ -55,7 +56,7 @@ FUD fud(); * \returns FudStatus::NullPointer if name is a null pointer. * \returns FudStatus::NotFound if no binding for the variable exists. */ -Result<String, FudStatus> getEnv(const char* name, Allocator* allocator= &globalFudAllocator); +Result<Option<String>, FudStatus> getEnv(const char* name, Allocator* allocator = &globalFudAllocator); /** \brief A concept requiring the object T to have a method c_str returning a * pointer to a C string. */ @@ -75,7 +76,7 @@ concept CStringRepr = requires(T strObj) { * \returns @getEnv return values. */ template <CStringRepr T> -Result<String, FudStatus> getEnv(const T& name, Allocator* allocator = &globalFudAllocator) +Result<Option<String>, FudStatus> getEnv(const T& name, Allocator* allocator = &globalFudAllocator) { return getEnv(name.c_str(), allocator); } |