mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Applied patch from Recai to give precedence to directories from the command line
SVN revision: 1287
This commit is contained in:
parent
5c6e2b4928
commit
6fc1e0b7af
30
src/elogd.c
30
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.601 2005/03/29 07:30:30 ritt
|
||||||
|
Applied patch from Recai to give precedence to directories from the command line
|
||||||
|
|
||||||
Revision 1.600 2005/03/29 07:19:37 ritt
|
Revision 1.600 2005/03/29 07:19:37 ritt
|
||||||
Added add_special_xxx
|
Added add_special_xxx
|
||||||
|
|
||||||
@ -22276,13 +22279,6 @@ int main(int argc, char *argv[])
|
|||||||
/* default config file */
|
/* default config file */
|
||||||
strlcat(config_file, CFGFILE, sizeof(config_file));
|
strlcat(config_file, CFGFILE, sizeof(config_file));
|
||||||
|
|
||||||
#ifdef RESOURCE_DIR
|
|
||||||
strlcpy(resource_dir, RESOURCE_DIR, sizeof(resource_dir));
|
|
||||||
#endif
|
|
||||||
#ifdef LOGBOOK_DIR
|
|
||||||
strlcpy(logbook_dir, LOGBOOK_DIR, sizeof(logbook_dir));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* parse command line parameters */
|
/* parse command line parameters */
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (argv[i][0] == '-' && argv[i][1] == 'D')
|
if (argv[i][0] == '-' && argv[i][1] == 'D')
|
||||||
@ -22453,11 +22449,21 @@ int main(int argc, char *argv[])
|
|||||||
/* parse contents of config file into internal structure */
|
/* parse contents of config file into internal structure */
|
||||||
check_config();
|
check_config();
|
||||||
|
|
||||||
/* evaluate directories from config file */
|
/* evaluate undefined directories from config file or compiled-in defaults */
|
||||||
if (getcfg("global", "Resource Dir", str, sizeof(str)))
|
if (!resource_dir[0])
|
||||||
strlcpy(resource_dir, str, sizeof(resource_dir));
|
if (getcfg("global", "Resource Dir", str, sizeof(str)))
|
||||||
if (getcfg("global", "Logbook Dir", str, sizeof(str)))
|
strlcpy(resource_dir, str, sizeof(resource_dir));
|
||||||
strlcpy(logbook_dir, str, sizeof(logbook_dir));
|
#ifdef RESOURCE_DIR
|
||||||
|
else
|
||||||
|
strlcpy(resource_dir, RESOURCE_DIR, sizeof(resource_dir));
|
||||||
|
#endif
|
||||||
|
if (!logbook_dir[0])
|
||||||
|
if (getcfg("global", "Logbook Dir", str, sizeof(str)))
|
||||||
|
strlcpy(logbook_dir, str, sizeof(logbook_dir));
|
||||||
|
#ifdef LOGBOOK_DIR
|
||||||
|
else
|
||||||
|
strlcpy(logbook_dir, LOGBOOK_DIR, sizeof(logbook_dir));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* extract resource directory from configuration file if not given */
|
/* extract resource directory from configuration file if not given */
|
||||||
if (config_file[0] && strchr(config_file, DIR_SEPARATOR)
|
if (config_file[0] && strchr(config_file, DIR_SEPARATOR)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user