summaryrefslogtreecommitdiff
path: root/file_io/unix/tempdir.c
diff options
context:
space:
mode:
authorstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-11-02 01:13:52 +0000
committerstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-11-02 01:13:52 +0000
commite58e87650911e76bd609e4062f33b5fdef707506 (patch)
tree164cef21fb48fb67b0ba9d3c15804958ee2aca5a /file_io/unix/tempdir.c
parent20138b685ec646ef0eec3302b2097767bba27fa8 (diff)
downloadlibapr-e58e87650911e76bd609e4062f33b5fdef707506.tar.gz
* file_io/unix/tempdir.c
(apr_temp_dir_get): Don't cache the cwd as a temp dir. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64708 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix/tempdir.c')
-rw-r--r--file_io/unix/tempdir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c
index 8839baa4a..0b433c5ae 100644
--- a/file_io/unix/tempdir.c
+++ b/file_io/unix/tempdir.c
@@ -160,8 +160,9 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir,
/* Finally, try the current working directory. */
if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) {
if (test_tempdir(cwd, p)) {
- memcpy(global_temp_dir, cwd, strlen(cwd) + 1);
- goto end;
+ /* Don't cache if the selected temp dir is the cwd */
+ *temp_dir = apr_pstrdup(p, cwd);
+ return APR_SUCCESS;
}
}