3 /* getenv( const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
9 /* This is an example implementation of getenv() fit for use with POSIX kernels.
17 extern char * * environ;
19 char * getenv( const char * name )
21 size_t len = strlen( name );
23 while ( environ[ index ] != NULL )
25 if ( strncmp( environ[ index ], name, len ) == 0 )
27 return environ[ index ] + len + 1;
37 #include <_PDCLIB_test.h>
41 TESTCASE( strcmp( getenv( "SHELL" ), "/bin/bash" ) == 0 );
42 /* TESTCASE( strcmp( getenv( "SHELL" ), "/bin/sh" ) == 0 ); */