@@ -2513,6 +2513,7 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg)
2513
2513
const char * endp = ap_strrchr_c (arg , '>' );
2514
2514
int old_overrides = cmd -> override ;
2515
2515
char * old_path = cmd -> path ;
2516
+ ap_regex_t * old_regex = cmd -> regex ;
2516
2517
core_dir_config * conf ;
2517
2518
ap_conf_vector_t * new_dir_conf = ap_create_per_dir_config (cmd -> pool );
2518
2519
const command_rec * thiscmd = cmd -> cmd ;
@@ -2556,6 +2557,8 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg)
2556
2557
int run_mode = ap_state_query (AP_SQ_RUN_MODE );
2557
2558
char * newpath ;
2558
2559
2560
+ cmd -> regex = NULL ;
2561
+
2559
2562
/*
2560
2563
* Ensure that the pathname is canonical, and append the trailing /
2561
2564
*/
@@ -2614,6 +2617,7 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg)
2614
2617
2615
2618
cmd -> path = old_path ;
2616
2619
cmd -> override = old_overrides ;
2620
+ cmd -> regex = old_regex ;
2617
2621
2618
2622
return NULL ;
2619
2623
}
@@ -2624,6 +2628,7 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
2624
2628
const char * endp = ap_strrchr_c (arg , '>' );
2625
2629
int old_overrides = cmd -> override ;
2626
2630
char * old_path = cmd -> path ;
2631
+ ap_regex_t * old_regex = cmd -> regex ;
2627
2632
core_dir_config * conf ;
2628
2633
const command_rec * thiscmd = cmd -> cmd ;
2629
2634
ap_conf_vector_t * new_url_conf = ap_create_per_dir_config (cmd -> pool );
@@ -2658,6 +2663,9 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
2658
2663
return "Regex could not be compiled" ;
2659
2664
}
2660
2665
}
2666
+ else {
2667
+ cmd -> regex = NULL ;
2668
+ }
2661
2669
2662
2670
/* initialize our config and fetch it */
2663
2671
conf = ap_set_config_vectors (cmd -> server , new_url_conf , cmd -> path ,
@@ -2685,6 +2693,7 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
2685
2693
2686
2694
cmd -> path = old_path ;
2687
2695
cmd -> override = old_overrides ;
2696
+ cmd -> regex = old_regex ;
2688
2697
2689
2698
return NULL ;
2690
2699
}
@@ -2695,6 +2704,7 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg)
2695
2704
const char * endp = ap_strrchr_c (arg , '>' );
2696
2705
int old_overrides = cmd -> override ;
2697
2706
char * old_path = cmd -> path ;
2707
+ ap_regex_t * old_regex = cmd -> regex ;
2698
2708
core_dir_config * conf ;
2699
2709
const command_rec * thiscmd = cmd -> cmd ;
2700
2710
ap_conf_vector_t * new_file_conf = ap_create_per_dir_config (cmd -> pool );
@@ -2736,6 +2746,9 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg)
2736
2746
}
2737
2747
else {
2738
2748
char * newpath ;
2749
+
2750
+ cmd -> regex = NULL ;
2751
+
2739
2752
/* Ensure that the pathname is canonical, but we
2740
2753
* can't test the case/aliases without a fixed path */
2741
2754
if (apr_filepath_merge (& newpath , "" , cmd -> path ,
@@ -2771,6 +2784,7 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg)
2771
2784
2772
2785
cmd -> path = old_path ;
2773
2786
cmd -> override = old_overrides ;
2787
+ cmd -> regex = old_regex ;
2774
2788
2775
2789
return NULL ;
2776
2790
}
0 commit comments