X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fputenv.c;h=a2ec7d3a91d8ade38c2b83a4c69b9d9fb96c8329;hp=bade935f4e2eef1dd4350dc8021e24f03af47f8a;hb=5ba9c2f13fedf1d8d6ed907ef1f505616290efaa;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1 diff --git a/sbr/putenv.c b/sbr/putenv.c index bade935..a2ec7d3 100644 --- a/sbr/putenv.c +++ b/sbr/putenv.c @@ -1,10 +1,10 @@ /* - * putenv.c -- (un)set an envariable - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** putenv.c -- (un)set an envariable +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include #include @@ -12,30 +12,30 @@ extern char **environ; /* - * prototypes - */ -int m_putenv (char *, char *); -int unputenv (char *); -static int nvmatch (char *, char *); +** prototypes +*/ +int m_putenv(char *, char *); +int unputenv(char *); +static int nvmatch(char *, char *); int -m_putenv (char *name, char *value) +m_putenv(char *name, char *value) { - register int i; - register char **ep, **nep, *cp; + int i; + char **ep, **nep, *cp; - cp = mh_xmalloc ((size_t) (strlen (name) + strlen (value) + 2)); + cp = mh_xmalloc((size_t) (strlen(name) + strlen(value) + 2)); - sprintf (cp, "%s=%s", name, value); + sprintf(cp, "%s=%s", name, value); for (ep = environ, i = 0; *ep; ep++, i++) - if (nvmatch (name, *ep)) { + if (nvmatch(name, *ep)) { *ep = cp; return 0; } - nep = (char **) mh_xmalloc ((size_t) ((i + 2) * sizeof(*nep))); + nep = (char **) mh_xmalloc((size_t) ((i + 2) * sizeof(*nep))); for (ep = environ, i = 0; *ep; nep[i++] = *ep++) continue; @@ -47,12 +47,12 @@ m_putenv (char *name, char *value) int -unputenv (char *name) +unputenv(char *name) { char **ep, **nep; for (ep = environ; *ep; ep++) - if (nvmatch (name, *ep)) + if (nvmatch(name, *ep)) break; if (*ep == NULL) return 1; @@ -66,7 +66,7 @@ unputenv (char *name) static int -nvmatch (char *s1, char *s2) +nvmatch(char *s1, char *s2) { while (*s1 == *s2++) if (*s1++ == '=')