Fossil SCM

Corrected missing commas in JSON-format diff builder output of Edit records.

stephan 2021-12-29 23:00 trunk
Commit 31be3836b74a54117143afb433b5eda6414d0c89b19e091c7826b1216927b94e
1 file changed +3
+3
--- src/diff.c
+++ src/diff.c
@@ -1143,10 +1143,13 @@
11431143
int i, x;
11441144
LineChange chng;
11451145
blob_append(p->pOut, "5,[", 3);
11461146
oneLineChange(pX, pY, &chng);
11471147
for(i=x=0; i<chng.n; i++){
1148
+ if(i>0){
1149
+ blob_append_char(p->pOut, ',');
1150
+ }
11481151
blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iStart1 - x);
11491152
x = chng.a[i].iStart1;
11501153
blob_append_char(p->pOut, ',');
11511154
blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1);
11521155
x += chng.a[i].iLen1;
11531156
--- src/diff.c
+++ src/diff.c
@@ -1143,10 +1143,13 @@
1143 int i, x;
1144 LineChange chng;
1145 blob_append(p->pOut, "5,[", 3);
1146 oneLineChange(pX, pY, &chng);
1147 for(i=x=0; i<chng.n; i++){
 
 
 
1148 blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iStart1 - x);
1149 x = chng.a[i].iStart1;
1150 blob_append_char(p->pOut, ',');
1151 blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1);
1152 x += chng.a[i].iLen1;
1153
--- src/diff.c
+++ src/diff.c
@@ -1143,10 +1143,13 @@
1143 int i, x;
1144 LineChange chng;
1145 blob_append(p->pOut, "5,[", 3);
1146 oneLineChange(pX, pY, &chng);
1147 for(i=x=0; i<chng.n; i++){
1148 if(i>0){
1149 blob_append_char(p->pOut, ',');
1150 }
1151 blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iStart1 - x);
1152 x = chng.a[i].iStart1;
1153 blob_append_char(p->pOut, ',');
1154 blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1);
1155 x += chng.a[i].iLen1;
1156

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button