Fossil SCM

Replaced a standalone "diffFlags" variable in the /fdiff handler with use of the new DiffConfig.diffFlags member. No functional change, just a code cleanup found while working on another branch. Making it on trunk to keep that branch's diffs minimal.

wyoung 2023-01-24 03:18 trunk
Commit 65d97f23f617a4c77db561a75b2b9e932a3aece290954eb9b1e92399f779301e
1 file changed +2 -3
+2 -3
--- src/info.c
+++ src/info.c
@@ -1722,17 +1722,17 @@
17221722
int diffType; /* 0: none, 1: unified, 2: side-by-side */
17231723
char *zV1;
17241724
char *zV2;
17251725
const char *zRe;
17261726
ReCompiled *pRe = 0;
1727
- u64 diffFlags;
17281727
u32 objdescFlags = 0;
17291728
int verbose = PB("verbose");
17301729
DiffConfig DCfg;
17311730
17321731
login_check_credentials();
17331732
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1733
+ diff_config_init(&DCfg, 0);
17341734
diffType = preferred_diff_type();
17351735
if( P("from") && P("to") ){
17361736
v1 = artifact_from_ci_and_filename("from");
17371737
v2 = artifact_from_ci_and_filename("to");
17381738
}else{
@@ -1775,14 +1775,13 @@
17751775
if( isPatch ){
17761776
Blob c1, c2, *pOut;
17771777
DiffConfig DCfg;
17781778
pOut = cgi_output_blob();
17791779
cgi_set_content_type("text/plain");
1780
- diffFlags = DIFF_VERBOSE;
1780
+ DCfg.diffFlags = DIFF_VERBOSE;
17811781
content_get(v1, &c1);
17821782
content_get(v2, &c2);
1783
- diff_config_init(&DCfg, diffFlags);
17841783
DCfg.pRe = pRe;
17851784
text_diff(&c1, &c2, pOut, &DCfg);
17861785
blob_reset(&c1);
17871786
blob_reset(&c2);
17881787
return;
17891788
--- src/info.c
+++ src/info.c
@@ -1722,17 +1722,17 @@
1722 int diffType; /* 0: none, 1: unified, 2: side-by-side */
1723 char *zV1;
1724 char *zV2;
1725 const char *zRe;
1726 ReCompiled *pRe = 0;
1727 u64 diffFlags;
1728 u32 objdescFlags = 0;
1729 int verbose = PB("verbose");
1730 DiffConfig DCfg;
1731
1732 login_check_credentials();
1733 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
1734 diffType = preferred_diff_type();
1735 if( P("from") && P("to") ){
1736 v1 = artifact_from_ci_and_filename("from");
1737 v2 = artifact_from_ci_and_filename("to");
1738 }else{
@@ -1775,14 +1775,13 @@
1775 if( isPatch ){
1776 Blob c1, c2, *pOut;
1777 DiffConfig DCfg;
1778 pOut = cgi_output_blob();
1779 cgi_set_content_type("text/plain");
1780 diffFlags = DIFF_VERBOSE;
1781 content_get(v1, &c1);
1782 content_get(v2, &c2);
1783 diff_config_init(&DCfg, diffFlags);
1784 DCfg.pRe = pRe;
1785 text_diff(&c1, &c2, pOut, &DCfg);
1786 blob_reset(&c1);
1787 blob_reset(&c2);
1788 return;
1789
--- src/info.c
+++ src/info.c
@@ -1722,17 +1722,17 @@
1722 int diffType; /* 0: none, 1: unified, 2: side-by-side */
1723 char *zV1;
1724 char *zV2;
1725 const char *zRe;
1726 ReCompiled *pRe = 0;
 
1727 u32 objdescFlags = 0;
1728 int verbose = PB("verbose");
1729 DiffConfig DCfg;
1730
1731 login_check_credentials();
1732 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1733 diff_config_init(&DCfg, 0);
1734 diffType = preferred_diff_type();
1735 if( P("from") && P("to") ){
1736 v1 = artifact_from_ci_and_filename("from");
1737 v2 = artifact_from_ci_and_filename("to");
1738 }else{
@@ -1775,14 +1775,13 @@
1775 if( isPatch ){
1776 Blob c1, c2, *pOut;
1777 DiffConfig DCfg;
1778 pOut = cgi_output_blob();
1779 cgi_set_content_type("text/plain");
1780 DCfg.diffFlags = DIFF_VERBOSE;
1781 content_get(v1, &c1);
1782 content_get(v2, &c2);
 
1783 DCfg.pRe = pRe;
1784 text_diff(&c1, &c2, pOut, &DCfg);
1785 blob_reset(&c1);
1786 blob_reset(&c2);
1787 return;
1788

Keyboard Shortcuts

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