File: 107_config_path.patch

package info (click to toggle)
parser 3.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,416 kB
  • sloc: cpp: 31,111; sh: 11,522; ansic: 9,417; yacc: 1,363; makefile: 236; awk: 5
file content (34 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Description: Search for configuration file in PARSER_CONFIG_DIR
Author: Sergey B Kirpichev <skirpichev@gmail.com>

PARSER_CONFIG_DIR=/etc/parser3/

Search priority:
1. Command-line option -c
2. Environment variable CGI_PARSER_CONFIG
3. In the directory with CGI-script itself
4. Default location PARSER_CONFIG_DIR "/" AUTO_FILE_NAME

---
 src/targets/cgi/parser3.C |    3 +++
 1 file changed, 3 insertions(+)

--- a/src/targets/cgi/parser3.C
+++ b/src/targets/cgi/parser3.C
@@ -40,6 +40,7 @@
 #define REDIRECT_PREFIX "REDIRECT_"
 #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG"
 #define PARSER_LOG_ENV_NAME "CGI_PARSER_LOG"
+#define PARSER_CONFIG_DIR "/etc/parser3"
 
 /// IIS refuses to read bigger chunks
 const size_t READ_POST_CHUNK_SIZE=0x400*0x400; // 1M 
@@ -543,6 +544,8 @@
 					"%s/%s", 
 					beside_binary_path, AUTO_FILE_NAME);
 				config_filespec_cstr=config_filespec_buf;
+                if (!entry_exists(config_filespec_cstr)) // default system-wide...
+                    config_filespec_cstr=PARSER_CONFIG_DIR "/" AUTO_FILE_NAME;
 				fail_on_config_read_problem=entry_exists(config_filespec_cstr);
 			}
 		}