[MPlayer-dev-eng] [PATCH] mp_msg - avoid having status line overwrite messages

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jun 29 16:39:12 CEST 2010


On Tue, Jun 29, 2010 at 08:28:46AM +0200, Dan Oscarsson wrote:
> On 2010-06-28 at 19:34 +0200 Reimar Döffinger wrote:
> > >      if (header)
> > >          print_msg_module(stream, mod);
> > >      set_msg_color(stream, lev);
> > >      header = tmp[strlen(tmp)-1] == '\n' || tmp[strlen(tmp)-1] == '\r';
> > > +    statusline = tmp[strlen(tmp)-1] == '\r' && lev == MSGL_STATUS;
> > 
> > Why the check for '\r'? I'm quite unhappy about those strlen-usages, they
> > break quite badly if someone ever tries to print an empty string...
> 
> Because if \r have been output, next line will overwrite current line.

Ok, let me simplify my question:
What breaks if you just use
statusline = lev == MSGL_STATUS;



More information about the MPlayer-dev-eng mailing list