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.
Commit
65d97f23f617a4c77db561a75b2b9e932a3aece290954eb9b1e92399f779301e
Parent
a80f27485a0aab5…
1 file changed
+2
-3
+2
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1722,17 +1722,17 @@ | ||
| 1722 | 1722 | int diffType; /* 0: none, 1: unified, 2: side-by-side */ |
| 1723 | 1723 | char *zV1; |
| 1724 | 1724 | char *zV2; |
| 1725 | 1725 | const char *zRe; |
| 1726 | 1726 | ReCompiled *pRe = 0; |
| 1727 | - u64 diffFlags; | |
| 1728 | 1727 | u32 objdescFlags = 0; |
| 1729 | 1728 | int verbose = PB("verbose"); |
| 1730 | 1729 | DiffConfig DCfg; |
| 1731 | 1730 | |
| 1732 | 1731 | login_check_credentials(); |
| 1733 | 1732 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1733 | + diff_config_init(&DCfg, 0); | |
| 1734 | 1734 | diffType = preferred_diff_type(); |
| 1735 | 1735 | if( P("from") && P("to") ){ |
| 1736 | 1736 | v1 = artifact_from_ci_and_filename("from"); |
| 1737 | 1737 | v2 = artifact_from_ci_and_filename("to"); |
| 1738 | 1738 | }else{ |
| @@ -1775,14 +1775,13 @@ | ||
| 1775 | 1775 | if( isPatch ){ |
| 1776 | 1776 | Blob c1, c2, *pOut; |
| 1777 | 1777 | DiffConfig DCfg; |
| 1778 | 1778 | pOut = cgi_output_blob(); |
| 1779 | 1779 | cgi_set_content_type("text/plain"); |
| 1780 | - diffFlags = DIFF_VERBOSE; | |
| 1780 | + DCfg.diffFlags = DIFF_VERBOSE; | |
| 1781 | 1781 | content_get(v1, &c1); |
| 1782 | 1782 | content_get(v2, &c2); |
| 1783 | - diff_config_init(&DCfg, diffFlags); | |
| 1784 | 1783 | DCfg.pRe = pRe; |
| 1785 | 1784 | text_diff(&c1, &c2, pOut, &DCfg); |
| 1786 | 1785 | blob_reset(&c1); |
| 1787 | 1786 | blob_reset(&c2); |
| 1788 | 1787 | return; |
| 1789 | 1788 |
| --- 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 |