Skip to content

Commit d7f2be6

Browse files
author
Marc Stern
authored
Merge pull request #3270 from Marcool04/v2/master
make rootpath and incpath consts for apr_filepath_root
2 parents 1121ef0 + 4919814 commit d7f2be6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

standalone/config.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@ const char *process_command_config(server_rec *s,
10281028
ap_directive_t *newdir;
10291029
int optional;
10301030
char *err = NULL;
1031-
char *rootpath, *incpath;
1031+
const char *rootpath, *incpath;
1032+
char *configfilepath;
10321033
int li;
10331034

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

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

1114-
while(li >= 0 && rootpath[li] != '/' && rootpath[li] != '\\')
1115-
rootpath[li--] = 0;
1115+
while(li >= 0 && configfilepath[li] != '/' && configfilepath[li] != '\\')
1116+
configfilepath[li--] = 0;
11161117

1117-
w = apr_pstrcat(p, rootpath, w, NULL);
1118+
w = apr_pstrcat(p, configfilepath, w, NULL);
11181119
}
11191120
else if (APR_EBADPATH == status) {
11201121
ap_cfg_closefile(parms->config_file);

0 commit comments

Comments
 (0)