[MPlayer-dev-eng] [PATCH] Fix parse comment bug for input.conf

Ulion ulion2002 at gmail.com
Tue Oct 23 02:45:21 CEST 2007


2007/10/16, Ulion <ulion2002 at gmail.com>:
> 2007/10/16, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > The code looks a bit weird though, it looks like using only tab to
> > separate the arguments won't work (I didn't check the code thoroughly
> > though).
>
> Agree, that's another bug. Can be fixed by:
>
> Index: input/input.c
> ===================================================================
> --- input/input.c       (revision 24795)
> +++ input/input.c       (working copy)
> @@ -754,8 +754,8 @@
>    ptr = str;
>
>    for(i=0; ptr && i < MP_CMD_MAX_ARGS; i++) {
> -    ptr = strchr(ptr,' ');
> -    if(!ptr) break;
> +    while(ptr[0] != ' ' && ptr[0] != '\t' && ptr[0] != '\0') ptr++;
> +    if(ptr[0] == '\0') break;
>      while(ptr[0] == ' ' || ptr[0] == '\t') ptr++;
>      if(ptr[0] == '\0') break;
>      cmd->args[i].type = cmd_def->args[i].type;
>

This is a trivial fix, I applied this first. I'm still not sure
whether I can apply the comment parse patch.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list