process options, possibly including SYSCF */
| 7076 | |
| 7077 | /* process options, possibly including SYSCF */ |
| 7078 | void |
| 7079 | initoptions(void) |
| 7080 | { |
| 7081 | /* |
| 7082 | * Most places that call initoptions_init()/initoptions() would |
| 7083 | * have the calls next to each other, so instead of adding |
| 7084 | * initoptions_init() everywhere, just add it where it's needed in |
| 7085 | * a non-adjacent place and call it here for all the other cases. |
| 7086 | */ |
| 7087 | if (go.opt_phase != builtin_opt) |
| 7088 | initoptions_init(); |
| 7089 | #ifdef SYSCF |
| 7090 | /* someday there may be other SYSCF alternatives besides text file */ |
| 7091 | #ifdef SYSCF_FILE |
| 7092 | /* If SYSCF_FILE is specified, it _must_ exist... */ |
| 7093 | assure_syscf_file(); |
| 7094 | config_error_init(TRUE, SYSCF_FILE, FALSE); |
| 7095 | |
| 7096 | /* ... and _must_ parse correctly. */ |
| 7097 | go.opt_phase = syscf_opt; |
| 7098 | if (!read_config_file(SYSCF_FILE, set_in_sysconf)) { |
| 7099 | if (config_error_done() && !iflags.initoptions_noterminate) |
| 7100 | nh_terminate(EXIT_FAILURE); |
| 7101 | } |
| 7102 | config_error_done(); |
| 7103 | /* |
| 7104 | * TODO [maybe]: parse the sysopt entries which are space-separated |
| 7105 | * lists of usernames into arrays with one name per element. |
| 7106 | */ |
| 7107 | #endif |
| 7108 | #endif /* SYSCF */ |
| 7109 | |
| 7110 | /* Carry out options that got deferred from early_options */ |
| 7111 | if (gd.deferred_showpaths) |
| 7112 | do_deferred_showpaths(0); /* does not return */ |
| 7113 | |
| 7114 | initoptions_finish(); |
| 7115 | } |
| 7116 | |
| 7117 | /* set up default values for options where 0 or False isn't sufficient */ |
| 7118 | void |
no test coverage detected