Fossil SCM

Do not show blank changes when doing a diff.

drh 2011-02-04 03:21 trunk
Commit d5729c31b55eaeb7a7e2bea6627f28e071a81049
1 file changed +4 -2
+4 -2
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -66,12 +66,14 @@
6666
}
6767
6868
/* Compute and output the differences */
6969
blob_zero(&out);
7070
text_diff(pFile1, &file2, &out, 5, ignoreEolWs);
71
- printf("--- %s\n+++ %s\n", zName, zName2);
72
- printf("%s\n", blob_str(&out));
71
+ if( blob_size(&out) ){
72
+ printf("--- %s\n+++ %s\n", zName, zName2);
73
+ printf("%s\n", blob_str(&out));
74
+ }
7375
7476
/* Release memory resources */
7577
blob_reset(&file2);
7678
blob_reset(&out);
7779
}else{
7880
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -66,12 +66,14 @@
66 }
67
68 /* Compute and output the differences */
69 blob_zero(&out);
70 text_diff(pFile1, &file2, &out, 5, ignoreEolWs);
71 printf("--- %s\n+++ %s\n", zName, zName2);
72 printf("%s\n", blob_str(&out));
 
 
73
74 /* Release memory resources */
75 blob_reset(&file2);
76 blob_reset(&out);
77 }else{
78
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -66,12 +66,14 @@
66 }
67
68 /* Compute and output the differences */
69 blob_zero(&out);
70 text_diff(pFile1, &file2, &out, 5, ignoreEolWs);
71 if( blob_size(&out) ){
72 printf("--- %s\n+++ %s\n", zName, zName2);
73 printf("%s\n", blob_str(&out));
74 }
75
76 /* Release memory resources */
77 blob_reset(&file2);
78 blob_reset(&out);
79 }else{
80

Keyboard Shortcuts

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