Fossil SCM

Unified diff now produces empty output when the diff is empty, insead of an empty wrapper element.

stephan 2020-05-05 21:41 fileedit-ajaxify
Commit 146e867eb5830e4e4df18cd3b22011d8e216b5fe61b08ab83889301af2c5643c
1 file changed +1 -1
+1 -1
--- src/fileedit.c
+++ src/fileedit.c
@@ -982,11 +982,11 @@
982982
Blob out = empty_blob;
983983
u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR
984984
| (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO);
985985
content_get(frid, &orig);
986986
text_diff(&orig, pContent, &out, 0, diffFlags);
987
- if(isSbs){
987
+ if(isSbs || blob_size(&out)==0){
988988
CX("%b",&out);
989989
}else{
990990
CX("<pre class='udiff'>%b</pre>",&out);
991991
}
992992
blob_reset(&orig);
993993
--- src/fileedit.c
+++ src/fileedit.c
@@ -982,11 +982,11 @@
982 Blob out = empty_blob;
983 u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR
984 | (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO);
985 content_get(frid, &orig);
986 text_diff(&orig, pContent, &out, 0, diffFlags);
987 if(isSbs){
988 CX("%b",&out);
989 }else{
990 CX("<pre class='udiff'>%b</pre>",&out);
991 }
992 blob_reset(&orig);
993
--- src/fileedit.c
+++ src/fileedit.c
@@ -982,11 +982,11 @@
982 Blob out = empty_blob;
983 u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR
984 | (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO);
985 content_get(frid, &orig);
986 text_diff(&orig, pContent, &out, 0, diffFlags);
987 if(isSbs || blob_size(&out)==0){
988 CX("%b",&out);
989 }else{
990 CX("<pre class='udiff'>%b</pre>",&out);
991 }
992 blob_reset(&orig);
993

Keyboard Shortcuts

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