mirror of https://git.ffmpeg.org/ffmpeg.git
ffserver_config: reflow _get_arg()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
parent
da95fe4ef8
commit
ac896f0cd1
|
@ -84,28 +84,24 @@ void ffserver_get_arg(char *buf, int buf_size, const char **pp)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
char *q;
|
char *q;
|
||||||
int quote;
|
int quote = 0;
|
||||||
|
|
||||||
p = *pp;
|
p = *pp;
|
||||||
while (av_isspace(*p)) p++;
|
|
||||||
q = buf;
|
q = buf;
|
||||||
quote = 0;
|
|
||||||
|
while (av_isspace(*p)) p++;
|
||||||
|
|
||||||
if (*p == '\"' || *p == '\'')
|
if (*p == '\"' || *p == '\'')
|
||||||
quote = *p++;
|
quote = *p++;
|
||||||
for(;;) {
|
|
||||||
if (quote) {
|
while (*p != '\0') {
|
||||||
if (*p == quote)
|
if (quote && *p == quote || !quote && av_isspace(*p))
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
if (av_isspace(*p))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (*p == '\0')
|
|
||||||
break;
|
break;
|
||||||
if ((q - buf) < buf_size - 1)
|
if ((q - buf) < buf_size - 1)
|
||||||
*q++ = *p;
|
*q++ = *p;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*q = '\0';
|
*q = '\0';
|
||||||
if (quote && *p == quote)
|
if (quote && *p == quote)
|
||||||
p++;
|
p++;
|
||||||
|
|
Loading…
Reference in New Issue