Fossil SCM

Fix the unified diff output so that it conforms with established conventions.

drh 2019-02-05 15:49 trunk
Commit 7fd2a3652ea7368abd40d5c9af07b0e56feb9091bd7c3380e3f28a7773a6b191
1 file changed +2 -2
+2 -2
--- src/diff.c
+++ src/diff.c
@@ -440,12 +440,12 @@
440440
* If the patch changes an empty file or results in an empty file,
441441
* the block header must use 0,0 as position indicator and not 1,0.
442442
* Otherwise, patch would be confused and may reject the diff.
443443
*/
444444
blob_appendf(pOut,"@@ -%d,%d +%d,%d @@",
445
- na ? a+skip+1 : 0, na,
446
- nb ? b+skip+1 : 0, nb);
445
+ na ? a+skip+1 : a+skip, na,
446
+ nb ? b+skip+1 : b+skip, nb);
447447
if( html ) blob_appendf(pOut, "</span>");
448448
blob_append(pOut, "\n", 1);
449449
}
450450
451451
/* Show the initial common area */
452452
--- src/diff.c
+++ src/diff.c
@@ -440,12 +440,12 @@
440 * If the patch changes an empty file or results in an empty file,
441 * the block header must use 0,0 as position indicator and not 1,0.
442 * Otherwise, patch would be confused and may reject the diff.
443 */
444 blob_appendf(pOut,"@@ -%d,%d +%d,%d @@",
445 na ? a+skip+1 : 0, na,
446 nb ? b+skip+1 : 0, nb);
447 if( html ) blob_appendf(pOut, "</span>");
448 blob_append(pOut, "\n", 1);
449 }
450
451 /* Show the initial common area */
452
--- src/diff.c
+++ src/diff.c
@@ -440,12 +440,12 @@
440 * If the patch changes an empty file or results in an empty file,
441 * the block header must use 0,0 as position indicator and not 1,0.
442 * Otherwise, patch would be confused and may reject the diff.
443 */
444 blob_appendf(pOut,"@@ -%d,%d +%d,%d @@",
445 na ? a+skip+1 : a+skip, na,
446 nb ? b+skip+1 : b+skip, nb);
447 if( html ) blob_appendf(pOut, "</span>");
448 blob_append(pOut, "\n", 1);
449 }
450
451 /* Show the initial common area */
452

Keyboard Shortcuts

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