Skip to content

Commit

Permalink
Merge pull request #3270 from Marcool04/v2/master
Browse files Browse the repository at this point in the history
make rootpath and incpath consts for apr_filepath_root
  • Loading branch information
marcstern authored Oct 4, 2024
2 parents 1121ef0 + 4919814 commit d7f2be6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions standalone/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,8 @@ const char *process_command_config(server_rec *s,
ap_directive_t *newdir;
int optional;
char *err = NULL;
char *rootpath, *incpath;
const char *rootpath, *incpath;
char *configfilepath;
int li;

errmsg = populate_include_files(p, ptemp, ari, filename, 0);
Expand Down Expand Up @@ -1108,13 +1109,13 @@ const char *process_command_config(server_rec *s,

/* we allow APR_SUCCESS and APR_EINCOMPLETE */
if (APR_ERELATIVE == status) {
rootpath = apr_pstrdup(ptemp, parms->config_file->name);
li = strlen(rootpath) - 1;
configfilepath = apr_pstrdup(ptemp, parms->config_file->name);
li = strlen(configfilepath) - 1;

while(li >= 0 && rootpath[li] != '/' && rootpath[li] != '\\')
rootpath[li--] = 0;
while(li >= 0 && configfilepath[li] != '/' && configfilepath[li] != '\\')
configfilepath[li--] = 0;

w = apr_pstrcat(p, rootpath, w, NULL);
w = apr_pstrcat(p, configfilepath, w, NULL);
}
else if (APR_EBADPATH == status) {
ap_cfg_closefile(parms->config_file);
Expand Down

0 comments on commit d7f2be6

Please sign in to comment.