mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
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 <christophe.curis@free.fr> for finding a mistake in the first version of this patch.
This commit is contained in:
@@ -148,16 +148,6 @@ void print_help(int print_usage, int exitval)
|
|||||||
exit(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)
|
static Bool isFontOption(char *option)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -177,10 +167,9 @@ void findCopyFile(char *dir, char *file)
|
|||||||
|
|
||||||
fullPath = wfindfileinarray(PixmapPath, file);
|
fullPath = wfindfileinarray(PixmapPath, file);
|
||||||
if (!fullPath) {
|
if (!fullPath) {
|
||||||
char buffer[4000];
|
wwarning("Could not find file %s", file);
|
||||||
|
if (ThemePath)
|
||||||
sprintf(buffer, "could not find file %s", file);
|
(void)wrmdirhier(ThemePath);
|
||||||
abortar(buffer);
|
|
||||||
}
|
}
|
||||||
copy_file(dir, fullPath, fullPath);
|
copy_file(dir, fullPath, fullPath);
|
||||||
free(fullPath);
|
free(fullPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user