File:  [DVB] / dietlibc / lib / getenv.c
Revision 1.2: download - view: text, annotated - select for diffs
Tue Aug 14 16:56:50 2001 UTC (22 years, 10 months ago) by fefe
Branches: MAIN
CVS tags: finnland_test_200301, branch_rc14_fieldtest_finnland, branch_rc13_fieldtest_finnland, branch_rc12_fieldtest_finnland, branch_rc10_fieldtest_finnland, RELEASE_finnland_200301_1, RC12_FIELDTEST_FINNLAND, RC10_FIELDTEST_FINNLAND, HEAD
enabled a few more obscure gcc warnings and started adding fluff code to
silence them.

#include <stdlib.h>
#include <string.h>

extern char *getenv(const char *s)
{
  int i;
  unsigned int len;

  if (!environ || !s) return 0;
  len = strlen(s);
  for (i = 0;environ[i];++i)
    if ((memcmp(environ[i],s,len)==0) && (environ[i][len] == '='))
      return environ[i] + len + 1;
  return 0;
}


LinuxTV legacy CVS <linuxtv.org/cvs>