Bugfix
* libmailutils/cfg/parser.y (mu_cfg_parse_config): Silently ignore ENOENT
Showing
1 changed file
with
21 additions
and
14 deletions
... | @@ -1530,15 +1530,19 @@ mu_cfg_parse_config (mu_cfg_tree_t **ptree, struct mu_cfg_parse_hints *hints) | ... | @@ -1530,15 +1530,19 @@ mu_cfg_parse_config (mu_cfg_tree_t **ptree, struct mu_cfg_parse_hints *hints) |
1530 | { | 1530 | { |
1531 | rc = mu_cfg_parse_file (&tmp, hints->site_file, hints->flags); | 1531 | rc = mu_cfg_parse_file (&tmp, hints->site_file, hints->flags); |
1532 | 1532 | ||
1533 | if (rc == ENOMEM) | 1533 | switch (rc) |
1534 | { | ||
1535 | mu_error ("%s", mu_strerror (rc)); | ||
1536 | return rc; | ||
1537 | } | ||
1538 | else if (rc == 0) | ||
1539 | { | 1534 | { |
1535 | case 0: | ||
1540 | mu_cfg_tree_postprocess (tmp, hints); | 1536 | mu_cfg_tree_postprocess (tmp, hints); |
1541 | mu_cfg_tree_union (&tree, &tmp); | 1537 | mu_cfg_tree_union (&tree, &tmp); |
1538 | |||
1539 | case ENOENT: | ||
1540 | rc = 0; | ||
1541 | break; | ||
1542 | |||
1543 | default: | ||
1544 | mu_error ("%s", mu_strerror (rc)); | ||
1545 | return rc; | ||
1542 | } | 1546 | } |
1543 | } | 1547 | } |
1544 | 1548 | ||
... | @@ -1556,19 +1560,22 @@ mu_cfg_parse_config (mu_cfg_tree_t **ptree, struct mu_cfg_parse_hints *hints) | ... | @@ -1556,19 +1560,22 @@ mu_cfg_parse_config (mu_cfg_tree_t **ptree, struct mu_cfg_parse_hints *hints) |
1556 | strcat (file_name, hints->program); | 1560 | strcat (file_name, hints->program); |
1557 | 1561 | ||
1558 | rc = mu_cfg_parse_file (&tmp, file_name, xhints.flags); | 1562 | rc = mu_cfg_parse_file (&tmp, file_name, xhints.flags); |
1559 | if (rc == ENOMEM) | 1563 | switch (rc) |
1560 | { | 1564 | { |
1565 | case 0: | ||
1566 | mu_cfg_tree_postprocess (tmp, &xhints); | ||
1567 | mu_cfg_tree_union (&tree, &tmp); | ||
1568 | break; | ||
1569 | |||
1570 | case ENOENT: | ||
1571 | rc = 0; | ||
1572 | break; | ||
1573 | |||
1574 | default: | ||
1561 | mu_error ("%s", mu_strerror (rc)); | 1575 | mu_error ("%s", mu_strerror (rc)); |
1562 | mu_cfg_destroy_tree (&tree); | 1576 | mu_cfg_destroy_tree (&tree); |
1563 | return rc; | 1577 | return rc; |
1564 | } | 1578 | } |
1565 | else if (rc == 0) | ||
1566 | { | ||
1567 | mu_cfg_tree_postprocess (tmp, &xhints); | ||
1568 | mu_cfg_tree_union (&tree, &tmp); | ||
1569 | } | ||
1570 | else if (rc == ENOENT) | ||
1571 | rc = 0; | ||
1572 | free (file_name); | 1579 | free (file_name); |
1573 | } | 1580 | } |
1574 | } | 1581 | } | ... | ... |
-
Please register or sign in to post a comment