Browse Source

ffprobe: add support to '\b' and '\f' escaping in c_escape_str()

tags/n1.0
Stefano Sabatini 13 years ago
parent
commit
c365cdf202
2 changed files with 5 additions and 3 deletions
  1. +3
    -3
      doc/ffprobe.texi
  2. +2
    -0
      ffprobe.c

+ 3
- 3
doc/ffprobe.texi View File

@@ -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}".


+ 2
- 0
ffprobe.c View File

@@ -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;


Loading…
Cancel
Save