From f32583326d21b9a17862bdd375fb307175fd6b27 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 29 Oct 2007 23:42:47 +0000 Subject: [PATCH] always get tool_active right Organization: Straylight/Edgeware From: Richard Kettlewell --- disobedience/appearance.c | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/disobedience/appearance.c b/disobedience/appearance.c index 388c501..868f8c9 100644 --- a/disobedience/appearance.c +++ b/disobedience/appearance.c @@ -163,34 +163,34 @@ void load_appearance(void) { if(errno != ENOENT) fpopup_msg(GTK_MESSAGE_ERROR, "error opening %s: %s", path, strerror(errno)); - return; - } - while(!inputline(path, fp, &line, '\n')) { - if(!(vec = split(line, &nvec, SPLIT_COMMENTS|SPLIT_QUOTES, 0, 0)) - || !nvec) - continue; - if(!strcmp(vec[0], "color")) { - if(nvec != 5) { - error(0, "%s: malformed '%s' command", path, vec[0]); + } else { + while(!inputline(path, fp, &line, '\n')) { + if(!(vec = split(line, &nvec, SPLIT_COMMENTS|SPLIT_QUOTES, 0, 0)) + || !nvec) continue; - } - for(n = 0; n < NCOLORS && strcmp(colors[n].name, vec[1]); ++n) - ; - if(n >= NCOLORS) { - error(0, "%s: unknown color '%s'", path, vec[1]); - continue; - } - colors[n].color->red = strtoul(vec[2], 0, 0); - colors[n].color->green = strtoul(vec[3], 0, 0); - colors[n].color->blue = strtoul(vec[4], 0, 0); - } else - /* mention errors but otherwise ignore them */ - error(0, "%s: unknown command '%s'", path, vec[0]); - } - if(ferror(fp)) { - fpopup_msg(GTK_MESSAGE_ERROR, "error reading %s: %s", - path, strerror(errno)); - fclose(fp); + if(!strcmp(vec[0], "color")) { + if(nvec != 5) { + error(0, "%s: malformed '%s' command", path, vec[0]); + continue; + } + for(n = 0; n < NCOLORS && strcmp(colors[n].name, vec[1]); ++n) + ; + if(n >= NCOLORS) { + error(0, "%s: unknown color '%s'", path, vec[1]); + continue; + } + colors[n].color->red = strtoul(vec[2], 0, 0); + colors[n].color->green = strtoul(vec[3], 0, 0); + colors[n].color->blue = strtoul(vec[4], 0, 0); + } else + /* mention errors but otherwise ignore them */ + error(0, "%s: unknown command '%s'", path, vec[0]); + } + if(ferror(fp)) { + fpopup_msg(GTK_MESSAGE_ERROR, "error reading %s: %s", + path, strerror(errno)); + fclose(fp); + } } tool_active = tool_bg; tool_active.red = clamp(105 * tool_active.red / 100); -- [mdw]