fix tag_view prev/next segfault

This commit is contained in:
Julien Danjou 2007-12-15 13:35:15 +01:00
parent 8500188d6a
commit 8b62669970
1 changed files with 6 additions and 4 deletions

10
tag.c
View File

@ -342,6 +342,9 @@ uicb_tag_viewnext(awesome_config *awesomeconf,
{
Tag *curtag = get_current_tag(awesomeconf->screens[screen]);
if(!curtag->next)
return;
curtag->selected = False;
curtag->next->selected = True;
@ -360,14 +363,13 @@ uicb_tag_viewprev(awesome_config *awesomeconf,
{
Tag *tag, *curtag = get_current_tag(awesomeconf->screens[screen]);
for(tag = awesomeconf->screens[screen].tags - 1; tag && tag->next != curtag; tag = tag->next);
for(tag = awesomeconf->screens[screen].tags; tag && tag->next != curtag; tag = tag->next);
if(tag)
{
tag->selected = True;
curtag->selected = False;
saveawesomeprops(awesomeconf, screen);
arrange(awesomeconf, screen);
}
saveawesomeprops(awesomeconf, screen);
arrange(awesomeconf, screen);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99