summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-05 17:06:40 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-05 17:06:40 -0400
commita4c8aba49663e983493c89db8bdc931762200101 (patch)
treec9daf19e1bc49d0e6e783c272dc57baa1bbc25f3 /devtools
parent29490bea97ad271b842c235eefa99e8dd43ad854 (diff)
downloadgpsd-a4c8aba49663e983493c89db8bdc931762200101.tar.gz
Fixes to generation of JSON dump code for arrays.
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/tablegen.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/devtools/tablegen.py b/devtools/tablegen.py
index 7ff78c2d..10251620 100755
--- a/devtools/tablegen.py
+++ b/devtools/tablegen.py
@@ -283,7 +283,7 @@ def make_json_dumper(wfp):
if not inarray:
endit = '}",\n'
elif tuples[i+1][1] == None:
- endit = r',\"%s\":['
+ endit = r',\"%s\":[",'
elif scaled(i) != scaled(i+1):
endit = ',",'
else:
@@ -335,8 +335,8 @@ def make_json_dumper(wfp):
base = " " * 8
print >>wfp, base + "}"
print >>wfp, base + "if (buf[strlen(buf) - 1] == ',')"
- print >>wfp, base + step + "buf[strlen(buf)-1] = '\0';"
- print >>wfp, base + "(void)strlcat(buf, ']}\r\n', buflen - strlen(buf));"
+ print >>wfp, base + step + r"buf[strlen(buf)-1] = '\0';"
+ print >>wfp, base + "(void)strlcat(buf, \"]}\", buflen - strlen(buf));"
def make_json_generator(wfp):
# Write a stanza for jsongen.py.in describing how to generate a