File 0003-Fix-table-function-renaming.patch of Package lua-lua-mpris.10434
From e4567e27986cccbdf01de0ec82dff489475099c9 Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <antonio.larrosa@gmail.com>
Date: Fri, 14 Jun 2019 13:57:17 +0200
Subject: [PATCH] Fix table/function renaming so they're properly named in all
places.
It seems I renamed a table/function and forgot to rename some
occurrences.
---
mpv.lua | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/mpv.lua b/mpv.lua
index 84da173..ba02ee0 100644
--- a/mpv.lua
+++ b/mpv.lua
@@ -7,22 +7,22 @@ end
local valid_utf8_sequences = { {{0,127}},
- {{194,223}, {128,191}},
- { 224 , {160,191}, {128,191}},
- {{225,236}, {128,191}, {128,191}},
- { 237 , {128,159}, {128,191}},
- {{238,239}, {128,191}, {128,191}},
- { 240 , {144,191}, {128,191}, {128,191}},
- {{241,243}, {128,191}, {128,191}, {128,191}},
- { 244 , {128,143}, {128,191}, {128,191}}
- }
+ {{194,223}, {128,191}},
+ { 224 , {160,191}, {128,191}},
+ {{225,236}, {128,191}, {128,191}},
+ { 237 , {128,159}, {128,191}},
+ {{238,239}, {128,191}, {128,191}},
+ { 240 , {144,191}, {128,191}, {128,191}},
+ {{241,243}, {128,191}, {128,191}, {128,191}},
+ { 244 , {128,143}, {128,191}, {128,191}}
+ }
-- Returns the length (in bytes) of the character at (byte) position i of
-- the string str . Returns -1 if there's an invalid character at position i.
function utf8_char_length(str, i)
local len = string.len(str)
- for k, sequence in pairs(valid_sequences) do
+ for k, sequence in pairs(valid_utf8_sequences) do
if i + #sequence - 1 > len then
return -1
end
@@ -56,7 +56,7 @@ function remove_invalid_utf8_chars(str)
while i <= len do
local seq = {}
- local char_length = char_length(str, i)
+ local char_length = utf8_char_length(str, i)
if char_length > 0 then
i = i + char_length
else