From e4d0ea5373762b4fe85e4629fbf9959763089150 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Sun, 15 Jan 2012 13:22:18 +0000 Subject: [PATCH] getstyle: Get rid of abortar() Instead of using a temporary buffer to store a "reason" string which is later printf()'ed by abortar(), use wwarning() directly and do the small cleanup done by abortar() on the spot. As this was the only call site for abortar() it can now be removed. The resulting object code gets smaller as a side effect. Thanks to Christophe for finding a mistake in the first version of this patch. --- util/getstyle.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/util/getstyle.c b/util/getstyle.c index 3932962c..7b740396 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -148,16 +148,6 @@ void print_help(int print_usage, int exitval) exit(exitval); } -void abortar(char *reason) -{ - printf("%s: %s\n", __progname, reason); - if (ThemePath) { - printf("Removing unfinished theme pack\n"); - (void)wrmdirhier(ThemePath); - } - exit(1); -} - static Bool isFontOption(char *option) { int i; @@ -177,10 +167,9 @@ void findCopyFile(char *dir, char *file) fullPath = wfindfileinarray(PixmapPath, file); if (!fullPath) { - char buffer[4000]; - - sprintf(buffer, "could not find file %s", file); - abortar(buffer); + wwarning("Could not find file %s", file); + if (ThemePath) + (void)wrmdirhier(ThemePath); } copy_file(dir, fullPath, fullPath); free(fullPath);