summaryrefslogtreecommitdiff
path: root/ucspi-tcp-0.88/env.c
blob: 430203e5f6d79f55be3aeda0d816c8892b28d88d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "str.h"
#include "env.h"

extern /*@null@*/char *env_get(char *s)
{
  int i;
  unsigned int len;

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