|
|
@ -567,9 +567,9 @@ static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep, |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx) |
|
|
|
static const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int quote = !!src[strcspn(src, "\",\n\r")]; |
|
|
|
int needs_quoting = !!src[strcspn(src, "\",\n\r")]; |
|
|
|
|
|
|
|
|
|
|
|
if (quote) |
|
|
|
if (needs_quoting) |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
|
|
|
|
|
|
|
|
for (; *src; src++) { |
|
|
|
for (; *src; src++) { |
|
|
@ -577,7 +577,7 @@ static const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
av_bprint_chars(dst, *src, 1); |
|
|
|
av_bprint_chars(dst, *src, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
if (quote) |
|
|
|
if (needs_quoting) |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
av_bprint_chars(dst, '\"', 1); |
|
|
|
return dst->str; |
|
|
|
return dst->str; |
|
|
|
} |
|
|
|
} |
|
|
|