Skip to content

Commit

Permalink
SWDEV-362165 - Escape argument strings in the JSON file
Browse files Browse the repository at this point in the history
"a_string\x000" -> \"a_string\\x000\"

Change-Id: I8bf054702b34577f84080080d9538b16abc996fe
(cherry picked from commit 1f2723d85638aacf4c355e955d096909b249db9c)
  • Loading branch information
lmoriche committed Oct 17, 2022
1 parent 5fd1c7e commit 8d448fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/tblextr.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ def fill_api_db(table_name, db, indir, api_name, api_pid, dep_pid, dep_list, dep

mfixformat = ptrn_fixformat.match(record)
if mfixformat: #replace '=' in args with parentheses
reformated_args = kernel_arg + mfixformat.group(2).replace('=','(').replace(',',')')+')'
reformated_args = kernel_arg + mfixformat.group(2).replace('=','(').replace(',',')') \
.replace('\\', "\\\\").replace('\"', "\\\"")+')'
record = mfixformat.group(1) + '( ' + reformated_args + ')'

m = ptrn_val.match(record)
Expand Down

0 comments on commit 8d448fe

Please sign in to comment.