From 056c5fe698f194c3187b9eec5378c441930c005b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 10 Jun 2022 20:34:32 +0200 Subject: Remove `static` from some `static inline` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- getenv_ne.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 getenv_ne.c (limited to 'getenv_ne.c') diff --git a/getenv_ne.c b/getenv_ne.c new file mode 100644 index 0000000..b502fc8 --- /dev/null +++ b/getenv_ne.c @@ -0,0 +1,28 @@ +/* See LICENSE file for copyright and license details. */ +#include "libsimple.h" +#ifndef TEST + + +extern inline char *libsimple_getenv_ne(const char *); + + +#else +#include "test.h" + +int +main(void) +{ + unsetenv("X"); + assert(!getenv("X")); + assert(!libsimple_getenv_ne("X")); + putenv("X=xyz"); + assert(!strcmpnul(getenv("X"), "xyz")); + assert(!strcmpnul(libsimple_getenv_ne("X"), "xyz")); + putenv("X="); + assert(!strcmpnul(getenv("X"), "")); + assert(!libsimple_getenv_ne("X")); + + return 0; +} + +#endif -- cgit v1.2.3-70-g09d2