Changes with Apache 2.0b1
+ *) Remove ap_chdir_file(). This function is not thread-safe,
+ and nobody is currently using it. [Ryan Bloom]
+
*) Do not try to run make depend if there are no .c files in the
current directory, doing so makes `make depend` fail.
[Ryan Bloom]
* @deffunc int ap_is_directory(apr_pool_t *p, const char *name)
*/
AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
-/**
- * Given a pathname in file, extract the directory and chdir to that directory
- * @param file The file who's directory we wish to switch to
- * @deffunc void ap_chdir_file(const char *file)
- */
-AP_DECLARE(void) ap_chdir_file(const char *file);
/**
* Get the maximum number of daemons processes for this version of Apache
* @return The maximum number of daemon processes
}
ap_destroy_sub_req(rr);
- ap_chdir_file(r->filename);
return 0;
}
error_fmt = "unable to include \"%s\" in parsed file %s";
}
}
- ap_chdir_file(r->filename);
if (error_fmt) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
0, r, error_fmt, tag_val, r->filename);
CREATE_ERROR_BUCKET(ctx, tmp_buck, head_ptr, *inserted_head);
}
/* just in case some stooge changed directories */
- ap_chdir_file(r->filename);
}
else if (!strcmp(tag, "cgi")) {
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
"invalid CGI ref \"%s\" in %s", tag_val, file);
CREATE_ERROR_BUCKET(ctx, tmp_buck, head_ptr, *inserted_head);
}
- ap_chdir_file(r->filename);
}
else {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
apr_bucket_brigade *tag_and_after;
int ret;
- ap_chdir_file(r->filename);
if (r->args) { /* add QUERY stuff to env cause it ain't yet */
char *arg_copy = apr_pstrdup(r->pool, r->args);
/* just need some arbitrary non-NULL pointer which can't also be a request_rec */
#define NESTED_INCLUDE_MAGIC (&includes_module)
-/* TODO: changing directory should be handled by CreateProcess */
-#define ap_chdir_file(x) do {} while(0)
-
-
/****************************************************************************
* Used to keep context information during parsing of a request for SSI tags.
* This is especially useful if the tag stretches across multiple buckets or
return n;
}
-
-AP_DECLARE(void) ap_chdir_file(const char *file)
-{
- const char *x;
- char buf[HUGE_STRING_LEN];
-
- x = ap_strrchr_c(file, '/');
- if (x == NULL) {
- chdir(file);
- }
- else if (x - file < sizeof(buf) - 1) {
- memcpy(buf, file, x - file);
- buf[x - file] = '\0';
- chdir(buf);
- }
- /* XXX: well, this is a silly function, no method of reporting an
- * error... ah well. */
-}
-
AP_DECLARE(char *) ap_getword_nc(apr_pool_t *atrans, char **line, char stop)
{
return ap_getword(atrans, (const char **) line, stop);