Allow escaped quotation marks in item_name
This commit is contained in:
parent
eb2f1410c8
commit
ea29526f54
1 changed files with 2 additions and 2 deletions
4
c4mate
4
c4mate
|
@ -102,7 +102,7 @@ function MatePad:parse_log(size)
|
||||||
-- Then extract and print oldbalance, newbalance, parameter and method.
|
-- Then extract and print oldbalance, newbalance, parameter and method.
|
||||||
-- Depending on method, print either reason or item_name. If any extraction
|
-- Depending on method, print either reason or item_name. If any extraction
|
||||||
-- fails we fail with exit code 1.
|
-- fails we fail with exit code 1.
|
||||||
-- Note: we allow quoted quotation marks in "reason".
|
-- Note: we allow escaped quotation marks in "reason" and "item_name".
|
||||||
pipe = io.popen(string.format([=[
|
pipe = io.popen(string.format([=[
|
||||||
curl %s --header "Accept: application/json" "%s/api/user/%s/log?type=json" | \
|
curl %s --header "Accept: application/json" "%s/api/user/%s/log?type=json" | \
|
||||||
sed -n --sandbox '
|
sed -n --sandbox '
|
||||||
|
@ -135,7 +135,7 @@ sed -n '
|
||||||
b
|
b
|
||||||
}
|
}
|
||||||
g
|
g
|
||||||
s/.*"item_name" *: *\(null\|"\([^"]*\)"\).*/\2/p
|
s/.*"item_name" *: *\(null\|"\(\([^"]\|\\"\)*[^\\]\)"\).*/\2/p
|
||||||
T fail
|
T fail
|
||||||
b
|
b
|
||||||
:fail
|
:fail
|
||||||
|
|
Loading…
Reference in a new issue