mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-23 19:39:06 +00:00
check validity of specified config
* I accidentially used wrong args when testing conky -> segfault * reproduce using 'conky -c /this/doesnt/exist' * code should be portable, but untested on freebsd git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1044 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
c2c01423a8
commit
d6953f4864
11
src/conky.c
11
src/conky.c
@ -8500,6 +8500,17 @@ int main(int argc, char **argv)
|
||||
init_X11();
|
||||
#endif /* X11 */
|
||||
|
||||
/* check if specified config file is valid */
|
||||
if (current_config) {
|
||||
struct stat sb;
|
||||
if (stat(current_config, &sb) ||
|
||||
(!S_ISREG(sb.st_mode) && !S_ISLNK(sb.st_mode))) {
|
||||
ERR("invalid configuration file '%s'\n", current_config);
|
||||
free(current_config);
|
||||
current_config = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */
|
||||
|
||||
if (!current_config) {
|
||||
|
Loading…
Reference in New Issue
Block a user