- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
/* load config */
for (i = 0; ; i++) {
conf[0] = '\0';
switch (i) {
case 0:
/* ~ */
snprintf(conf, sizeof conf, "%s/.%s",
pwd->pw_dir, SWM_CONF_FILE);
break;
case 1:
/* global */
snprintf(conf, sizeof conf, "/etc/%s",
SWM_CONF_FILE);
break;
case 2:
/* ~ compat */
snprintf(conf, sizeof conf, "%s/.%s",
pwd->pw_dir, SWM_CONF_FILE_OLD);
break;
case 3:
/* global compat */
snprintf(conf, sizeof conf, "/etc/%s",
SWM_CONF_FILE_OLD);
break;
default:
goto noconfig;
}
if (strlen(conf) && stat(conf, &sb) != -1)
if (S_ISREG(sb.st_mode)) {
cfile = conf;
break;
}
}
Anal_teacher 15.08.2016 13:14 # −68
Shamill 15.08.2016 13:35 # −67
Psionic 15.08.2016 18:26 # −1
guest 16.08.2016 00:00 # 0