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