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

Dan Oscarsson Dan.Oscarsson at tieto.com
Thu Jul 1 08:24:28 CEST 2010


On 2010-06-29 at 16:39 +0200 Reimar Döffinger wrote:
> > > >      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;

I do not know. Tested it and it looks ok. Looking at where MSGL_STATUS
is used shows lines terminated in new line but those lines do not look
like output I have seen so I cannot say how those look. Though the only
effect would be an extra new line and that could be fixed later on, with
those output statements, if it is disturbing users.

   Dan





More information about the MPlayer-dev-eng mailing list