Fossil SCM
/json/diff now handles the no-diff case more gracefully.
Commit
efbecda47076d88a8daa1eae95ddb1caaafc8f46
Parent
3be264b57fc46fb…
1 file changed
+3
-2
+3
-2
| --- src/json_diff.c | ||
| +++ src/json_diff.c | ||
| @@ -58,12 +58,13 @@ | ||
| 58 | 58 | blob_zero(&out); |
| 59 | 59 | text_diff(&from, &to, &out, flags); |
| 60 | 60 | blob_reset(&from); |
| 61 | 61 | blob_reset(&to); |
| 62 | 62 | outLen = blob_size(&out); |
| 63 | - if(outLen>0){ | |
| 64 | - rc = cson_value_new_string(blob_buffer(&out), blob_size(&out)); | |
| 63 | + if(outLen>=0){ | |
| 64 | + rc = cson_value_new_string(blob_buffer(&out), | |
| 65 | + (unsigned int)blob_size(&out)); | |
| 65 | 66 | } |
| 66 | 67 | blob_reset(&out); |
| 67 | 68 | return rc; |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -58,12 +58,13 @@ | |
| 58 | blob_zero(&out); |
| 59 | text_diff(&from, &to, &out, flags); |
| 60 | blob_reset(&from); |
| 61 | blob_reset(&to); |
| 62 | outLen = blob_size(&out); |
| 63 | if(outLen>0){ |
| 64 | rc = cson_value_new_string(blob_buffer(&out), blob_size(&out)); |
| 65 | } |
| 66 | blob_reset(&out); |
| 67 | return rc; |
| 68 | } |
| 69 | |
| 70 |
| --- src/json_diff.c | |
| +++ src/json_diff.c | |
| @@ -58,12 +58,13 @@ | |
| 58 | blob_zero(&out); |
| 59 | text_diff(&from, &to, &out, flags); |
| 60 | blob_reset(&from); |
| 61 | blob_reset(&to); |
| 62 | outLen = blob_size(&out); |
| 63 | if(outLen>=0){ |
| 64 | rc = cson_value_new_string(blob_buffer(&out), |
| 65 | (unsigned int)blob_size(&out)); |
| 66 | } |
| 67 | blob_reset(&out); |
| 68 | return rc; |
| 69 | } |
| 70 | |
| 71 |