aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-05-26 20:58:13 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-05-29 01:02:47 +0200
commitc365cdf2028aaefd92f44b0924596f35d165ebda (patch)
treed75bcafa8dad234e58753966728ebc7da26366ad
parent6994b552a6a425eaa996346d68f937ee70023844 (diff)
downloadffmpeg-c365cdf2028aaefd92f44b0924596f35d165ebda.tar.gz
ffprobe: add support to '\b' and '\f' escaping in c_escape_str()
-rw-r--r--doc/ffprobe.texi6
-rw-r--r--ffprobe.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
index ed96575ed3..cde1d34211 100644
--- a/doc/ffprobe.texi
+++ b/doc/ffprobe.texi
@@ -245,9 +245,9 @@ Set the escape mode to use, default to "c".
It can assume one of the following values:
@table @option
@item c
-Perform C-like escaping. Strings containing a newline ('\n') or
-carriage return ('\r'), the escaping character ('\') or the item
-separator character @var{SEP} are escaped using C-like fashioned
+Perform C-like escaping. Strings containing a newline ('\n'), carriage
+return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
+character ('\') or the item separator character @var{SEP} are escaped using C-like fashioned
escaping, so that a newline is converted to the sequence "\n", a
carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
converted to "\@var{SEP}".
diff --git a/ffprobe.c b/ffprobe.c
index 12b5c374ff..15e761ebab 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -505,6 +505,8 @@ static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep,
for (p = src; *p; p++) {
switch (*src) {
+ case '\b': av_bprintf(dst, "%s", "\\b"); break;
+ case '\f': av_bprintf(dst, "%s", "\\f"); break;
case '\n': av_bprintf(dst, "%s", "\\n"); break;
case '\r': av_bprintf(dst, "%s", "\\r"); break;
case '\\': av_bprintf(dst, "%s", "\\\\"); break;