cvs: php4 /main php_virtual_cwd.c
| From: | Andi Gutmans | Date: | Sun, 27 Aug 2000 19:20:53 +0000 |
| Subject: | cvs: php4 /main php_virtual_cwd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1416@lists.php.net to get a copy of this message | ||
andi Sun Aug 27 12:20:53 2000 EDT
Modified files:
/php4/main php_virtual_cwd.c
Log:
- This should be more efficient.
- Post 4.0.2 it's time to move the whole opened_path and virtual stuff
- to emalloc() and friends including some alloca() improvements where
- possible but I don't want to break anything before
Index: php4/main/php_virtual_cwd.c
diff -u php4/main/php_virtual_cwd.c:1.71 php4/main/php_virtual_cwd.c:1.72
--- php4/main/php_virtual_cwd.c:1.71 Sun Aug 27 11:01:17 2000
+++ php4/main/php_virtual_cwd.c Sun Aug 27 12:20:53 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_virtual_cwd.c,v 1.71 2000/08/27 18:01:17 andi Exp $ */
+/* $Id: php_virtual_cwd.c,v 1.72 2000/08/27 19:20:53 andi Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -416,14 +416,14 @@
if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use
trailing slash if this is absolute */
length++;
}
- temp = (char *) malloc(length+1);
+ temp = (char *) do_alloca(length+1);
memcpy(temp, path, length);
temp[length] = 0;
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "Changing directory to %s\n", temp);
#endif
retval = p_chdir(temp);
- free(temp);
+ free_alloca(temp);
return retval;
}