summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-11 21:42:52 +0000
committerMiles Bader <miles@gnu.org>1996-01-11 21:42:52 +0000
commitfb9150c42a8e50994df9cabf2f99f57458fc1016 (patch)
tree79d3a78778d838dcd1b170809f2aad6d19a4c56a
parentab3b98a658d690870c21a7f030786973cf151517 (diff)
(S_exec_exec): Use envz_get() to search the environment.
-rw-r--r--exec/exec.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 51ea2bd2..8004c650 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1643,22 +1643,15 @@ S_exec_exec (struct trivfs_protid *protid,
#if 0
if (!(flags & EXEC_SECURE))
{
- const char envar[] = "\0EXECSERVERS=";
- char *p = NULL;
- if (envplen >= sizeof (envar) &&
- !memcmp (&envar[1], envp, sizeof (envar) - 2))
- p = envp - 1;
- else
- p = memmem (envp, envplen, envar, sizeof (envar) - 1);
- if (p != NULL)
+ char *env_server_list = envz_get (envp, envplen, "EXECSERVERS");
+
+ if (env_server_list)
{
- size_t len;
- char *list;
int tried = 0;
- p += sizeof (envar) - 1;
- len = strlen (p) + 1;
- list = alloca (len);
- memcpy (list, p, len);
+ size_t len = strlen (p) + 1;
+ char *list = alloca (len);
+
+ memcpy (list, env_server_list, len);
while ((p = strsep (&list, ":")))
{
file_t server;