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

Dan Oscarsson Dan.Oscarsson at tieto.com
Tue Jun 29 08:28:46 CEST 2010


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.
Possibly an alternativ could be to output non-status lines with a
trailing "clear to end of line" before a final \n. But that is probably
more complex and will add one more escape sequence I do not want in log
files (when you redirect output to a file).

  Dan




More information about the MPlayer-dev-eng mailing list