[FFmpeg-devel] [PATCH v5 1/4] avutil/{avstring, bprint}: add XML escaping from ffprobe to avutil

Michael Niedermayer michael at niedermayer.cc
Fri Feb 26 19:54:06 EET 2021


On Mon, Feb 22, 2021 at 03:19:11PM +0200, Jan Ekström wrote:
> From: Stefano Sabatini <stefasab at gmail.com>
> 
> Base escaping only escapes values required for base character data
> according to part 2.4 of XML, and if additional flags are added
> single and double quotes can additionally be escaped in order
> to handle single and double quoted attributes.
> ---
>  libavutil/avstring.h | 14 ++++++++++++++
>  libavutil/bprint.c   | 29 +++++++++++++++++++++++++++++
>  libavutil/version.h  |  2 +-
>  tools/ffescape.c     |  7 +++++--
>  4 files changed, 49 insertions(+), 3 deletions(-)

breaks: tools/ffescape.o

CC	tools/ffescape.o
tools/ffescape.c: In function ‘main’:
tools/ffescape.c:83:59: error: expected ‘)’ before ‘escape_flags’
             else if (!strcmp(optarg, "xml_single_quotes") escape_flags |= AV_ESCAPE_FLAG_XML_SINGLE_QUOTES);
                                                           ^~~~~~~~~~~~
tools/ffescape.c:84:59: error: expected ‘)’ before ‘escape_flags’
             else if (!strcmp(optarg, "xml_double_quotes") escape_flags |= AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES);
                                                           ^~~~~~~~~~~~
ffbuild/common.mak:67: recipe for target 'tools/ffescape.o' failed
make: *** [tools/ffescape.o] Error 1


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210226/8247ff73/attachment.sig>


More information about the ffmpeg-devel mailing list