X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Finfowin.c;fp=ioncore%2Finfowin.c;h=66029b2a41ff5ad675769d8e0f9dc4d5d3b0758c;hp=5dd0b2871d9c955443f882792ce211c33a68c72c;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=29aae1975d46f66b97a2b873f1875eded8c6fbc3 diff --git a/ioncore/infowin.c b/ioncore/infowin.c index 5dd0b28..66029b2 100644 --- a/ioncore/infowin.c +++ b/ioncore/infowin.c @@ -1,7 +1,7 @@ /* * ion/ioncore/infowin.h * - * Copyright (c) Tuomo Valkonen 1999-2008. + * Copyright (c) Tuomo Valkonen 1999-2009. * * See the included file LICENSE for details. */ @@ -198,18 +198,22 @@ void infowin_set_text(WInfoWin *p, const char *str, int maxw) { bool set=FALSE; - if(maxw>0 && p->brush!=NULL){ - char *tmp=grbrush_make_label(p->brush, str, maxw); - if(tmp!=NULL){ - infowin_do_set_text(p, tmp); - free(tmp); - set=TRUE; + if(str==NULL){ + INFOWIN_BUFFER(p)[0]='\0'; + }else{ + if(maxw>0 && p->brush!=NULL){ + char *tmp=grbrush_make_label(p->brush, str, maxw); + if(tmp!=NULL){ + infowin_do_set_text(p, tmp); + free(tmp); + set=TRUE; + } } + + if(!set) + infowin_do_set_text(p, str); } - if(!set) - infowin_do_set_text(p, str); - infowin_resize(p); /* sometimes unnecessary */