apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r471952 - /apr/apr/trunk/misc/unix/env.c
Date Tue, 07 Nov 2006 00:39:16 GMT
Author: wrowe
Date: Mon Nov  6 16:39:15 2006
New Revision: 471952

URL: http://svn.apache.org/viewvc?view=rev&rev=471952
Log:
Axe lines of unnecessary code.

Modified:
    apr/apr/trunk/misc/unix/env.c

Modified: apr/apr/trunk/misc/unix/env.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/unix/env.c?view=diff&rev=471952&r1=471951&r2=471952
==============================================================================
--- apr/apr/trunk/misc/unix/env.c (original)
+++ apr/apr/trunk/misc/unix/env.c Mon Nov  6 16:39:15 2006
@@ -57,17 +57,7 @@
 
 #elif defined(HAVE_PUTENV)
 
-    apr_size_t elen = strlen(envvar);
-    apr_size_t vlen = strlen(value);
-    char *env = apr_palloc(pool, elen + vlen + 2);
-    char *p = env + elen;
-
-    memcpy(env, envvar, elen);
-    *p++ = '=';
-    memcpy(p, value, vlen);
-    p[vlen] = '\0';
-
-    if (0 > putenv(env))
+    if (0 > putenv(apr_pstrcat(pool, envvar, "=", value, NULL))
         return APR_ENOMEM;
     return APR_SUCCESS;
 



Mime
View raw message