[Frugalware-git] xbdmenu: menu.c

James Buren ryuo at frugalware.org
Mon Mar 16 07:56:11 CET 2009


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xbdmenu.git;a=commitdiff;h=80cb7a48d3a13bac27340233597a023a706747ca

commit 80cb7a48d3a13bac27340233597a023a706747ca
Author: James Buren <ryuo at frugalware.org>
Date:   Mon Mar 16 02:04:00 2009 -0500

menu.c
* remove iconpath, replace with local variable usage

diff --git a/menu.c b/menu.c
index d6df1e3..b3498f0 100644
--- a/menu.c
+++ b/menu.c
@@ -21,13 +21,14 @@ static int menu_parse_line(const char *line)
strtrim(icon);
if(isprint(name[0])&&isprint(cmd[0])&&isprint(icon[0]))
{
+		char *buf = strcmb(env->menudir,icon);
menu = (mn>0) ? realloc(menu,MSIZE) : zmalloc(MSIZE);
menu[mn].name = zstrdup(name);
menu[mn].cmd = zstrdup(cmd);
-		menu[mn].iconpath = strcmb(env->menudir,icon);
-		if((menu[mn].icon=load_image(menu[mn].iconpath))==NULL)
+		if((menu[mn].icon=load_image(buf))==NULL)
ret = 0;
++mn;
+		zfree(buf);
}
else
ret = 0;
@@ -71,8 +72,6 @@ extern void menu_end(void)
zfree(menu[i].name);
if(menu[i].cmd)
zfree(menu[i].cmd);
-			if(menu[i].iconpath)
-				zfree(menu[i].iconpath);
if(menu[i].icon)
free_image(menu[i].icon);
}


More information about the Frugalware-git mailing list