aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.c
diff options
context:
space:
mode:
authorokan2014-02-01 00:25:04 +0000
committerokan2014-02-01 00:25:04 +0000
commit040a853128dd2340395d0f3c92ad911aa8dfc4fc (patch)
tree2f9a9598b53de04bc96c871c7aa6a90a52f1146e /calmwm.c
parentc98fe0797ad171985b3a2be70afdef2870289ee6 (diff)
downloadcwm-040a853128dd2340395d0f3c92ad911aa8dfc4fc.tar.gz
Let the config parser continue parsing even after encountering an error;
original idea (with now-outdated patch) from Thomas Adam. Since we now report where errors exist, this now makes more sense. Expand a bit on config file parsing in the cwm(1). Discussed with a few, including sthen; ok sthen.
Diffstat (limited to '')
-rw-r--r--calmwm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/calmwm.c b/calmwm.c
index 2add0d4..5f8590e 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.c,v 1.87 2014/01/28 00:42:20 okan Exp $
+ * $OpenBSD: calmwm.c,v 1.88 2014/02/01 00:25:04 okan Exp $
*/
#include <sys/param.h>
@@ -108,11 +108,8 @@ main(int argc, char **argv)
}
conf_init(&Conf);
- if (conf_path && (parse_config(conf_path, &Conf) == -1)) {
- warnx("config file %s has errors, not loading", conf_path);
- conf_clear(&Conf);
- conf_init(&Conf);
- }
+ if (conf_path && (parse_config(conf_path, &Conf) == -1))
+ warnx("config file %s has errors", conf_path);
free(conf_path);
x_init(display_name);
@@ -142,7 +139,6 @@ x_init(const char *dpyname)
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
conf_atoms();
-
conf_cursor(&Conf);
for (i = 0; i < ScreenCount(X_Dpy); i++)
@@ -162,6 +158,8 @@ x_teardown(void)
struct screen_ctx *sc;
unsigned int i;
+ conf_clear(&Conf);
+
TAILQ_FOREACH(sc, &Screenq, entry) {
for (i = 0; i < CWM_COLOR_NITEMS; i++)
XftColorFree(X_Dpy, sc->visual, sc->colormap,