diff options
| author | Michael Forney <mforney@mforney.org> | 2016-07-10 12:22:14 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-07-10 12:22:14 -0700 |
| commit | 064f02c45807259d435082c93cd9dae4b1ea4621 (patch) | |
| tree | 2fa0343a90aff1c88daf737b46918c3999cbad33 /media/mpv/file2string.awk | |
| parent | 87a2a6a07e9a0dc759c4e0035726b2109eb1a65b (diff) | |
mpv: Rewrite file2string in C to handle NULL bytes
It is also used for binary files like osd_font.otf.
Diffstat (limited to 'media/mpv/file2string.awk')
| -rw-r--r-- | media/mpv/file2string.awk | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/media/mpv/file2string.awk b/media/mpv/file2string.awk deleted file mode 100644 index 113d1729..00000000 --- a/media/mpv/file2string.awk +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN { - for (n = 0; n < 256; ++n) - ord[sprintf("%c", n)] = n -} - -FNR == 1 { - print "/* Generated from " FILENAME " */" -} - -{ - printf "\"" - s = $0 - while (length(s) > 0) { - i = match(s, "[^][A-Za-z0-9!#%&'()*+,./:;<=>^_{|}~ -]") - if (i == 0) { - printf "%s", s - break - } - printf "%s\\%03o", substr(s, 1, i-1), ord[substr(s, i, 1)] - s = substr(s, i+1) - } - printf "\\012\"\n" -} |
