Fossil SCM
Merge trunk into small-fixes.
Commit
c432a911d15249b7e7f329a19592939c1e29abddc8b4f12556b071cfc28893a2
Parent
256a070d8cab5e4…
29 files changed
+2
-2
+6
-4
+1
-1
+1
-1
+1
-1
+2
-2
+3
-3
+2
-2
+1
-1
+2
-2
+6
-2
+6
-2
+9
-2
+9
-2
+15
-7
+3
-3
+3
-3
+1
-1
+1
-1
+39
-3
+6
+12
-4
+2
-2
+3
-3
+3
-3
+3
-3
+11
-1
+41
-12
+2
-2
~
src/alerts.c
~
src/blob.c
~
src/branch.c
~
src/cgi.c
~
src/cgi.c
~
src/configure.c
~
src/content.c
~
src/db.c
~
src/diff.c
~
src/dispatch.c
~
src/export.c
~
src/export.c
~
src/file.c
~
src/file.c
~
src/forum.c
~
src/main.c
~
src/main.c
~
src/name.c
~
src/name.c
~
src/sha1hard.c
~
src/stash.c
~
src/stat.c
~
src/tag.c
~
src/tar.c
~
src/timeline.c
~
src/timeline.c
~
src/utf8.c
~
src/wiki.c
~
src/zip.c
+2
-2
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -1831,11 +1831,11 @@ | ||
| 1831 | 1831 | ** The subscriber is identified in several ways: |
| 1832 | 1832 | ** |
| 1833 | 1833 | ** * The name= query parameter contains the complete subscriberCode. |
| 1834 | 1834 | ** This only happens when the user receives a verification |
| 1835 | 1835 | ** email and clicks on the link in the email. When a |
| 1836 | -** compilete subscriberCode is seen on the name= query parameter, | |
| 1836 | +** complete subscriberCode is seen on the name= query parameter, | |
| 1837 | 1837 | ** that constitutes verification of the email address. |
| 1838 | 1838 | ** |
| 1839 | 1839 | ** * The sid= query parameter contains an integer subscriberId. |
| 1840 | 1840 | ** This only works for the administrator. It allows the |
| 1841 | 1841 | ** administrator to edit any subscription. |
| @@ -2266,11 +2266,11 @@ | ||
| 2266 | 2266 | ** |
| 2267 | 2267 | ** Non-logged-in users with no name= query parameter are invited to enter |
| 2268 | 2268 | ** an email address to which will be sent the unsubscribe link that |
| 2269 | 2269 | ** contains the correct subscriber code. |
| 2270 | 2270 | ** |
| 2271 | -** The /unsubscribe page requires comfirmation. The /oneclickunsub | |
| 2271 | +** The /unsubscribe page requires confirmation. The /oneclickunsub | |
| 2272 | 2272 | ** page unsubscribes immediately without any need to confirm. |
| 2273 | 2273 | */ |
| 2274 | 2274 | void unsubscribe_page(void){ |
| 2275 | 2275 | const char *zName = P("name"); |
| 2276 | 2276 | char *zErr = 0; |
| 2277 | 2277 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1831,11 +1831,11 @@ | |
| 1831 | ** The subscriber is identified in several ways: |
| 1832 | ** |
| 1833 | ** * The name= query parameter contains the complete subscriberCode. |
| 1834 | ** This only happens when the user receives a verification |
| 1835 | ** email and clicks on the link in the email. When a |
| 1836 | ** compilete subscriberCode is seen on the name= query parameter, |
| 1837 | ** that constitutes verification of the email address. |
| 1838 | ** |
| 1839 | ** * The sid= query parameter contains an integer subscriberId. |
| 1840 | ** This only works for the administrator. It allows the |
| 1841 | ** administrator to edit any subscription. |
| @@ -2266,11 +2266,11 @@ | |
| 2266 | ** |
| 2267 | ** Non-logged-in users with no name= query parameter are invited to enter |
| 2268 | ** an email address to which will be sent the unsubscribe link that |
| 2269 | ** contains the correct subscriber code. |
| 2270 | ** |
| 2271 | ** The /unsubscribe page requires comfirmation. The /oneclickunsub |
| 2272 | ** page unsubscribes immediately without any need to confirm. |
| 2273 | */ |
| 2274 | void unsubscribe_page(void){ |
| 2275 | const char *zName = P("name"); |
| 2276 | char *zErr = 0; |
| 2277 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1831,11 +1831,11 @@ | |
| 1831 | ** The subscriber is identified in several ways: |
| 1832 | ** |
| 1833 | ** * The name= query parameter contains the complete subscriberCode. |
| 1834 | ** This only happens when the user receives a verification |
| 1835 | ** email and clicks on the link in the email. When a |
| 1836 | ** complete subscriberCode is seen on the name= query parameter, |
| 1837 | ** that constitutes verification of the email address. |
| 1838 | ** |
| 1839 | ** * The sid= query parameter contains an integer subscriberId. |
| 1840 | ** This only works for the administrator. It allows the |
| 1841 | ** administrator to edit any subscription. |
| @@ -2266,11 +2266,11 @@ | |
| 2266 | ** |
| 2267 | ** Non-logged-in users with no name= query parameter are invited to enter |
| 2268 | ** an email address to which will be sent the unsubscribe link that |
| 2269 | ** contains the correct subscriber code. |
| 2270 | ** |
| 2271 | ** The /unsubscribe page requires confirmation. The /oneclickunsub |
| 2272 | ** page unsubscribes immediately without any need to confirm. |
| 2273 | */ |
| 2274 | void unsubscribe_page(void){ |
| 2275 | const char *zName = P("name"); |
| 2276 | char *zErr = 0; |
| 2277 |
+6
-4
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -872,15 +872,15 @@ | ||
| 872 | 872 | char *aData = pFrom->aData; |
| 873 | 873 | int n = pFrom->nUsed; |
| 874 | 874 | int i = pFrom->iCursor; |
| 875 | 875 | while( i<n && fossil_isspace(aData[i]) ){ i++; } |
| 876 | 876 | pFrom->iCursor = i; |
| 877 | - if( aData[i]=='\'' ){ | |
| 877 | + if( i<n && aData[i]=='\'' ){ | |
| 878 | 878 | i++; |
| 879 | 879 | while( i<n ){ |
| 880 | 880 | if( aData[i]=='\'' ){ |
| 881 | - if( aData[++i]!='\'' ) break; | |
| 881 | + if( ++i>=n || aData[i]!='\'' ) break; | |
| 882 | 882 | } |
| 883 | 883 | i++; |
| 884 | 884 | } |
| 885 | 885 | }else{ |
| 886 | 886 | while( i<n && !fossil_isspace(aData[i]) ){ i++; } |
| @@ -1488,10 +1488,12 @@ | ||
| 1488 | 1488 | /* |
| 1489 | 1489 | ** Uncompress blob pIn and store the result in pOut. It is ok for pIn and |
| 1490 | 1490 | ** pOut to be the same blob. |
| 1491 | 1491 | ** |
| 1492 | 1492 | ** pOut must be either uninitialized or the same as pIn. |
| 1493 | +** | |
| 1494 | +** Return the number of errors encountered, which means return 0 on success. | |
| 1493 | 1495 | */ |
| 1494 | 1496 | int blob_uncompress(Blob *pIn, Blob *pOut){ |
| 1495 | 1497 | unsigned int nOut; |
| 1496 | 1498 | unsigned char *inBuf; |
| 1497 | 1499 | unsigned int nIn = blob_size(pIn); |
| @@ -1502,11 +1504,11 @@ | ||
| 1502 | 1504 | return 0; |
| 1503 | 1505 | } |
| 1504 | 1506 | inBuf = (unsigned char*)blob_buffer(pIn); |
| 1505 | 1507 | nOut = (inBuf[0]<<24) + (inBuf[1]<<16) + (inBuf[2]<<8) + inBuf[3]; |
| 1506 | 1508 | blob_zero(&temp); |
| 1507 | - blob_resize(&temp, nOut+1); | |
| 1509 | + blob_resize(&temp, (u64)nOut+1); | |
| 1508 | 1510 | nOut2 = (long int)nOut; |
| 1509 | 1511 | rc = uncompress((unsigned char*)blob_buffer(&temp), &nOut2, |
| 1510 | 1512 | &inBuf[4], nIn - 4); |
| 1511 | 1513 | if( rc!=Z_OK ){ |
| 1512 | 1514 | blob_reset(&temp); |
| @@ -1855,11 +1857,11 @@ | ||
| 1855 | 1857 | ** --hex HEX Skip the --hex flag and instead decode HEX |
| 1856 | 1858 | ** into ascii. This provides a way to insert |
| 1857 | 1859 | ** unusual characters as an argument for testing. |
| 1858 | 1860 | ** |
| 1859 | 1861 | ** --compare HEX ASCII Verify that argument ASCII is identical to |
| 1860 | -** to decoded HEX. | |
| 1862 | +** decoded HEX. | |
| 1861 | 1863 | ** |
| 1862 | 1864 | ** --fuzz N Run N fuzz cases. Each case is a call |
| 1863 | 1865 | ** to "fossil test-escaped-arg --compare HEX ARG" |
| 1864 | 1866 | ** where HEX and ARG are the same argument. |
| 1865 | 1867 | ** The argument is chosen at random. |
| 1866 | 1868 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -872,15 +872,15 @@ | |
| 872 | char *aData = pFrom->aData; |
| 873 | int n = pFrom->nUsed; |
| 874 | int i = pFrom->iCursor; |
| 875 | while( i<n && fossil_isspace(aData[i]) ){ i++; } |
| 876 | pFrom->iCursor = i; |
| 877 | if( aData[i]=='\'' ){ |
| 878 | i++; |
| 879 | while( i<n ){ |
| 880 | if( aData[i]=='\'' ){ |
| 881 | if( aData[++i]!='\'' ) break; |
| 882 | } |
| 883 | i++; |
| 884 | } |
| 885 | }else{ |
| 886 | while( i<n && !fossil_isspace(aData[i]) ){ i++; } |
| @@ -1488,10 +1488,12 @@ | |
| 1488 | /* |
| 1489 | ** Uncompress blob pIn and store the result in pOut. It is ok for pIn and |
| 1490 | ** pOut to be the same blob. |
| 1491 | ** |
| 1492 | ** pOut must be either uninitialized or the same as pIn. |
| 1493 | */ |
| 1494 | int blob_uncompress(Blob *pIn, Blob *pOut){ |
| 1495 | unsigned int nOut; |
| 1496 | unsigned char *inBuf; |
| 1497 | unsigned int nIn = blob_size(pIn); |
| @@ -1502,11 +1504,11 @@ | |
| 1502 | return 0; |
| 1503 | } |
| 1504 | inBuf = (unsigned char*)blob_buffer(pIn); |
| 1505 | nOut = (inBuf[0]<<24) + (inBuf[1]<<16) + (inBuf[2]<<8) + inBuf[3]; |
| 1506 | blob_zero(&temp); |
| 1507 | blob_resize(&temp, nOut+1); |
| 1508 | nOut2 = (long int)nOut; |
| 1509 | rc = uncompress((unsigned char*)blob_buffer(&temp), &nOut2, |
| 1510 | &inBuf[4], nIn - 4); |
| 1511 | if( rc!=Z_OK ){ |
| 1512 | blob_reset(&temp); |
| @@ -1855,11 +1857,11 @@ | |
| 1855 | ** --hex HEX Skip the --hex flag and instead decode HEX |
| 1856 | ** into ascii. This provides a way to insert |
| 1857 | ** unusual characters as an argument for testing. |
| 1858 | ** |
| 1859 | ** --compare HEX ASCII Verify that argument ASCII is identical to |
| 1860 | ** to decoded HEX. |
| 1861 | ** |
| 1862 | ** --fuzz N Run N fuzz cases. Each case is a call |
| 1863 | ** to "fossil test-escaped-arg --compare HEX ARG" |
| 1864 | ** where HEX and ARG are the same argument. |
| 1865 | ** The argument is chosen at random. |
| 1866 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -872,15 +872,15 @@ | |
| 872 | char *aData = pFrom->aData; |
| 873 | int n = pFrom->nUsed; |
| 874 | int i = pFrom->iCursor; |
| 875 | while( i<n && fossil_isspace(aData[i]) ){ i++; } |
| 876 | pFrom->iCursor = i; |
| 877 | if( i<n && aData[i]=='\'' ){ |
| 878 | i++; |
| 879 | while( i<n ){ |
| 880 | if( aData[i]=='\'' ){ |
| 881 | if( ++i>=n || aData[i]!='\'' ) break; |
| 882 | } |
| 883 | i++; |
| 884 | } |
| 885 | }else{ |
| 886 | while( i<n && !fossil_isspace(aData[i]) ){ i++; } |
| @@ -1488,10 +1488,12 @@ | |
| 1488 | /* |
| 1489 | ** Uncompress blob pIn and store the result in pOut. It is ok for pIn and |
| 1490 | ** pOut to be the same blob. |
| 1491 | ** |
| 1492 | ** pOut must be either uninitialized or the same as pIn. |
| 1493 | ** |
| 1494 | ** Return the number of errors encountered, which means return 0 on success. |
| 1495 | */ |
| 1496 | int blob_uncompress(Blob *pIn, Blob *pOut){ |
| 1497 | unsigned int nOut; |
| 1498 | unsigned char *inBuf; |
| 1499 | unsigned int nIn = blob_size(pIn); |
| @@ -1502,11 +1504,11 @@ | |
| 1504 | return 0; |
| 1505 | } |
| 1506 | inBuf = (unsigned char*)blob_buffer(pIn); |
| 1507 | nOut = (inBuf[0]<<24) + (inBuf[1]<<16) + (inBuf[2]<<8) + inBuf[3]; |
| 1508 | blob_zero(&temp); |
| 1509 | blob_resize(&temp, (u64)nOut+1); |
| 1510 | nOut2 = (long int)nOut; |
| 1511 | rc = uncompress((unsigned char*)blob_buffer(&temp), &nOut2, |
| 1512 | &inBuf[4], nIn - 4); |
| 1513 | if( rc!=Z_OK ){ |
| 1514 | blob_reset(&temp); |
| @@ -1855,11 +1857,11 @@ | |
| 1857 | ** --hex HEX Skip the --hex flag and instead decode HEX |
| 1858 | ** into ascii. This provides a way to insert |
| 1859 | ** unusual characters as an argument for testing. |
| 1860 | ** |
| 1861 | ** --compare HEX ASCII Verify that argument ASCII is identical to |
| 1862 | ** decoded HEX. |
| 1863 | ** |
| 1864 | ** --fuzz N Run N fuzz cases. Each case is a call |
| 1865 | ** to "fossil test-escaped-arg --compare HEX ARG" |
| 1866 | ** where HEX and ARG are the same argument. |
| 1867 | ** The argument is chosen at random. |
| 1868 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -629,11 +629,11 @@ | ||
| 629 | 629 | ** Print the name of the branch for the current check-out |
| 630 | 630 | ** |
| 631 | 631 | ** > fossil branch hide|unhide ?OPTIONS? BRANCH-NAME ?...BRANCH-NAMES? |
| 632 | 632 | ** |
| 633 | 633 | ** Adds or cancels the "hidden" tag for the specified branches or |
| 634 | -** or check-in IDs. Accepts the same options as the close | |
| 634 | +** check-in IDs. Accepts the same options as the close | |
| 635 | 635 | ** subcommand. |
| 636 | 636 | ** |
| 637 | 637 | ** > fossil branch info BRANCH-NAME |
| 638 | 638 | ** |
| 639 | 639 | ** Print information about a branch |
| 640 | 640 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -629,11 +629,11 @@ | |
| 629 | ** Print the name of the branch for the current check-out |
| 630 | ** |
| 631 | ** > fossil branch hide|unhide ?OPTIONS? BRANCH-NAME ?...BRANCH-NAMES? |
| 632 | ** |
| 633 | ** Adds or cancels the "hidden" tag for the specified branches or |
| 634 | ** or check-in IDs. Accepts the same options as the close |
| 635 | ** subcommand. |
| 636 | ** |
| 637 | ** > fossil branch info BRANCH-NAME |
| 638 | ** |
| 639 | ** Print information about a branch |
| 640 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -629,11 +629,11 @@ | |
| 629 | ** Print the name of the branch for the current check-out |
| 630 | ** |
| 631 | ** > fossil branch hide|unhide ?OPTIONS? BRANCH-NAME ?...BRANCH-NAMES? |
| 632 | ** |
| 633 | ** Adds or cancels the "hidden" tag for the specified branches or |
| 634 | ** check-in IDs. Accepts the same options as the close |
| 635 | ** subcommand. |
| 636 | ** |
| 637 | ** > fossil branch info BRANCH-NAME |
| 638 | ** |
| 639 | ** Print information about a branch |
| 640 |
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -733,11 +733,11 @@ | ||
| 733 | 733 | int rc; |
| 734 | 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | 735 | zRef = P("HTTP_REFERER"); |
| 736 | 736 | if( zRef==0 ) return 0; |
| 737 | 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | - zToFree = strdup(zRef); | |
| 738 | + zToFree = fossil_strdup(zRef); | |
| 739 | 739 | dehttpize(zToFree); |
| 740 | 740 | zRef = zToFree; |
| 741 | 741 | } |
| 742 | 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 | 744 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -733,11 +733,11 @@ | |
| 733 | int rc; |
| 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | zRef = P("HTTP_REFERER"); |
| 736 | if( zRef==0 ) return 0; |
| 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | zToFree = strdup(zRef); |
| 739 | dehttpize(zToFree); |
| 740 | zRef = zToFree; |
| 741 | } |
| 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -733,11 +733,11 @@ | |
| 733 | int rc; |
| 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | zRef = P("HTTP_REFERER"); |
| 736 | if( zRef==0 ) return 0; |
| 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | zToFree = fossil_strdup(zRef); |
| 739 | dehttpize(zToFree); |
| 740 | zRef = zToFree; |
| 741 | } |
| 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 |
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -733,11 +733,11 @@ | ||
| 733 | 733 | int rc; |
| 734 | 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | 735 | zRef = P("HTTP_REFERER"); |
| 736 | 736 | if( zRef==0 ) return 0; |
| 737 | 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | - zToFree = strdup(zRef); | |
| 738 | + zToFree = fossil_strdup(zRef); | |
| 739 | 739 | dehttpize(zToFree); |
| 740 | 740 | zRef = zToFree; |
| 741 | 741 | } |
| 742 | 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 | 744 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -733,11 +733,11 @@ | |
| 733 | int rc; |
| 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | zRef = P("HTTP_REFERER"); |
| 736 | if( zRef==0 ) return 0; |
| 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | zToFree = strdup(zRef); |
| 739 | dehttpize(zToFree); |
| 740 | zRef = zToFree; |
| 741 | } |
| 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -733,11 +733,11 @@ | |
| 733 | int rc; |
| 734 | if( g.zBaseURL==0 ) return 0; |
| 735 | zRef = P("HTTP_REFERER"); |
| 736 | if( zRef==0 ) return 0; |
| 737 | if( strchr(zRef,'%')!=0 ){ |
| 738 | zToFree = fossil_strdup(zRef); |
| 739 | dehttpize(zToFree); |
| 740 | zRef = zToFree; |
| 741 | } |
| 742 | nBase = (int)strlen(g.zBaseURL); |
| 743 | if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ){ |
| 744 |
+2
-2
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -986,11 +986,11 @@ | ||
| 986 | 986 | ** you are doing! The --unset option only works if there is a PATTERN. |
| 987 | 987 | ** Probably you should run the command once without --unset to make sure |
| 988 | 988 | ** you know exactly what is being deleted. |
| 989 | 989 | ** |
| 990 | 990 | ** If not in an open check-out, use the -R REPO option to specify a |
| 991 | -** a repository. | |
| 991 | +** repository. | |
| 992 | 992 | */ |
| 993 | 993 | void test_var_list_cmd(void){ |
| 994 | 994 | Stmt q; |
| 995 | 995 | int i, j; |
| 996 | 996 | const char *zPattern = 0; |
| @@ -1083,11 +1083,11 @@ | ||
| 1083 | 1083 | ** Write the text of the VAR variable into FILE. If FILE is "-" |
| 1084 | 1084 | ** or is omitted then output goes to standard output. VAR can be a |
| 1085 | 1085 | ** GLOB pattern. |
| 1086 | 1086 | ** |
| 1087 | 1087 | ** If not in an open check-out, use the -R REPO option to specify a |
| 1088 | -** a repository. | |
| 1088 | +** repository. | |
| 1089 | 1089 | */ |
| 1090 | 1090 | void test_var_get_cmd(void){ |
| 1091 | 1091 | const char *zVar; |
| 1092 | 1092 | const char *zFile; |
| 1093 | 1093 | int n; |
| 1094 | 1094 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -986,11 +986,11 @@ | |
| 986 | ** you are doing! The --unset option only works if there is a PATTERN. |
| 987 | ** Probably you should run the command once without --unset to make sure |
| 988 | ** you know exactly what is being deleted. |
| 989 | ** |
| 990 | ** If not in an open check-out, use the -R REPO option to specify a |
| 991 | ** a repository. |
| 992 | */ |
| 993 | void test_var_list_cmd(void){ |
| 994 | Stmt q; |
| 995 | int i, j; |
| 996 | const char *zPattern = 0; |
| @@ -1083,11 +1083,11 @@ | |
| 1083 | ** Write the text of the VAR variable into FILE. If FILE is "-" |
| 1084 | ** or is omitted then output goes to standard output. VAR can be a |
| 1085 | ** GLOB pattern. |
| 1086 | ** |
| 1087 | ** If not in an open check-out, use the -R REPO option to specify a |
| 1088 | ** a repository. |
| 1089 | */ |
| 1090 | void test_var_get_cmd(void){ |
| 1091 | const char *zVar; |
| 1092 | const char *zFile; |
| 1093 | int n; |
| 1094 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -986,11 +986,11 @@ | |
| 986 | ** you are doing! The --unset option only works if there is a PATTERN. |
| 987 | ** Probably you should run the command once without --unset to make sure |
| 988 | ** you know exactly what is being deleted. |
| 989 | ** |
| 990 | ** If not in an open check-out, use the -R REPO option to specify a |
| 991 | ** repository. |
| 992 | */ |
| 993 | void test_var_list_cmd(void){ |
| 994 | Stmt q; |
| 995 | int i, j; |
| 996 | const char *zPattern = 0; |
| @@ -1083,11 +1083,11 @@ | |
| 1083 | ** Write the text of the VAR variable into FILE. If FILE is "-" |
| 1084 | ** or is omitted then output goes to standard output. VAR can be a |
| 1085 | ** GLOB pattern. |
| 1086 | ** |
| 1087 | ** If not in an open check-out, use the -R REPO option to specify a |
| 1088 | ** repository. |
| 1089 | */ |
| 1090 | void test_var_get_cmd(void){ |
| 1091 | const char *zVar; |
| 1092 | const char *zFile; |
| 1093 | int n; |
| 1094 |
+3
-3
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -703,11 +703,11 @@ | ||
| 703 | 703 | /* |
| 704 | 704 | ** COMMAND: test-content-put |
| 705 | 705 | ** |
| 706 | 706 | ** Usage: %fossil test-content-put [OPTIONS] FILE ... |
| 707 | 707 | ** |
| 708 | -** Read the content of all FILE argments and add them to the Blob | |
| 708 | +** Read the content of all FILE arguments and add them to the Blob | |
| 709 | 709 | ** table as a new artifact using a direct call to content_put(). |
| 710 | 710 | ** |
| 711 | 711 | ** Options: |
| 712 | 712 | ** |
| 713 | 713 | ** --moderate Make corresponding entries to the MODREQ table |
| @@ -951,13 +951,13 @@ | ||
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | /* |
| 954 | 954 | ** COMMAND: test-content-deltify |
| 955 | 955 | ** |
| 956 | -** Usage: %fossil RID SRCID SRCID ... [-force] | |
| 956 | +** Usage: %fossil test-content-deltify [--force] RID SRCID SRCID... | |
| 957 | 957 | ** |
| 958 | -** Convert the content at RID into a delta one of the from SRCIDs. | |
| 958 | +** Convert the content at RID into a delta from one of the SRCIDs. | |
| 959 | 959 | */ |
| 960 | 960 | void test_content_deltify_cmd(void){ |
| 961 | 961 | int nSrc; |
| 962 | 962 | int *aSrc; |
| 963 | 963 | int i; |
| 964 | 964 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -703,11 +703,11 @@ | |
| 703 | /* |
| 704 | ** COMMAND: test-content-put |
| 705 | ** |
| 706 | ** Usage: %fossil test-content-put [OPTIONS] FILE ... |
| 707 | ** |
| 708 | ** Read the content of all FILE argments and add them to the Blob |
| 709 | ** table as a new artifact using a direct call to content_put(). |
| 710 | ** |
| 711 | ** Options: |
| 712 | ** |
| 713 | ** --moderate Make corresponding entries to the MODREQ table |
| @@ -951,13 +951,13 @@ | |
| 951 | } |
| 952 | |
| 953 | /* |
| 954 | ** COMMAND: test-content-deltify |
| 955 | ** |
| 956 | ** Usage: %fossil RID SRCID SRCID ... [-force] |
| 957 | ** |
| 958 | ** Convert the content at RID into a delta one of the from SRCIDs. |
| 959 | */ |
| 960 | void test_content_deltify_cmd(void){ |
| 961 | int nSrc; |
| 962 | int *aSrc; |
| 963 | int i; |
| 964 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -703,11 +703,11 @@ | |
| 703 | /* |
| 704 | ** COMMAND: test-content-put |
| 705 | ** |
| 706 | ** Usage: %fossil test-content-put [OPTIONS] FILE ... |
| 707 | ** |
| 708 | ** Read the content of all FILE arguments and add them to the Blob |
| 709 | ** table as a new artifact using a direct call to content_put(). |
| 710 | ** |
| 711 | ** Options: |
| 712 | ** |
| 713 | ** --moderate Make corresponding entries to the MODREQ table |
| @@ -951,13 +951,13 @@ | |
| 951 | } |
| 952 | |
| 953 | /* |
| 954 | ** COMMAND: test-content-deltify |
| 955 | ** |
| 956 | ** Usage: %fossil test-content-deltify [--force] RID SRCID SRCID... |
| 957 | ** |
| 958 | ** Convert the content at RID into a delta from one of the SRCIDs. |
| 959 | */ |
| 960 | void test_content_deltify_cmd(void){ |
| 961 | int nSrc; |
| 962 | int *aSrc; |
| 963 | int i; |
| 964 |
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1787,11 +1787,11 @@ | ||
| 1787 | 1787 | } |
| 1788 | 1788 | |
| 1789 | 1789 | /* |
| 1790 | 1790 | ** WEBPAGE: setseekey |
| 1791 | 1791 | ** |
| 1792 | -** Sets the sets the saved database encryption key to one that gets passed | |
| 1792 | +** Sets the saved database encryption key to one that gets passed | |
| 1793 | 1793 | ** via the "key" query string parameter. If the saved database encryption |
| 1794 | 1794 | ** key has already been set, does nothing. This web page does not produce |
| 1795 | 1795 | ** any output on success or failure. No permissions are required and none |
| 1796 | 1796 | ** are checked (partially due to lack of encrypted database access). |
| 1797 | 1797 | ** |
| @@ -4648,11 +4648,11 @@ | ||
| 4648 | 4648 | ** not a robot. Details depend on the value of the setting. |
| 4649 | 4649 | ** |
| 4650 | 4650 | ** (0) Off: No adjustments are made to the 'h' privilege based on |
| 4651 | 4651 | ** the user agent. |
| 4652 | 4652 | ** |
| 4653 | -** (1) UserAgent and Javascript: The the href= values of hyperlinks | |
| 4653 | +** (1) UserAgent and Javascript: The href= values of hyperlinks | |
| 4654 | 4654 | ** initially point to /honeypot and are changed to point to the |
| 4655 | 4655 | ** correct target by javascript that runs after the page loads. |
| 4656 | 4656 | ** The auto-hyperlink-delay and auto-hyperlink-mouseover settings |
| 4657 | 4657 | ** influence that javascript. |
| 4658 | 4658 | ** |
| 4659 | 4659 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1787,11 +1787,11 @@ | |
| 1787 | } |
| 1788 | |
| 1789 | /* |
| 1790 | ** WEBPAGE: setseekey |
| 1791 | ** |
| 1792 | ** Sets the sets the saved database encryption key to one that gets passed |
| 1793 | ** via the "key" query string parameter. If the saved database encryption |
| 1794 | ** key has already been set, does nothing. This web page does not produce |
| 1795 | ** any output on success or failure. No permissions are required and none |
| 1796 | ** are checked (partially due to lack of encrypted database access). |
| 1797 | ** |
| @@ -4648,11 +4648,11 @@ | |
| 4648 | ** not a robot. Details depend on the value of the setting. |
| 4649 | ** |
| 4650 | ** (0) Off: No adjustments are made to the 'h' privilege based on |
| 4651 | ** the user agent. |
| 4652 | ** |
| 4653 | ** (1) UserAgent and Javascript: The the href= values of hyperlinks |
| 4654 | ** initially point to /honeypot and are changed to point to the |
| 4655 | ** correct target by javascript that runs after the page loads. |
| 4656 | ** The auto-hyperlink-delay and auto-hyperlink-mouseover settings |
| 4657 | ** influence that javascript. |
| 4658 | ** |
| 4659 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1787,11 +1787,11 @@ | |
| 1787 | } |
| 1788 | |
| 1789 | /* |
| 1790 | ** WEBPAGE: setseekey |
| 1791 | ** |
| 1792 | ** Sets the saved database encryption key to one that gets passed |
| 1793 | ** via the "key" query string parameter. If the saved database encryption |
| 1794 | ** key has already been set, does nothing. This web page does not produce |
| 1795 | ** any output on success or failure. No permissions are required and none |
| 1796 | ** are checked (partially due to lack of encrypted database access). |
| 1797 | ** |
| @@ -4648,11 +4648,11 @@ | |
| 4648 | ** not a robot. Details depend on the value of the setting. |
| 4649 | ** |
| 4650 | ** (0) Off: No adjustments are made to the 'h' privilege based on |
| 4651 | ** the user agent. |
| 4652 | ** |
| 4653 | ** (1) UserAgent and Javascript: The href= values of hyperlinks |
| 4654 | ** initially point to /honeypot and are changed to point to the |
| 4655 | ** correct target by javascript that runs after the page loads. |
| 4656 | ** The auto-hyperlink-delay and auto-hyperlink-mouseover settings |
| 4657 | ** influence that javascript. |
| 4658 | ** |
| 4659 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -958,11 +958,11 @@ | ||
| 958 | 958 | improveReadability(zLeft, zRight, p); |
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | /* |
| 962 | 962 | ** COMMAND: test-line-diff |
| 963 | -** Usage: %fossil% test-line-diff STRING1 STRING2 | |
| 963 | +** Usage: %fossil test-line-diff STRING1 STRING2 | |
| 964 | 964 | ** |
| 965 | 965 | ** Show the differences between the two strings. Used for testing |
| 966 | 966 | ** the oneLineChange() routine in the diff logic. |
| 967 | 967 | */ |
| 968 | 968 | void test_line_diff(void){ |
| 969 | 969 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -958,11 +958,11 @@ | |
| 958 | improveReadability(zLeft, zRight, p); |
| 959 | } |
| 960 | |
| 961 | /* |
| 962 | ** COMMAND: test-line-diff |
| 963 | ** Usage: %fossil% test-line-diff STRING1 STRING2 |
| 964 | ** |
| 965 | ** Show the differences between the two strings. Used for testing |
| 966 | ** the oneLineChange() routine in the diff logic. |
| 967 | */ |
| 968 | void test_line_diff(void){ |
| 969 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -958,11 +958,11 @@ | |
| 958 | improveReadability(zLeft, zRight, p); |
| 959 | } |
| 960 | |
| 961 | /* |
| 962 | ** COMMAND: test-line-diff |
| 963 | ** Usage: %fossil test-line-diff STRING1 STRING2 |
| 964 | ** |
| 965 | ** Show the differences between the two strings. Used for testing |
| 966 | ** the oneLineChange() routine in the diff logic. |
| 967 | */ |
| 968 | void test_line_diff(void){ |
| 969 |
+2
-2
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -865,11 +865,11 @@ | ||
| 865 | 865 | ** the main web server. |
| 866 | 866 | ** |
| 867 | 867 | ** Query parameters: |
| 868 | 868 | ** |
| 869 | 869 | ** name=CMD Show help for CMD where CMD is a command name or |
| 870 | -** or setting name. If CMD beings with "/" it is | |
| 870 | +** setting name. If CMD begins with "/" it is | |
| 871 | 871 | ** interpreted as a PAGE name. |
| 872 | 872 | ** |
| 873 | 873 | ** name=www/PAGE Show help for web page PAGE. |
| 874 | 874 | ** |
| 875 | 875 | ** name=/PAGE The initial "www/" on web-page help can be abbreviated as |
| @@ -1459,11 +1459,11 @@ | ||
| 1459 | 1459 | ** --utc Display times using UTC |
| 1460 | 1460 | ** --vfs NAME Cause SQLite to use the NAME VFS |
| 1461 | 1461 | ** |
| 1462 | 1462 | ** Additional options available on most commands that use network I/O: |
| 1463 | 1463 | ** |
| 1464 | -** --accept-any-cert Disable server SSL cdert validation. Accept any SSL | |
| 1464 | +** --accept-any-cert Disable server SSL cert validation. Accept any SSL | |
| 1465 | 1465 | ** cert that the server provides. WARNING: Unsafe! |
| 1466 | 1466 | ** Testing and debugging use only! |
| 1467 | 1467 | ** --ipv4 Use only IPv4. Disable IPv6 support. |
| 1468 | 1468 | ** --ipv6 Use only IPv6. Disable IPv4 support. |
| 1469 | 1469 | ** --nosync Disable autosync for the current command. |
| 1470 | 1470 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -865,11 +865,11 @@ | |
| 865 | ** the main web server. |
| 866 | ** |
| 867 | ** Query parameters: |
| 868 | ** |
| 869 | ** name=CMD Show help for CMD where CMD is a command name or |
| 870 | ** or setting name. If CMD beings with "/" it is |
| 871 | ** interpreted as a PAGE name. |
| 872 | ** |
| 873 | ** name=www/PAGE Show help for web page PAGE. |
| 874 | ** |
| 875 | ** name=/PAGE The initial "www/" on web-page help can be abbreviated as |
| @@ -1459,11 +1459,11 @@ | |
| 1459 | ** --utc Display times using UTC |
| 1460 | ** --vfs NAME Cause SQLite to use the NAME VFS |
| 1461 | ** |
| 1462 | ** Additional options available on most commands that use network I/O: |
| 1463 | ** |
| 1464 | ** --accept-any-cert Disable server SSL cdert validation. Accept any SSL |
| 1465 | ** cert that the server provides. WARNING: Unsafe! |
| 1466 | ** Testing and debugging use only! |
| 1467 | ** --ipv4 Use only IPv4. Disable IPv6 support. |
| 1468 | ** --ipv6 Use only IPv6. Disable IPv4 support. |
| 1469 | ** --nosync Disable autosync for the current command. |
| 1470 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -865,11 +865,11 @@ | |
| 865 | ** the main web server. |
| 866 | ** |
| 867 | ** Query parameters: |
| 868 | ** |
| 869 | ** name=CMD Show help for CMD where CMD is a command name or |
| 870 | ** setting name. If CMD begins with "/" it is |
| 871 | ** interpreted as a PAGE name. |
| 872 | ** |
| 873 | ** name=www/PAGE Show help for web page PAGE. |
| 874 | ** |
| 875 | ** name=/PAGE The initial "www/" on web-page help can be abbreviated as |
| @@ -1459,11 +1459,11 @@ | |
| 1459 | ** --utc Display times using UTC |
| 1460 | ** --vfs NAME Cause SQLite to use the NAME VFS |
| 1461 | ** |
| 1462 | ** Additional options available on most commands that use network I/O: |
| 1463 | ** |
| 1464 | ** --accept-any-cert Disable server SSL cert validation. Accept any SSL |
| 1465 | ** cert that the server provides. WARNING: Unsafe! |
| 1466 | ** Testing and debugging use only! |
| 1467 | ** --ipv4 Use only IPv4. Disable IPv6 support. |
| 1468 | ** --ipv6 Use only IPv6. Disable IPv4 support. |
| 1469 | ** --nosync Disable autosync for the current command. |
| 1470 |
+6
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1716,11 +1716,13 @@ | ||
| 1716 | 1716 | /* Optionally do a "git push" */ |
| 1717 | 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | 1718 | if( zPushUrl ){ |
| 1719 | 1719 | char *zPushCmd; |
| 1720 | 1720 | UrlData url; |
| 1721 | - if( sqlite3_strglob("http*", zPushUrl)==0 ){ | |
| 1721 | + if( fossil_strnicmp(zPushUrl, "http://", 7)==0 | |
| 1722 | + || fossil_strnicmp(zPushUrl, "https://", 8)==0 | |
| 1723 | + ){ | |
| 1722 | 1724 | url_parse_local(zPushUrl, 0, &url); |
| 1723 | 1725 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1724 | 1726 | }else{ |
| 1725 | 1727 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1726 | 1728 | } |
| @@ -1799,11 +1801,13 @@ | ||
| 1799 | 1801 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1800 | 1802 | if( z==0 ){ |
| 1801 | 1803 | fossil_print("Autopush: off\n"); |
| 1802 | 1804 | }else{ |
| 1803 | 1805 | UrlData url; |
| 1804 | - if( sqlite3_strglob("http*", z)==0 ){ | |
| 1806 | + if( fossil_strnicmp(z, "http://", 7)==0 | |
| 1807 | + || fossil_strnicmp(z, "https://", 8)==0 | |
| 1808 | + ){ | |
| 1805 | 1809 | url_parse_local(z, 0, &url); |
| 1806 | 1810 | fossil_print("Autopush: %s\n", url.canonical); |
| 1807 | 1811 | }else{ |
| 1808 | 1812 | fossil_print("Autopush: %s\n", z); |
| 1809 | 1813 | } |
| 1810 | 1814 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1716,11 +1716,13 @@ | |
| 1716 | /* Optionally do a "git push" */ |
| 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | if( zPushUrl ){ |
| 1719 | char *zPushCmd; |
| 1720 | UrlData url; |
| 1721 | if( sqlite3_strglob("http*", zPushUrl)==0 ){ |
| 1722 | url_parse_local(zPushUrl, 0, &url); |
| 1723 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1724 | }else{ |
| 1725 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1726 | } |
| @@ -1799,11 +1801,13 @@ | |
| 1799 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1800 | if( z==0 ){ |
| 1801 | fossil_print("Autopush: off\n"); |
| 1802 | }else{ |
| 1803 | UrlData url; |
| 1804 | if( sqlite3_strglob("http*", z)==0 ){ |
| 1805 | url_parse_local(z, 0, &url); |
| 1806 | fossil_print("Autopush: %s\n", url.canonical); |
| 1807 | }else{ |
| 1808 | fossil_print("Autopush: %s\n", z); |
| 1809 | } |
| 1810 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1716,11 +1716,13 @@ | |
| 1716 | /* Optionally do a "git push" */ |
| 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | if( zPushUrl ){ |
| 1719 | char *zPushCmd; |
| 1720 | UrlData url; |
| 1721 | if( fossil_strnicmp(zPushUrl, "http://", 7)==0 |
| 1722 | || fossil_strnicmp(zPushUrl, "https://", 8)==0 |
| 1723 | ){ |
| 1724 | url_parse_local(zPushUrl, 0, &url); |
| 1725 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1726 | }else{ |
| 1727 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1728 | } |
| @@ -1799,11 +1801,13 @@ | |
| 1801 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1802 | if( z==0 ){ |
| 1803 | fossil_print("Autopush: off\n"); |
| 1804 | }else{ |
| 1805 | UrlData url; |
| 1806 | if( fossil_strnicmp(z, "http://", 7)==0 |
| 1807 | || fossil_strnicmp(z, "https://", 8)==0 |
| 1808 | ){ |
| 1809 | url_parse_local(z, 0, &url); |
| 1810 | fossil_print("Autopush: %s\n", url.canonical); |
| 1811 | }else{ |
| 1812 | fossil_print("Autopush: %s\n", z); |
| 1813 | } |
| 1814 |
+6
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1716,11 +1716,13 @@ | ||
| 1716 | 1716 | /* Optionally do a "git push" */ |
| 1717 | 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | 1718 | if( zPushUrl ){ |
| 1719 | 1719 | char *zPushCmd; |
| 1720 | 1720 | UrlData url; |
| 1721 | - if( sqlite3_strglob("http*", zPushUrl)==0 ){ | |
| 1721 | + if( fossil_strnicmp(zPushUrl, "http://", 7)==0 | |
| 1722 | + || fossil_strnicmp(zPushUrl, "https://", 8)==0 | |
| 1723 | + ){ | |
| 1722 | 1724 | url_parse_local(zPushUrl, 0, &url); |
| 1723 | 1725 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1724 | 1726 | }else{ |
| 1725 | 1727 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1726 | 1728 | } |
| @@ -1799,11 +1801,13 @@ | ||
| 1799 | 1801 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1800 | 1802 | if( z==0 ){ |
| 1801 | 1803 | fossil_print("Autopush: off\n"); |
| 1802 | 1804 | }else{ |
| 1803 | 1805 | UrlData url; |
| 1804 | - if( sqlite3_strglob("http*", z)==0 ){ | |
| 1806 | + if( fossil_strnicmp(z, "http://", 7)==0 | |
| 1807 | + || fossil_strnicmp(z, "https://", 8)==0 | |
| 1808 | + ){ | |
| 1805 | 1809 | url_parse_local(z, 0, &url); |
| 1806 | 1810 | fossil_print("Autopush: %s\n", url.canonical); |
| 1807 | 1811 | }else{ |
| 1808 | 1812 | fossil_print("Autopush: %s\n", z); |
| 1809 | 1813 | } |
| 1810 | 1814 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1716,11 +1716,13 @@ | |
| 1716 | /* Optionally do a "git push" */ |
| 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | if( zPushUrl ){ |
| 1719 | char *zPushCmd; |
| 1720 | UrlData url; |
| 1721 | if( sqlite3_strglob("http*", zPushUrl)==0 ){ |
| 1722 | url_parse_local(zPushUrl, 0, &url); |
| 1723 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1724 | }else{ |
| 1725 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1726 | } |
| @@ -1799,11 +1801,13 @@ | |
| 1799 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1800 | if( z==0 ){ |
| 1801 | fossil_print("Autopush: off\n"); |
| 1802 | }else{ |
| 1803 | UrlData url; |
| 1804 | if( sqlite3_strglob("http*", z)==0 ){ |
| 1805 | url_parse_local(z, 0, &url); |
| 1806 | fossil_print("Autopush: %s\n", url.canonical); |
| 1807 | }else{ |
| 1808 | fossil_print("Autopush: %s\n", z); |
| 1809 | } |
| 1810 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1716,11 +1716,13 @@ | |
| 1716 | /* Optionally do a "git push" */ |
| 1717 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1718 | if( zPushUrl ){ |
| 1719 | char *zPushCmd; |
| 1720 | UrlData url; |
| 1721 | if( fossil_strnicmp(zPushUrl, "http://", 7)==0 |
| 1722 | || fossil_strnicmp(zPushUrl, "https://", 8)==0 |
| 1723 | ){ |
| 1724 | url_parse_local(zPushUrl, 0, &url); |
| 1725 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1726 | }else{ |
| 1727 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1728 | } |
| @@ -1799,11 +1801,13 @@ | |
| 1801 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1802 | if( z==0 ){ |
| 1803 | fossil_print("Autopush: off\n"); |
| 1804 | }else{ |
| 1805 | UrlData url; |
| 1806 | if( fossil_strnicmp(z, "http://", 7)==0 |
| 1807 | || fossil_strnicmp(z, "https://", 8)==0 |
| 1808 | ){ |
| 1809 | url_parse_local(z, 0, &url); |
| 1810 | fossil_print("Autopush: %s\n", url.canonical); |
| 1811 | }else{ |
| 1812 | fossil_print("Autopush: %s\n", z); |
| 1813 | } |
| 1814 |
+9
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1237,11 +1237,18 @@ | ||
| 1237 | 1237 | } |
| 1238 | 1238 | } |
| 1239 | 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | 1240 | j++; |
| 1241 | 1241 | } |
| 1242 | - if( j==0 ) z[j++] = '/'; | |
| 1242 | + if( j<0 ){ | |
| 1243 | + /* backup_dir() removed everything including the first component. | |
| 1244 | + ** Absolute "/.." still has z[0]=='/'; relative "a/.." is cwd. */ | |
| 1245 | + if( z[0]=='/' ){ j = 0; z[j++] = '/'; } | |
| 1246 | + else { z[0] = '.'; j = 1; } | |
| 1247 | + }else if( j==0 ){ | |
| 1248 | + z[j++] = '/'; | |
| 1249 | + } | |
| 1243 | 1250 | z[j] = 0; |
| 1244 | 1251 | return j; |
| 1245 | 1252 | } |
| 1246 | 1253 | |
| 1247 | 1254 | /* |
| @@ -1450,11 +1457,11 @@ | ||
| 1450 | 1457 | /* |
| 1451 | 1458 | ** COMMAND: test-case-filename |
| 1452 | 1459 | ** |
| 1453 | 1460 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1454 | 1461 | ** |
| 1455 | -** All the PATH arguments (there must be one at least one) are pathnames | |
| 1462 | +** All the PATH arguments (there must be at least one) are pathnames | |
| 1456 | 1463 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1457 | 1464 | ** for each PATH in filesystems where case is not significant. |
| 1458 | 1465 | */ |
| 1459 | 1466 | void test_preferred_fn(void){ |
| 1460 | 1467 | int i; |
| 1461 | 1468 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1237,11 +1237,18 @@ | |
| 1237 | } |
| 1238 | } |
| 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | j++; |
| 1241 | } |
| 1242 | if( j==0 ) z[j++] = '/'; |
| 1243 | z[j] = 0; |
| 1244 | return j; |
| 1245 | } |
| 1246 | |
| 1247 | /* |
| @@ -1450,11 +1457,11 @@ | |
| 1450 | /* |
| 1451 | ** COMMAND: test-case-filename |
| 1452 | ** |
| 1453 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1454 | ** |
| 1455 | ** All the PATH arguments (there must be one at least one) are pathnames |
| 1456 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1457 | ** for each PATH in filesystems where case is not significant. |
| 1458 | */ |
| 1459 | void test_preferred_fn(void){ |
| 1460 | int i; |
| 1461 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1237,11 +1237,18 @@ | |
| 1237 | } |
| 1238 | } |
| 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | j++; |
| 1241 | } |
| 1242 | if( j<0 ){ |
| 1243 | /* backup_dir() removed everything including the first component. |
| 1244 | ** Absolute "/.." still has z[0]=='/'; relative "a/.." is cwd. */ |
| 1245 | if( z[0]=='/' ){ j = 0; z[j++] = '/'; } |
| 1246 | else { z[0] = '.'; j = 1; } |
| 1247 | }else if( j==0 ){ |
| 1248 | z[j++] = '/'; |
| 1249 | } |
| 1250 | z[j] = 0; |
| 1251 | return j; |
| 1252 | } |
| 1253 | |
| 1254 | /* |
| @@ -1450,11 +1457,11 @@ | |
| 1457 | /* |
| 1458 | ** COMMAND: test-case-filename |
| 1459 | ** |
| 1460 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1461 | ** |
| 1462 | ** All the PATH arguments (there must be at least one) are pathnames |
| 1463 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1464 | ** for each PATH in filesystems where case is not significant. |
| 1465 | */ |
| 1466 | void test_preferred_fn(void){ |
| 1467 | int i; |
| 1468 |
+9
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1237,11 +1237,18 @@ | ||
| 1237 | 1237 | } |
| 1238 | 1238 | } |
| 1239 | 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | 1240 | j++; |
| 1241 | 1241 | } |
| 1242 | - if( j==0 ) z[j++] = '/'; | |
| 1242 | + if( j<0 ){ | |
| 1243 | + /* backup_dir() removed everything including the first component. | |
| 1244 | + ** Absolute "/.." still has z[0]=='/'; relative "a/.." is cwd. */ | |
| 1245 | + if( z[0]=='/' ){ j = 0; z[j++] = '/'; } | |
| 1246 | + else { z[0] = '.'; j = 1; } | |
| 1247 | + }else if( j==0 ){ | |
| 1248 | + z[j++] = '/'; | |
| 1249 | + } | |
| 1243 | 1250 | z[j] = 0; |
| 1244 | 1251 | return j; |
| 1245 | 1252 | } |
| 1246 | 1253 | |
| 1247 | 1254 | /* |
| @@ -1450,11 +1457,11 @@ | ||
| 1450 | 1457 | /* |
| 1451 | 1458 | ** COMMAND: test-case-filename |
| 1452 | 1459 | ** |
| 1453 | 1460 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1454 | 1461 | ** |
| 1455 | -** All the PATH arguments (there must be one at least one) are pathnames | |
| 1462 | +** All the PATH arguments (there must be at least one) are pathnames | |
| 1456 | 1463 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1457 | 1464 | ** for each PATH in filesystems where case is not significant. |
| 1458 | 1465 | */ |
| 1459 | 1466 | void test_preferred_fn(void){ |
| 1460 | 1467 | int i; |
| 1461 | 1468 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1237,11 +1237,18 @@ | |
| 1237 | } |
| 1238 | } |
| 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | j++; |
| 1241 | } |
| 1242 | if( j==0 ) z[j++] = '/'; |
| 1243 | z[j] = 0; |
| 1244 | return j; |
| 1245 | } |
| 1246 | |
| 1247 | /* |
| @@ -1450,11 +1457,11 @@ | |
| 1450 | /* |
| 1451 | ** COMMAND: test-case-filename |
| 1452 | ** |
| 1453 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1454 | ** |
| 1455 | ** All the PATH arguments (there must be one at least one) are pathnames |
| 1456 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1457 | ** for each PATH in filesystems where case is not significant. |
| 1458 | */ |
| 1459 | void test_preferred_fn(void){ |
| 1460 | int i; |
| 1461 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1237,11 +1237,18 @@ | |
| 1237 | } |
| 1238 | } |
| 1239 | if( j>=0 ) z[j] = z[i]; |
| 1240 | j++; |
| 1241 | } |
| 1242 | if( j<0 ){ |
| 1243 | /* backup_dir() removed everything including the first component. |
| 1244 | ** Absolute "/.." still has z[0]=='/'; relative "a/.." is cwd. */ |
| 1245 | if( z[0]=='/' ){ j = 0; z[j++] = '/'; } |
| 1246 | else { z[0] = '.'; j = 1; } |
| 1247 | }else if( j==0 ){ |
| 1248 | z[j++] = '/'; |
| 1249 | } |
| 1250 | z[j] = 0; |
| 1251 | return j; |
| 1252 | } |
| 1253 | |
| 1254 | /* |
| @@ -1450,11 +1457,11 @@ | |
| 1457 | /* |
| 1458 | ** COMMAND: test-case-filename |
| 1459 | ** |
| 1460 | ** Usage: fossil test-case-filename DIRECTORY PATH PATH PATH .... |
| 1461 | ** |
| 1462 | ** All the PATH arguments (there must be at least one) are pathnames |
| 1463 | ** relative to DIRECTORY. This test command prints the OS-preferred name |
| 1464 | ** for each PATH in filesystems where case is not significant. |
| 1465 | */ |
| 1466 | void test_preferred_fn(void){ |
| 1467 | int i; |
| 1468 |
+15
-7
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -3471,19 +3471,27 @@ | ||
| 3471 | 3471 | fossil_fatal("the --title option is required"); |
| 3472 | 3472 | } |
| 3473 | 3473 | if( zFile==0 ){ |
| 3474 | 3474 | fossil_fatal("the --content option is required"); |
| 3475 | 3475 | } |
| 3476 | - if( zMarkup==0 || fossil_strcmp(zMarkup,"markdown")==0 ){ | |
| 3477 | - zMimetype = "text/x-markdown"; | |
| 3478 | - }else if( fossil_strcmp(zMarkup,"wiki")==0 ){ | |
| 3479 | - zMimetype = 0; | |
| 3480 | - }else if( fossil_strcmp(zMarkup,"plaintext")==0 ){ | |
| 3481 | - zMimetype = "text/plain"; | |
| 3482 | - }else{ | |
| 3476 | + if( zMarkup==0 ){ | |
| 3477 | + zMimetype = wiki_guess_filename_mimetype(zFile, 0); | |
| 3478 | + if( !zMimetype ){ | |
| 3479 | + fossil_fatal("Either use --markup <type> or a --content " | |
| 3480 | + "filename extension of (.md, .txt, .wiki) " | |
| 3481 | + "to specify the mime type."); | |
| 3482 | + zMimetype = DEFAULT_FORUM_MIMETYPE; | |
| 3483 | + } | |
| 3484 | + }else if( !wiki_is_valid_mimetype(zMarkup) ){ | |
| 3483 | 3485 | fossil_fatal("unknown --markup \"%s\". Should be one of: " |
| 3484 | 3486 | "markdown, wiki, plaintext", zMarkup); |
| 3487 | + }else{ | |
| 3488 | + zMimetype = wiki_filter_mimetypes(zMarkup)/*normalize short names*/; | |
| 3489 | + assert( zMimetype ); | |
| 3490 | + } | |
| 3491 | + if( 0==fossil_strcmp(zMimetype, "text/x-fossil-wiki") ){ | |
| 3492 | + zMimetype = 0 /* avoid setting N-card */; | |
| 3485 | 3493 | } |
| 3486 | 3494 | if( fossil_strcmp(zFile,"-")==0 ){ |
| 3487 | 3495 | blob_read_from_channel(&content, stdin, -1); |
| 3488 | 3496 | }else{ |
| 3489 | 3497 | blob_read_from_file(&content, zFile, ExtFILE); |
| 3490 | 3498 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -3471,19 +3471,27 @@ | |
| 3471 | fossil_fatal("the --title option is required"); |
| 3472 | } |
| 3473 | if( zFile==0 ){ |
| 3474 | fossil_fatal("the --content option is required"); |
| 3475 | } |
| 3476 | if( zMarkup==0 || fossil_strcmp(zMarkup,"markdown")==0 ){ |
| 3477 | zMimetype = "text/x-markdown"; |
| 3478 | }else if( fossil_strcmp(zMarkup,"wiki")==0 ){ |
| 3479 | zMimetype = 0; |
| 3480 | }else if( fossil_strcmp(zMarkup,"plaintext")==0 ){ |
| 3481 | zMimetype = "text/plain"; |
| 3482 | }else{ |
| 3483 | fossil_fatal("unknown --markup \"%s\". Should be one of: " |
| 3484 | "markdown, wiki, plaintext", zMarkup); |
| 3485 | } |
| 3486 | if( fossil_strcmp(zFile,"-")==0 ){ |
| 3487 | blob_read_from_channel(&content, stdin, -1); |
| 3488 | }else{ |
| 3489 | blob_read_from_file(&content, zFile, ExtFILE); |
| 3490 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -3471,19 +3471,27 @@ | |
| 3471 | fossil_fatal("the --title option is required"); |
| 3472 | } |
| 3473 | if( zFile==0 ){ |
| 3474 | fossil_fatal("the --content option is required"); |
| 3475 | } |
| 3476 | if( zMarkup==0 ){ |
| 3477 | zMimetype = wiki_guess_filename_mimetype(zFile, 0); |
| 3478 | if( !zMimetype ){ |
| 3479 | fossil_fatal("Either use --markup <type> or a --content " |
| 3480 | "filename extension of (.md, .txt, .wiki) " |
| 3481 | "to specify the mime type."); |
| 3482 | zMimetype = DEFAULT_FORUM_MIMETYPE; |
| 3483 | } |
| 3484 | }else if( !wiki_is_valid_mimetype(zMarkup) ){ |
| 3485 | fossil_fatal("unknown --markup \"%s\". Should be one of: " |
| 3486 | "markdown, wiki, plaintext", zMarkup); |
| 3487 | }else{ |
| 3488 | zMimetype = wiki_filter_mimetypes(zMarkup)/*normalize short names*/; |
| 3489 | assert( zMimetype ); |
| 3490 | } |
| 3491 | if( 0==fossil_strcmp(zMimetype, "text/x-fossil-wiki") ){ |
| 3492 | zMimetype = 0 /* avoid setting N-card */; |
| 3493 | } |
| 3494 | if( fossil_strcmp(zFile,"-")==0 ){ |
| 3495 | blob_read_from_channel(&content, stdin, -1); |
| 3496 | }else{ |
| 3497 | blob_read_from_file(&content, zFile, ExtFILE); |
| 3498 |
+3
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2408,14 +2408,14 @@ | ||
| 2408 | 2408 | ** |
| 2409 | 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | 2410 | ** showing a list of available repositories if |
| 2411 | 2411 | ** the URL is "/". Some control over the display |
| 2412 | 2412 | ** is accomplished using environment variables. |
| 2413 | -** FOSSIL_REPOLIST_TITLE is the tital of the page. | |
| 2414 | -** FOSSIL_REPOLIST_SHOW cause the "Description" | |
| 2413 | +** FOSSIL_REPOLIST_TITLE is the title of the page. | |
| 2414 | +** FOSSIL_REPOLIST_SHOW causes the "Description" | |
| 2415 | 2415 | ** column to display if it contains "description" as |
| 2416 | -** as a substring, and causes the Login-Group column | |
| 2416 | +** a substring, and causes the Login-Group column | |
| 2417 | 2417 | ** to display if it contains the "login-group" |
| 2418 | 2418 | ** substring. |
| 2419 | 2419 | ** |
| 2420 | 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | 2421 | ** from 127.0.0.1 or ::1. |
| 2422 | 2422 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2408,14 +2408,14 @@ | |
| 2408 | ** |
| 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | ** showing a list of available repositories if |
| 2411 | ** the URL is "/". Some control over the display |
| 2412 | ** is accomplished using environment variables. |
| 2413 | ** FOSSIL_REPOLIST_TITLE is the tital of the page. |
| 2414 | ** FOSSIL_REPOLIST_SHOW cause the "Description" |
| 2415 | ** column to display if it contains "description" as |
| 2416 | ** as a substring, and causes the Login-Group column |
| 2417 | ** to display if it contains the "login-group" |
| 2418 | ** substring. |
| 2419 | ** |
| 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | ** from 127.0.0.1 or ::1. |
| 2422 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2408,14 +2408,14 @@ | |
| 2408 | ** |
| 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | ** showing a list of available repositories if |
| 2411 | ** the URL is "/". Some control over the display |
| 2412 | ** is accomplished using environment variables. |
| 2413 | ** FOSSIL_REPOLIST_TITLE is the title of the page. |
| 2414 | ** FOSSIL_REPOLIST_SHOW causes the "Description" |
| 2415 | ** column to display if it contains "description" as |
| 2416 | ** a substring, and causes the Login-Group column |
| 2417 | ** to display if it contains the "login-group" |
| 2418 | ** substring. |
| 2419 | ** |
| 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | ** from 127.0.0.1 or ::1. |
| 2422 |
+3
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2408,14 +2408,14 @@ | ||
| 2408 | 2408 | ** |
| 2409 | 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | 2410 | ** showing a list of available repositories if |
| 2411 | 2411 | ** the URL is "/". Some control over the display |
| 2412 | 2412 | ** is accomplished using environment variables. |
| 2413 | -** FOSSIL_REPOLIST_TITLE is the tital of the page. | |
| 2414 | -** FOSSIL_REPOLIST_SHOW cause the "Description" | |
| 2413 | +** FOSSIL_REPOLIST_TITLE is the title of the page. | |
| 2414 | +** FOSSIL_REPOLIST_SHOW causes the "Description" | |
| 2415 | 2415 | ** column to display if it contains "description" as |
| 2416 | -** as a substring, and causes the Login-Group column | |
| 2416 | +** a substring, and causes the Login-Group column | |
| 2417 | 2417 | ** to display if it contains the "login-group" |
| 2418 | 2418 | ** substring. |
| 2419 | 2419 | ** |
| 2420 | 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | 2421 | ** from 127.0.0.1 or ::1. |
| 2422 | 2422 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2408,14 +2408,14 @@ | |
| 2408 | ** |
| 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | ** showing a list of available repositories if |
| 2411 | ** the URL is "/". Some control over the display |
| 2412 | ** is accomplished using environment variables. |
| 2413 | ** FOSSIL_REPOLIST_TITLE is the tital of the page. |
| 2414 | ** FOSSIL_REPOLIST_SHOW cause the "Description" |
| 2415 | ** column to display if it contains "description" as |
| 2416 | ** as a substring, and causes the Login-Group column |
| 2417 | ** to display if it contains the "login-group" |
| 2418 | ** substring. |
| 2419 | ** |
| 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | ** from 127.0.0.1 or ::1. |
| 2422 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2408,14 +2408,14 @@ | |
| 2408 | ** |
| 2409 | ** repolist When in "directory:" mode, display a page |
| 2410 | ** showing a list of available repositories if |
| 2411 | ** the URL is "/". Some control over the display |
| 2412 | ** is accomplished using environment variables. |
| 2413 | ** FOSSIL_REPOLIST_TITLE is the title of the page. |
| 2414 | ** FOSSIL_REPOLIST_SHOW causes the "Description" |
| 2415 | ** column to display if it contains "description" as |
| 2416 | ** a substring, and causes the Login-Group column |
| 2417 | ** to display if it contains the "login-group" |
| 2418 | ** substring. |
| 2419 | ** |
| 2420 | ** localauth Grant administrator privileges to connections |
| 2421 | ** from 127.0.0.1 or ::1. |
| 2422 |
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -2223,11 +2223,11 @@ | ||
| 2223 | 2223 | /* |
| 2224 | 2224 | ** WEBPAGE: phantoms |
| 2225 | 2225 | ** |
| 2226 | 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | 2227 | ** |
| 2228 | -** A "phantom" artifact is an artifact whose hash named appears in some | |
| 2228 | +** A "phantom" artifact is an artifact whose hash name appears in some | |
| 2229 | 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | 2233 | ** |
| 2234 | 2234 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -2223,11 +2223,11 @@ | |
| 2223 | /* |
| 2224 | ** WEBPAGE: phantoms |
| 2225 | ** |
| 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | ** |
| 2228 | ** A "phantom" artifact is an artifact whose hash named appears in some |
| 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | ** |
| 2234 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -2223,11 +2223,11 @@ | |
| 2223 | /* |
| 2224 | ** WEBPAGE: phantoms |
| 2225 | ** |
| 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | ** |
| 2228 | ** A "phantom" artifact is an artifact whose hash name appears in some |
| 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | ** |
| 2234 |
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -2223,11 +2223,11 @@ | ||
| 2223 | 2223 | /* |
| 2224 | 2224 | ** WEBPAGE: phantoms |
| 2225 | 2225 | ** |
| 2226 | 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | 2227 | ** |
| 2228 | -** A "phantom" artifact is an artifact whose hash named appears in some | |
| 2228 | +** A "phantom" artifact is an artifact whose hash name appears in some | |
| 2229 | 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | 2233 | ** |
| 2234 | 2234 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -2223,11 +2223,11 @@ | |
| 2223 | /* |
| 2224 | ** WEBPAGE: phantoms |
| 2225 | ** |
| 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | ** |
| 2228 | ** A "phantom" artifact is an artifact whose hash named appears in some |
| 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | ** |
| 2234 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -2223,11 +2223,11 @@ | |
| 2223 | /* |
| 2224 | ** WEBPAGE: phantoms |
| 2225 | ** |
| 2226 | ** Show a list of all "phantom" artifacts that are not marked as "private". |
| 2227 | ** |
| 2228 | ** A "phantom" artifact is an artifact whose hash name appears in some |
| 2229 | ** artifact but whose content is unknown. For example, if a manifest |
| 2230 | ** references a particular SHA3 hash of a file, but that SHA3 hash is |
| 2231 | ** not on the shunning list and is not in the database, then the file |
| 2232 | ** is a phantom. We know it exists, but we do not know its content. |
| 2233 | ** |
| 2234 |
+39
-3
| --- src/sha1hard.c | ||
| +++ src/sha1hard.c | ||
| @@ -441,15 +441,40 @@ | ||
| 441 | 441 | #define sha1_bswap32(x) \ |
| 442 | 442 | {x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0xFF00FF); x = (x << 16) | (x >> 16);} |
| 443 | 443 | |
| 444 | 444 | #define sha1_mix(W, t) (rotate_left(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1)) |
| 445 | 445 | |
| 446 | -#if defined(BIGENDIAN) | |
| 447 | - #define sha1_load(m, t) (m[t]) | |
| 446 | +/* | |
| 447 | +** SHA1 message words are big-endian, so they must be byte-swapped on | |
| 448 | +** little-endian hosts and loaded as-is on big-endian ones. Upstream | |
| 449 | +** sha1dc has a large detection block for SHA1DC_BIGENDIAN. This is a | |
| 450 | +** condensed form of it. SHA1DCInit() double-checks the result at | |
| 451 | +** runtime so that a misdetection fails loudly instead of silently | |
| 452 | +** producing wrong hashes. | |
| 453 | +*/ | |
| 454 | +#if !defined(SHA1DC_BIGENDIAN) && !defined(SHA1DC_LITTLEENDIAN) | |
| 455 | +# if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) | |
| 456 | +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
| 457 | +# define SHA1DC_BIGENDIAN 1 | |
| 458 | +# endif | |
| 459 | +# elif defined(__BIG_ENDIAN__) || defined(__ARMEB__) \ | |
| 460 | + || defined(__THUMBEB__) || defined(__AARCH64EB__) \ | |
| 461 | + || defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) \ | |
| 462 | + || defined(__ppc__) || defined(__powerpc__) || defined(_POWER) \ | |
| 463 | + || defined(__sparc) || defined(__sparc__) || defined(__hppa__) \ | |
| 464 | + || defined(__s390__) || defined(__m68k__) | |
| 465 | + /* __ppc__/__powerpc__ without __BYTE_ORDER__ means an old compiler, | |
| 466 | + ** which predates ppc64le, so big-endian is a safe assumption. */ | |
| 467 | +# define SHA1DC_BIGENDIAN 1 | |
| 468 | +# endif | |
| 469 | +#endif | |
| 470 | + | |
| 471 | +#if defined(SHA1DC_BIGENDIAN) | |
| 472 | + #define sha1_load(m, t, temp) { temp = m[t]; } | |
| 448 | 473 | #else |
| 449 | 474 | #define sha1_load(m, t, temp) { temp = m[t]; sha1_bswap32(temp); } |
| 450 | -#endif /*define(BIGENDIAN)*/ | |
| 475 | +#endif /*defined(SHA1DC_BIGENDIAN)*/ | |
| 451 | 476 | |
| 452 | 477 | #define sha1_store(W, t, x) *(volatile uint32_t *)&W[t] = x |
| 453 | 478 | |
| 454 | 479 | #define sha1_f1(b,c,d) ((d)^((b)&((c)^(d)))) |
| 455 | 480 | #define sha1_f2(b,c,d) ((b)^(c)^(d)) |
| @@ -1324,10 +1349,21 @@ | ||
| 1324 | 1349 | } |
| 1325 | 1350 | } |
| 1326 | 1351 | |
| 1327 | 1352 | void SHA1DCInit(SHA1_CTX* ctx) |
| 1328 | 1353 | { |
| 1354 | + static const union { unsigned char b[4]; uint32_t v; } e = {{0,1,2,3}}; | |
| 1355 | +#if defined(SHA1DC_BIGENDIAN) | |
| 1356 | + if( e.v!=0x00010203 ) | |
| 1357 | +#else | |
| 1358 | + if( e.v!=0x03020100 ) | |
| 1359 | +#endif | |
| 1360 | + { | |
| 1361 | + fprintf(stderr, "sha1hard.c: compile-time byte-order detection " | |
| 1362 | + "is wrong for this platform\n"); | |
| 1363 | + abort(); | |
| 1364 | + } | |
| 1329 | 1365 | ctx->total = 0; |
| 1330 | 1366 | ctx->ihv[0] = 0x67452301; |
| 1331 | 1367 | ctx->ihv[1] = 0xEFCDAB89; |
| 1332 | 1368 | ctx->ihv[2] = 0x98BADCFE; |
| 1333 | 1369 | ctx->ihv[3] = 0x10325476; |
| 1334 | 1370 |
| --- src/sha1hard.c | |
| +++ src/sha1hard.c | |
| @@ -441,15 +441,40 @@ | |
| 441 | #define sha1_bswap32(x) \ |
| 442 | {x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0xFF00FF); x = (x << 16) | (x >> 16);} |
| 443 | |
| 444 | #define sha1_mix(W, t) (rotate_left(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1)) |
| 445 | |
| 446 | #if defined(BIGENDIAN) |
| 447 | #define sha1_load(m, t) (m[t]) |
| 448 | #else |
| 449 | #define sha1_load(m, t, temp) { temp = m[t]; sha1_bswap32(temp); } |
| 450 | #endif /*define(BIGENDIAN)*/ |
| 451 | |
| 452 | #define sha1_store(W, t, x) *(volatile uint32_t *)&W[t] = x |
| 453 | |
| 454 | #define sha1_f1(b,c,d) ((d)^((b)&((c)^(d)))) |
| 455 | #define sha1_f2(b,c,d) ((b)^(c)^(d)) |
| @@ -1324,10 +1349,21 @@ | |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | void SHA1DCInit(SHA1_CTX* ctx) |
| 1328 | { |
| 1329 | ctx->total = 0; |
| 1330 | ctx->ihv[0] = 0x67452301; |
| 1331 | ctx->ihv[1] = 0xEFCDAB89; |
| 1332 | ctx->ihv[2] = 0x98BADCFE; |
| 1333 | ctx->ihv[3] = 0x10325476; |
| 1334 |
| --- src/sha1hard.c | |
| +++ src/sha1hard.c | |
| @@ -441,15 +441,40 @@ | |
| 441 | #define sha1_bswap32(x) \ |
| 442 | {x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0xFF00FF); x = (x << 16) | (x >> 16);} |
| 443 | |
| 444 | #define sha1_mix(W, t) (rotate_left(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1)) |
| 445 | |
| 446 | /* |
| 447 | ** SHA1 message words are big-endian, so they must be byte-swapped on |
| 448 | ** little-endian hosts and loaded as-is on big-endian ones. Upstream |
| 449 | ** sha1dc has a large detection block for SHA1DC_BIGENDIAN. This is a |
| 450 | ** condensed form of it. SHA1DCInit() double-checks the result at |
| 451 | ** runtime so that a misdetection fails loudly instead of silently |
| 452 | ** producing wrong hashes. |
| 453 | */ |
| 454 | #if !defined(SHA1DC_BIGENDIAN) && !defined(SHA1DC_LITTLEENDIAN) |
| 455 | # if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) |
| 456 | # if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
| 457 | # define SHA1DC_BIGENDIAN 1 |
| 458 | # endif |
| 459 | # elif defined(__BIG_ENDIAN__) || defined(__ARMEB__) \ |
| 460 | || defined(__THUMBEB__) || defined(__AARCH64EB__) \ |
| 461 | || defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) \ |
| 462 | || defined(__ppc__) || defined(__powerpc__) || defined(_POWER) \ |
| 463 | || defined(__sparc) || defined(__sparc__) || defined(__hppa__) \ |
| 464 | || defined(__s390__) || defined(__m68k__) |
| 465 | /* __ppc__/__powerpc__ without __BYTE_ORDER__ means an old compiler, |
| 466 | ** which predates ppc64le, so big-endian is a safe assumption. */ |
| 467 | # define SHA1DC_BIGENDIAN 1 |
| 468 | # endif |
| 469 | #endif |
| 470 | |
| 471 | #if defined(SHA1DC_BIGENDIAN) |
| 472 | #define sha1_load(m, t, temp) { temp = m[t]; } |
| 473 | #else |
| 474 | #define sha1_load(m, t, temp) { temp = m[t]; sha1_bswap32(temp); } |
| 475 | #endif /*defined(SHA1DC_BIGENDIAN)*/ |
| 476 | |
| 477 | #define sha1_store(W, t, x) *(volatile uint32_t *)&W[t] = x |
| 478 | |
| 479 | #define sha1_f1(b,c,d) ((d)^((b)&((c)^(d)))) |
| 480 | #define sha1_f2(b,c,d) ((b)^(c)^(d)) |
| @@ -1324,10 +1349,21 @@ | |
| 1349 | } |
| 1350 | } |
| 1351 | |
| 1352 | void SHA1DCInit(SHA1_CTX* ctx) |
| 1353 | { |
| 1354 | static const union { unsigned char b[4]; uint32_t v; } e = {{0,1,2,3}}; |
| 1355 | #if defined(SHA1DC_BIGENDIAN) |
| 1356 | if( e.v!=0x00010203 ) |
| 1357 | #else |
| 1358 | if( e.v!=0x03020100 ) |
| 1359 | #endif |
| 1360 | { |
| 1361 | fprintf(stderr, "sha1hard.c: compile-time byte-order detection " |
| 1362 | "is wrong for this platform\n"); |
| 1363 | abort(); |
| 1364 | } |
| 1365 | ctx->total = 0; |
| 1366 | ctx->ihv[0] = 0x67452301; |
| 1367 | ctx->ihv[1] = 0xEFCDAB89; |
| 1368 | ctx->ihv[2] = 0x98BADCFE; |
| 1369 | ctx->ihv[3] = 0x10325476; |
| 1370 |
+6
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -232,10 +232,16 @@ | ||
| 232 | 232 | blob_reset(&orig); |
| 233 | 233 | blob_reset(&disk); |
| 234 | 234 | db_bind_blob(&ins, ":content", &content); |
| 235 | 235 | } |
| 236 | 236 | db_bind_int(&ins, ":islink", file_islink(zPath)); |
| 237 | +#if !defined(_WIN32) | |
| 238 | + /* vfile.isexe is the baseline's bit, so a stash would lose an | |
| 239 | + ** exec-bit change. Take the file's own, as create_manifest() does. | |
| 240 | + ** On Windows, file_isexe() is always false, so keep vfile's. */ | |
| 241 | + if( !deleted ) db_bind_int(&ins, ":isexe", file_isexe(zPath, RepoFILE)); | |
| 242 | +#endif | |
| 237 | 243 | db_step(&ins); |
| 238 | 244 | db_reset(&ins); |
| 239 | 245 | fossil_free(zPath); |
| 240 | 246 | blob_reset(&content); |
| 241 | 247 | } |
| 242 | 248 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -232,10 +232,16 @@ | |
| 232 | blob_reset(&orig); |
| 233 | blob_reset(&disk); |
| 234 | db_bind_blob(&ins, ":content", &content); |
| 235 | } |
| 236 | db_bind_int(&ins, ":islink", file_islink(zPath)); |
| 237 | db_step(&ins); |
| 238 | db_reset(&ins); |
| 239 | fossil_free(zPath); |
| 240 | blob_reset(&content); |
| 241 | } |
| 242 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -232,10 +232,16 @@ | |
| 232 | blob_reset(&orig); |
| 233 | blob_reset(&disk); |
| 234 | db_bind_blob(&ins, ":content", &content); |
| 235 | } |
| 236 | db_bind_int(&ins, ":islink", file_islink(zPath)); |
| 237 | #if !defined(_WIN32) |
| 238 | /* vfile.isexe is the baseline's bit, so a stash would lose an |
| 239 | ** exec-bit change. Take the file's own, as create_manifest() does. |
| 240 | ** On Windows, file_isexe() is always false, so keep vfile's. */ |
| 241 | if( !deleted ) db_bind_int(&ins, ":isexe", file_isexe(zPath, RepoFILE)); |
| 242 | #endif |
| 243 | db_step(&ins); |
| 244 | db_reset(&ins); |
| 245 | fossil_free(zPath); |
| 246 | blob_reset(&content); |
| 247 | } |
| 248 |
+12
-4
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -621,16 +621,24 @@ | ||
| 621 | 621 | UrlData x; |
| 622 | 622 | if( cnt==0 ){ |
| 623 | 623 | @ <div class="section">Recently synced with these URLs</div> |
| 624 | 624 | @ <table border='0' width='100%%'> |
| 625 | 625 | } |
| 626 | - memset(&x, 0, sizeof(x)); | |
| 627 | - url_parse_local(zURL, URL_OMIT_USER, &x); | |
| 628 | - @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a> | |
| 626 | + if( fossil_strnicmp(zURL, "http://", 7)==0 | |
| 627 | + || fossil_strnicmp(zURL, "https://", 8)==0 | |
| 628 | + ){ | |
| 629 | + memset(&x, 0, sizeof(x)); | |
| 630 | + url_parse_local(zURL, URL_OMIT_USER, &x); | |
| 631 | + @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a> | |
| 632 | + url_unparse(&x); | |
| 633 | + }else{ | |
| 634 | + /* A gitpush address such as git@host:path is not a URL that | |
| 635 | + ** url_parse_local() understands. Show it as it is. */ | |
| 636 | + @ <tr><td width='100%%'>%h(zURL) | |
| 637 | + } | |
| 629 | 638 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 630 | 639 | cnt++; |
| 631 | - url_unparse(&x); | |
| 632 | 640 | } |
| 633 | 641 | db_finalize(&q); |
| 634 | 642 | if( cnt ){ |
| 635 | 643 | @ </table> |
| 636 | 644 | total += cnt; |
| 637 | 645 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -621,16 +621,24 @@ | |
| 621 | UrlData x; |
| 622 | if( cnt==0 ){ |
| 623 | @ <div class="section">Recently synced with these URLs</div> |
| 624 | @ <table border='0' width='100%%'> |
| 625 | } |
| 626 | memset(&x, 0, sizeof(x)); |
| 627 | url_parse_local(zURL, URL_OMIT_USER, &x); |
| 628 | @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a> |
| 629 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 630 | cnt++; |
| 631 | url_unparse(&x); |
| 632 | } |
| 633 | db_finalize(&q); |
| 634 | if( cnt ){ |
| 635 | @ </table> |
| 636 | total += cnt; |
| 637 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -621,16 +621,24 @@ | |
| 621 | UrlData x; |
| 622 | if( cnt==0 ){ |
| 623 | @ <div class="section">Recently synced with these URLs</div> |
| 624 | @ <table border='0' width='100%%'> |
| 625 | } |
| 626 | if( fossil_strnicmp(zURL, "http://", 7)==0 |
| 627 | || fossil_strnicmp(zURL, "https://", 8)==0 |
| 628 | ){ |
| 629 | memset(&x, 0, sizeof(x)); |
| 630 | url_parse_local(zURL, URL_OMIT_USER, &x); |
| 631 | @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a> |
| 632 | url_unparse(&x); |
| 633 | }else{ |
| 634 | /* A gitpush address such as git@host:path is not a URL that |
| 635 | ** url_parse_local() understands. Show it as it is. */ |
| 636 | @ <tr><td width='100%%'>%h(zURL) |
| 637 | } |
| 638 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 639 | cnt++; |
| 640 | } |
| 641 | db_finalize(&q); |
| 642 | if( cnt ){ |
| 643 | @ </table> |
| 644 | total += cnt; |
| 645 |
+2
-2
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -435,11 +435,11 @@ | ||
| 435 | 435 | ** with a P-card, it gets translated to the |
| 436 | 436 | ** oldest parent of that artifact and |
| 437 | 437 | ** --propagate is assumed. This is |
| 438 | 438 | ** most useful with forum posts, wiki |
| 439 | 439 | ** pages, and tech notes, where tags are |
| 440 | -** most easliy managed via their initial | |
| 440 | +** most easily managed via their initial | |
| 441 | 441 | ** version. |
| 442 | 442 | ** |
| 443 | 443 | ** The --date-override and --user-override options support |
| 444 | 444 | ** importing history from other SCM systems. DATETIME has |
| 445 | 445 | ** the form 'YYYY-MM-DD HH:MM:SS'. |
| @@ -490,11 +490,11 @@ | ||
| 490 | 490 | ** scripting compatibility, the internal tag types "wiki-", |
| 491 | 491 | ** "tkt-", and "event-" (technote) are elided by default |
| 492 | 492 | ** unless the --raw or --prefix options are used. |
| 493 | 493 | ** |
| 494 | 494 | ** Options: |
| 495 | -** -v|--inverse Inverse the meaning of --tagtype TYPE | |
| 495 | +** -v|--inverse Invert the meaning of --tagtype TYPE | |
| 496 | 496 | ** --prefix List only tags with the given prefix |
| 497 | 497 | ** Fossil-internal prefixes include "sym-" |
| 498 | 498 | ** (branch name), "wiki-", "event-" |
| 499 | 499 | ** (technote), and "tkt-" (ticket). The |
| 500 | 500 | ** prefix is stripped from the resulting |
| 501 | 501 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | ** with a P-card, it gets translated to the |
| 436 | ** oldest parent of that artifact and |
| 437 | ** --propagate is assumed. This is |
| 438 | ** most useful with forum posts, wiki |
| 439 | ** pages, and tech notes, where tags are |
| 440 | ** most easliy managed via their initial |
| 441 | ** version. |
| 442 | ** |
| 443 | ** The --date-override and --user-override options support |
| 444 | ** importing history from other SCM systems. DATETIME has |
| 445 | ** the form 'YYYY-MM-DD HH:MM:SS'. |
| @@ -490,11 +490,11 @@ | |
| 490 | ** scripting compatibility, the internal tag types "wiki-", |
| 491 | ** "tkt-", and "event-" (technote) are elided by default |
| 492 | ** unless the --raw or --prefix options are used. |
| 493 | ** |
| 494 | ** Options: |
| 495 | ** -v|--inverse Inverse the meaning of --tagtype TYPE |
| 496 | ** --prefix List only tags with the given prefix |
| 497 | ** Fossil-internal prefixes include "sym-" |
| 498 | ** (branch name), "wiki-", "event-" |
| 499 | ** (technote), and "tkt-" (ticket). The |
| 500 | ** prefix is stripped from the resulting |
| 501 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | ** with a P-card, it gets translated to the |
| 436 | ** oldest parent of that artifact and |
| 437 | ** --propagate is assumed. This is |
| 438 | ** most useful with forum posts, wiki |
| 439 | ** pages, and tech notes, where tags are |
| 440 | ** most easily managed via their initial |
| 441 | ** version. |
| 442 | ** |
| 443 | ** The --date-override and --user-override options support |
| 444 | ** importing history from other SCM systems. DATETIME has |
| 445 | ** the form 'YYYY-MM-DD HH:MM:SS'. |
| @@ -490,11 +490,11 @@ | |
| 490 | ** scripting compatibility, the internal tag types "wiki-", |
| 491 | ** "tkt-", and "event-" (technote) are elided by default |
| 492 | ** unless the --raw or --prefix options are used. |
| 493 | ** |
| 494 | ** Options: |
| 495 | ** -v|--inverse Invert the meaning of --tagtype TYPE |
| 496 | ** --prefix List only tags with the given prefix |
| 497 | ** Fossil-internal prefixes include "sym-" |
| 498 | ** (branch name), "wiki-", "event-" |
| 499 | ** (technote), and "tkt-" (ticket). The |
| 500 | ** prefix is stripped from the resulting |
| 501 |
+3
-3
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -915,21 +915,21 @@ | ||
| 915 | 915 | ** |
| 916 | 916 | ** r=TAG TAG identifies the check-in that is turned into a |
| 917 | 917 | ** compressed tarball. The default value is the name of |
| 918 | 918 | ** the main branch (usually "trunk"). |
| 919 | 919 | ** If r= is omitted and if the name= query parameter |
| 920 | -** contains one "/" character then the of part the | |
| 920 | +** contains one "/" character then the part of the | |
| 921 | 921 | ** name= value before the / becomes the TAG and the |
| 922 | 922 | ** part of the name= value after the / is the download |
| 923 | 923 | ** filename. If no check-in is specified by either |
| 924 | 924 | ** name= or r=, then the name of the main branch |
| 925 | 925 | ** (usually "trunk") is used. |
| 926 | 926 | ** |
| 927 | 927 | ** in=PATTERN Only include files that match the comma-separated |
| 928 | 928 | ** list of GLOB patterns in PATTERN, as with ex= |
| 929 | 929 | ** |
| 930 | -** ex=PATTERN Omit any file that match PATTERN. PATTERN is a | |
| 930 | +** ex=PATTERN Omit any file that matches PATTERN. PATTERN is a | |
| 931 | 931 | ** comma-separated list of GLOB patterns, where each |
| 932 | 932 | ** pattern can optionally be quoted using ".." or '..'. |
| 933 | 933 | ** Any file matching both ex= and in= is excluded. |
| 934 | 934 | ** |
| 935 | 935 | ** Robot Defenses: |
| @@ -1108,11 +1108,11 @@ | ||
| 1108 | 1108 | ** The items in each group are: |
| 1109 | 1109 | ** |
| 1110 | 1110 | ** | COUNT TAG MAX_AGE COMMENT |
| 1111 | 1111 | ** |
| 1112 | 1112 | ** COUNT is the number of check-ins to match, starting with the most |
| 1113 | -** recent and working bacwards in time. Check-ins match if they contain | |
| 1113 | +** recent and working backwards in time. Check-ins match if they contain | |
| 1114 | 1114 | ** the tag TAG. If MAX_AGE is not an empty string, then it specifies |
| 1115 | 1115 | ** the maximum age of any matching check-in. COMMENT is an optional |
| 1116 | 1116 | ** comment for each match. |
| 1117 | 1117 | ** |
| 1118 | 1118 | ** The special value of "OPEN-LEAF" for TAG matches any check-in that |
| 1119 | 1119 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -915,21 +915,21 @@ | |
| 915 | ** |
| 916 | ** r=TAG TAG identifies the check-in that is turned into a |
| 917 | ** compressed tarball. The default value is the name of |
| 918 | ** the main branch (usually "trunk"). |
| 919 | ** If r= is omitted and if the name= query parameter |
| 920 | ** contains one "/" character then the of part the |
| 921 | ** name= value before the / becomes the TAG and the |
| 922 | ** part of the name= value after the / is the download |
| 923 | ** filename. If no check-in is specified by either |
| 924 | ** name= or r=, then the name of the main branch |
| 925 | ** (usually "trunk") is used. |
| 926 | ** |
| 927 | ** in=PATTERN Only include files that match the comma-separated |
| 928 | ** list of GLOB patterns in PATTERN, as with ex= |
| 929 | ** |
| 930 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| 931 | ** comma-separated list of GLOB patterns, where each |
| 932 | ** pattern can optionally be quoted using ".." or '..'. |
| 933 | ** Any file matching both ex= and in= is excluded. |
| 934 | ** |
| 935 | ** Robot Defenses: |
| @@ -1108,11 +1108,11 @@ | |
| 1108 | ** The items in each group are: |
| 1109 | ** |
| 1110 | ** | COUNT TAG MAX_AGE COMMENT |
| 1111 | ** |
| 1112 | ** COUNT is the number of check-ins to match, starting with the most |
| 1113 | ** recent and working bacwards in time. Check-ins match if they contain |
| 1114 | ** the tag TAG. If MAX_AGE is not an empty string, then it specifies |
| 1115 | ** the maximum age of any matching check-in. COMMENT is an optional |
| 1116 | ** comment for each match. |
| 1117 | ** |
| 1118 | ** The special value of "OPEN-LEAF" for TAG matches any check-in that |
| 1119 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -915,21 +915,21 @@ | |
| 915 | ** |
| 916 | ** r=TAG TAG identifies the check-in that is turned into a |
| 917 | ** compressed tarball. The default value is the name of |
| 918 | ** the main branch (usually "trunk"). |
| 919 | ** If r= is omitted and if the name= query parameter |
| 920 | ** contains one "/" character then the part of the |
| 921 | ** name= value before the / becomes the TAG and the |
| 922 | ** part of the name= value after the / is the download |
| 923 | ** filename. If no check-in is specified by either |
| 924 | ** name= or r=, then the name of the main branch |
| 925 | ** (usually "trunk") is used. |
| 926 | ** |
| 927 | ** in=PATTERN Only include files that match the comma-separated |
| 928 | ** list of GLOB patterns in PATTERN, as with ex= |
| 929 | ** |
| 930 | ** ex=PATTERN Omit any file that matches PATTERN. PATTERN is a |
| 931 | ** comma-separated list of GLOB patterns, where each |
| 932 | ** pattern can optionally be quoted using ".." or '..'. |
| 933 | ** Any file matching both ex= and in= is excluded. |
| 934 | ** |
| 935 | ** Robot Defenses: |
| @@ -1108,11 +1108,11 @@ | |
| 1108 | ** The items in each group are: |
| 1109 | ** |
| 1110 | ** | COUNT TAG MAX_AGE COMMENT |
| 1111 | ** |
| 1112 | ** COUNT is the number of check-ins to match, starting with the most |
| 1113 | ** recent and working backwards in time. Check-ins match if they contain |
| 1114 | ** the tag TAG. If MAX_AGE is not an empty string, then it specifies |
| 1115 | ** the maximum age of any matching check-in. COMMENT is an optional |
| 1116 | ** comment for each match. |
| 1117 | ** |
| 1118 | ** The special value of "OPEN-LEAF" for TAG matches any check-in that |
| 1119 |
+3
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1858,15 +1858,15 @@ | ||
| 1858 | 1858 | ** forks Show only forks and their children |
| 1859 | 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | -** ymd=YYYYMMDD Show only events on the given day. The use "ymd=now" | |
| 1863 | +** ymd=YYYYMMDD Show only events on the given day. Use "ymd=now" | |
| 1864 | 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | -** year=YYYY Show only events on the given year. The use "year=0" | |
| 1867 | +** year=YYYY Show only events on the given year. Use "year=0" | |
| 1868 | 1868 | ** to see all changes for the current year. |
| 1869 | 1869 | ** days=N Show events over the previous N days |
| 1870 | 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | ||
| 3984 | 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | 3988 | ** the current check-out's repository. |
| 3989 | -** -s|--summmary Truncate comments after the first blank line. | |
| 3989 | +** -s|--summary Truncate comments after the first blank line. | |
| 3990 | 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | 3992 | ** ci = file commits only |
| 3993 | 3993 | ** e = technical notes only |
| 3994 | 3994 | ** f = forum posts only |
| 3995 | 3995 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1858,15 +1858,15 @@ | |
| 1858 | ** forks Show only forks and their children |
| 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | ** ymd=YYYYMMDD Show only events on the given day. The use "ymd=now" |
| 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | ** year=YYYY Show only events on the given year. The use "year=0" |
| 1868 | ** to see all changes for the current year. |
| 1869 | ** days=N Show events over the previous N days |
| 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | |
| 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | ** the current check-out's repository. |
| 3989 | ** -s|--summmary Truncate comments after the first blank line. |
| 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | ** ci = file commits only |
| 3993 | ** e = technical notes only |
| 3994 | ** f = forum posts only |
| 3995 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1858,15 +1858,15 @@ | |
| 1858 | ** forks Show only forks and their children |
| 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | ** ymd=YYYYMMDD Show only events on the given day. Use "ymd=now" |
| 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | ** year=YYYY Show only events on the given year. Use "year=0" |
| 1868 | ** to see all changes for the current year. |
| 1869 | ** days=N Show events over the previous N days |
| 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | |
| 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | ** the current check-out's repository. |
| 3989 | ** -s|--summary Truncate comments after the first blank line. |
| 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | ** ci = file commits only |
| 3993 | ** e = technical notes only |
| 3994 | ** f = forum posts only |
| 3995 |
+3
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1858,15 +1858,15 @@ | ||
| 1858 | 1858 | ** forks Show only forks and their children |
| 1859 | 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | -** ymd=YYYYMMDD Show only events on the given day. The use "ymd=now" | |
| 1863 | +** ymd=YYYYMMDD Show only events on the given day. Use "ymd=now" | |
| 1864 | 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | -** year=YYYY Show only events on the given year. The use "year=0" | |
| 1867 | +** year=YYYY Show only events on the given year. Use "year=0" | |
| 1868 | 1868 | ** to see all changes for the current year. |
| 1869 | 1869 | ** days=N Show events over the previous N days |
| 1870 | 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | ||
| 3984 | 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | 3988 | ** the current check-out's repository. |
| 3989 | -** -s|--summmary Truncate comments after the first blank line. | |
| 3989 | +** -s|--summary Truncate comments after the first blank line. | |
| 3990 | 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | 3992 | ** ci = file commits only |
| 3993 | 3993 | ** e = technical notes only |
| 3994 | 3994 | ** f = forum posts only |
| 3995 | 3995 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1858,15 +1858,15 @@ | |
| 1858 | ** forks Show only forks and their children |
| 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | ** ymd=YYYYMMDD Show only events on the given day. The use "ymd=now" |
| 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | ** year=YYYY Show only events on the given year. The use "year=0" |
| 1868 | ** to see all changes for the current year. |
| 1869 | ** days=N Show events over the previous N days |
| 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | |
| 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | ** the current check-out's repository. |
| 3989 | ** -s|--summmary Truncate comments after the first blank line. |
| 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | ** ci = file commits only |
| 3993 | ** e = technical notes only |
| 3994 | ** f = forum posts only |
| 3995 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1858,15 +1858,15 @@ | |
| 1858 | ** forks Show only forks and their children |
| 1859 | ** cherrypicks Show all cherrypicks |
| 1860 | ** ym=YYYYMM Show only events for the given year/month |
| 1861 | ** yw=YYYYWW Show only events for the given week of the given year |
| 1862 | ** yw=YYYYMMDD Show events for the week that includes the given day |
| 1863 | ** ymd=YYYYMMDD Show only events on the given day. Use "ymd=now" |
| 1864 | ** to see all changes for the current week. Add "z" at end |
| 1865 | ** to divide days at UTC instead of localtime days. |
| 1866 | ** Use ymd=YYYYMMDD-YYYYMMDD (with optional "z") for a range. |
| 1867 | ** year=YYYY Show only events on the given year. Use "year=0" |
| 1868 | ** to see all changes for the current year. |
| 1869 | ** days=N Show events over the previous N days |
| 1870 | ** datefmt=N Override the date format: 0=HH:MM, 1=HH:MM:SS, |
| 1871 | ** 2=YYYY-MM-DD HH:MM:SS, 3=YYMMDD HH:MM, and 4 means "off". |
| 1872 | ** bisect Show the check-ins that are in the current bisect |
| @@ -3984,11 +3984,11 @@ | |
| 3984 | ** PATH can be a file or a subdirectory. |
| 3985 | ** -q|--quiet Do not print notifications at the end of the timeline. |
| 3986 | ** -r|--reverse Show items in chronological order. |
| 3987 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 3988 | ** the current check-out's repository. |
| 3989 | ** -s|--summary Truncate comments after the first blank line. |
| 3990 | ** --sql Show the SQL used to generate the timeline |
| 3991 | ** -t|--type TYPE Output items from the given types only, such as: |
| 3992 | ** ci = file commits only |
| 3993 | ** e = technical notes only |
| 3994 | ** f = forum posts only |
| 3995 |
+11
-1
| --- src/utf8.c | ||
| +++ src/utf8.c | ||
| @@ -140,11 +140,21 @@ | ||
| 140 | 140 | #elif defined(__CYGWIN__) |
| 141 | 141 | char *zOut; |
| 142 | 142 | zOut = fossil_strdup(zPath); |
| 143 | 143 | return zOut; |
| 144 | 144 | #elif defined(__APPLE__) && !defined(WITHOUT_ICONV) |
| 145 | - char *zIn = (char*)zPath; | |
| 145 | + /* macOS gives us a pathname already in Apple's decomposed form. HFS+ | |
| 146 | + ** stores names "fully decomposed and in canonical order" as per Unicode | |
| 147 | + ** 3.2, while APFS uses the same decomposed form but compares names | |
| 148 | + ** normalization-insensitively as per Unicode 9.0 basis (see Apple TN1150, | |
| 149 | + ** "Unicode Subtleties"; Apple File System Guide FAQ). iconv from | |
| 150 | + ** UTF-8-MAC recomposes the sequence to precomposed UTF-8. So this is a | |
| 151 | + ** composition pass, not full NFC. This function relies on the marks being | |
| 152 | + ** in canonical order as per a real macOS pathname, and it doesn't touch | |
| 153 | + ** characters Apple does not decompose, such as the U+F900-U+FAFF CJK | |
| 154 | + ** compatibility ideographs, again as per Apple documentation. */ | |
| 155 | + char *zIn = (char*)zPath; | |
| 146 | 156 | char *zOut; |
| 147 | 157 | iconv_t cd; |
| 148 | 158 | size_t n, x; |
| 149 | 159 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 150 | 160 | if( zIn[n]!=0 && (cd = iconv_open("UTF-8", "UTF-8-MAC"))!=(iconv_t)-1 ){ |
| 151 | 161 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -140,11 +140,21 @@ | |
| 140 | #elif defined(__CYGWIN__) |
| 141 | char *zOut; |
| 142 | zOut = fossil_strdup(zPath); |
| 143 | return zOut; |
| 144 | #elif defined(__APPLE__) && !defined(WITHOUT_ICONV) |
| 145 | char *zIn = (char*)zPath; |
| 146 | char *zOut; |
| 147 | iconv_t cd; |
| 148 | size_t n, x; |
| 149 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 150 | if( zIn[n]!=0 && (cd = iconv_open("UTF-8", "UTF-8-MAC"))!=(iconv_t)-1 ){ |
| 151 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -140,11 +140,21 @@ | |
| 140 | #elif defined(__CYGWIN__) |
| 141 | char *zOut; |
| 142 | zOut = fossil_strdup(zPath); |
| 143 | return zOut; |
| 144 | #elif defined(__APPLE__) && !defined(WITHOUT_ICONV) |
| 145 | /* macOS gives us a pathname already in Apple's decomposed form. HFS+ |
| 146 | ** stores names "fully decomposed and in canonical order" as per Unicode |
| 147 | ** 3.2, while APFS uses the same decomposed form but compares names |
| 148 | ** normalization-insensitively as per Unicode 9.0 basis (see Apple TN1150, |
| 149 | ** "Unicode Subtleties"; Apple File System Guide FAQ). iconv from |
| 150 | ** UTF-8-MAC recomposes the sequence to precomposed UTF-8. So this is a |
| 151 | ** composition pass, not full NFC. This function relies on the marks being |
| 152 | ** in canonical order as per a real macOS pathname, and it doesn't touch |
| 153 | ** characters Apple does not decompose, such as the U+F900-U+FAFF CJK |
| 154 | ** compatibility ideographs, again as per Apple documentation. */ |
| 155 | char *zIn = (char*)zPath; |
| 156 | char *zOut; |
| 157 | iconv_t cd; |
| 158 | size_t n, x; |
| 159 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 160 | if( zIn[n]!=0 && (cd = iconv_open("UTF-8", "UTF-8-MAC"))!=(iconv_t)-1 ){ |
| 161 |
+41
-12
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -168,27 +168,56 @@ | ||
| 168 | 168 | "text/x-markdown", "Markdown", "markdown", |
| 169 | 169 | "text/plain", "Plain Text", "plain" |
| 170 | 170 | }; |
| 171 | 171 | |
| 172 | 172 | /* |
| 173 | -** Only allow certain mimetypes through. | |
| 174 | -** All others become "text/x-fossil-wiki" | |
| 173 | +** If zMimetype is one of the supported wiki content mimetypes or a | |
| 174 | +** shorthand form of it, returns the full mimetype string, else | |
| 175 | +** returns 0. | |
| 176 | +*/ | |
| 177 | +const char * wiki_is_valid_mimetype(const char *zMimetype){ | |
| 178 | + int i; | |
| 179 | + for(i=0; i<count(azStyles); i+=3){ | |
| 180 | + if( fossil_strcmp(zMimetype,azStyles[i+2])==0 | |
| 181 | + || fossil_strcmp(zMimetype,azStyles[i])==0 ){ | |
| 182 | + return azStyles[i]; | |
| 183 | + } | |
| 184 | + } | |
| 185 | + if( fossil_strcmp(zMimetype, "text/x-markdown")==0 | |
| 186 | + || fossil_strcmp(zMimetype, "text/plain")==0 ){ | |
| 187 | + return zMimetype; | |
| 188 | + } | |
| 189 | + if( fossil_strcmp(zMimetype, "plaintext")==0 ){ | |
| 190 | + /* Inconsistent "plain" vs "plaintext" in some commands/API. */ | |
| 191 | + return "text/plain"; | |
| 192 | + } | |
| 193 | + return 0; | |
| 194 | +} | |
| 195 | + | |
| 196 | +/* | |
| 197 | +** Only allow certain mimetypes through. All others become | |
| 198 | +** "text/x-fossil-wiki". See wiki_is_valid_mimetype(). | |
| 175 | 199 | */ |
| 176 | 200 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 177 | 201 | if( zMimetype!=0 ){ |
| 178 | - int i; | |
| 179 | - for(i=0; i<count(azStyles); i+=3){ | |
| 180 | - if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ | |
| 181 | - return azStyles[i]; | |
| 182 | - } | |
| 183 | - } | |
| 184 | - if( fossil_strcmp(zMimetype, "text/x-markdown")==0 | |
| 185 | - || fossil_strcmp(zMimetype, "text/plain")==0 ){ | |
| 186 | - return zMimetype; | |
| 202 | + zMimetype = wiki_is_valid_mimetype(zMimetype); | |
| 203 | + } | |
| 204 | + return zMimetype ? zMimetype : "text/x-fossil-wiki"; | |
| 205 | +} | |
| 206 | + | |
| 207 | +char const *wiki_guess_filename_mimetype(const char *zFilename, | |
| 208 | + const char *zDefault){ | |
| 209 | + if( zFilename ){ | |
| 210 | + if( 0==sqlite3_strglob("*.md", zFilename) ){ | |
| 211 | + return "text/x-markdown"; | |
| 212 | + }else if( 0==sqlite3_strglob("*.txt", zFilename) ){ | |
| 213 | + return "text/plain"; | |
| 214 | + }else if( 0==sqlite3_strglob("*.wiki", zFilename) ){ | |
| 215 | + return "text/x-fossil-wiki"; | |
| 187 | 216 | } |
| 188 | 217 | } |
| 189 | - return "text/x-fossil-wiki"; | |
| 218 | + return 0; | |
| 190 | 219 | } |
| 191 | 220 | |
| 192 | 221 | /* |
| 193 | 222 | ** Render wiki text according to its mimetype. |
| 194 | 223 | ** |
| 195 | 224 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -168,27 +168,56 @@ | |
| 168 | "text/x-markdown", "Markdown", "markdown", |
| 169 | "text/plain", "Plain Text", "plain" |
| 170 | }; |
| 171 | |
| 172 | /* |
| 173 | ** Only allow certain mimetypes through. |
| 174 | ** All others become "text/x-fossil-wiki" |
| 175 | */ |
| 176 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 177 | if( zMimetype!=0 ){ |
| 178 | int i; |
| 179 | for(i=0; i<count(azStyles); i+=3){ |
| 180 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 181 | return azStyles[i]; |
| 182 | } |
| 183 | } |
| 184 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| 185 | || fossil_strcmp(zMimetype, "text/plain")==0 ){ |
| 186 | return zMimetype; |
| 187 | } |
| 188 | } |
| 189 | return "text/x-fossil-wiki"; |
| 190 | } |
| 191 | |
| 192 | /* |
| 193 | ** Render wiki text according to its mimetype. |
| 194 | ** |
| 195 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -168,27 +168,56 @@ | |
| 168 | "text/x-markdown", "Markdown", "markdown", |
| 169 | "text/plain", "Plain Text", "plain" |
| 170 | }; |
| 171 | |
| 172 | /* |
| 173 | ** If zMimetype is one of the supported wiki content mimetypes or a |
| 174 | ** shorthand form of it, returns the full mimetype string, else |
| 175 | ** returns 0. |
| 176 | */ |
| 177 | const char * wiki_is_valid_mimetype(const char *zMimetype){ |
| 178 | int i; |
| 179 | for(i=0; i<count(azStyles); i+=3){ |
| 180 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 |
| 181 | || fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 182 | return azStyles[i]; |
| 183 | } |
| 184 | } |
| 185 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| 186 | || fossil_strcmp(zMimetype, "text/plain")==0 ){ |
| 187 | return zMimetype; |
| 188 | } |
| 189 | if( fossil_strcmp(zMimetype, "plaintext")==0 ){ |
| 190 | /* Inconsistent "plain" vs "plaintext" in some commands/API. */ |
| 191 | return "text/plain"; |
| 192 | } |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | /* |
| 197 | ** Only allow certain mimetypes through. All others become |
| 198 | ** "text/x-fossil-wiki". See wiki_is_valid_mimetype(). |
| 199 | */ |
| 200 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 201 | if( zMimetype!=0 ){ |
| 202 | zMimetype = wiki_is_valid_mimetype(zMimetype); |
| 203 | } |
| 204 | return zMimetype ? zMimetype : "text/x-fossil-wiki"; |
| 205 | } |
| 206 | |
| 207 | char const *wiki_guess_filename_mimetype(const char *zFilename, |
| 208 | const char *zDefault){ |
| 209 | if( zFilename ){ |
| 210 | if( 0==sqlite3_strglob("*.md", zFilename) ){ |
| 211 | return "text/x-markdown"; |
| 212 | }else if( 0==sqlite3_strglob("*.txt", zFilename) ){ |
| 213 | return "text/plain"; |
| 214 | }else if( 0==sqlite3_strglob("*.wiki", zFilename) ){ |
| 215 | return "text/x-fossil-wiki"; |
| 216 | } |
| 217 | } |
| 218 | return 0; |
| 219 | } |
| 220 | |
| 221 | /* |
| 222 | ** Render wiki text according to its mimetype. |
| 223 | ** |
| 224 |
+2
-2
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -984,21 +984,21 @@ | ||
| 984 | 984 | ** |
| 985 | 985 | ** r=TAG TAG identifies the check-in that is turned into an |
| 986 | 986 | ** SQL or ZIP archive. The default value is the name |
| 987 | 987 | ** of the main branch (usually "trunk"). |
| 988 | 988 | ** If r= is omitted and if the name= query parameter |
| 989 | -** contains one "/" character then the of part the | |
| 989 | +** contains one "/" character then the part of the | |
| 990 | 990 | ** name= value before the / becomes the TAG and the |
| 991 | 991 | ** part of the name= value after the / is the download |
| 992 | 992 | ** filename. If no check-in is specified by either |
| 993 | 993 | ** name= or r=, then the name of the main branch |
| 994 | 994 | ** (usually "trunk") is used. |
| 995 | 995 | ** |
| 996 | 996 | ** in=PATTERN Only include files that match the comma-separated |
| 997 | 997 | ** list of GLOB patterns in PATTERN, as with ex= |
| 998 | 998 | ** |
| 999 | -** ex=PATTERN Omit any file that match PATTERN. PATTERN is a | |
| 999 | +** ex=PATTERN Omit any file that matches PATTERN. PATTERN is a | |
| 1000 | 1000 | ** comma-separated list of GLOB patterns, where each |
| 1001 | 1001 | ** pattern can optionally be quoted using ".." or '..'. |
| 1002 | 1002 | ** Any file matching both ex= and in= is excluded. |
| 1003 | 1003 | ** |
| 1004 | 1004 | ** Robot Defenses: |
| 1005 | 1005 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -984,21 +984,21 @@ | |
| 984 | ** |
| 985 | ** r=TAG TAG identifies the check-in that is turned into an |
| 986 | ** SQL or ZIP archive. The default value is the name |
| 987 | ** of the main branch (usually "trunk"). |
| 988 | ** If r= is omitted and if the name= query parameter |
| 989 | ** contains one "/" character then the of part the |
| 990 | ** name= value before the / becomes the TAG and the |
| 991 | ** part of the name= value after the / is the download |
| 992 | ** filename. If no check-in is specified by either |
| 993 | ** name= or r=, then the name of the main branch |
| 994 | ** (usually "trunk") is used. |
| 995 | ** |
| 996 | ** in=PATTERN Only include files that match the comma-separated |
| 997 | ** list of GLOB patterns in PATTERN, as with ex= |
| 998 | ** |
| 999 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| 1000 | ** comma-separated list of GLOB patterns, where each |
| 1001 | ** pattern can optionally be quoted using ".." or '..'. |
| 1002 | ** Any file matching both ex= and in= is excluded. |
| 1003 | ** |
| 1004 | ** Robot Defenses: |
| 1005 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -984,21 +984,21 @@ | |
| 984 | ** |
| 985 | ** r=TAG TAG identifies the check-in that is turned into an |
| 986 | ** SQL or ZIP archive. The default value is the name |
| 987 | ** of the main branch (usually "trunk"). |
| 988 | ** If r= is omitted and if the name= query parameter |
| 989 | ** contains one "/" character then the part of the |
| 990 | ** name= value before the / becomes the TAG and the |
| 991 | ** part of the name= value after the / is the download |
| 992 | ** filename. If no check-in is specified by either |
| 993 | ** name= or r=, then the name of the main branch |
| 994 | ** (usually "trunk") is used. |
| 995 | ** |
| 996 | ** in=PATTERN Only include files that match the comma-separated |
| 997 | ** list of GLOB patterns in PATTERN, as with ex= |
| 998 | ** |
| 999 | ** ex=PATTERN Omit any file that matches PATTERN. PATTERN is a |
| 1000 | ** comma-separated list of GLOB patterns, where each |
| 1001 | ** pattern can optionally be quoted using ".." or '..'. |
| 1002 | ** Any file matching both ex= and in= is excluded. |
| 1003 | ** |
| 1004 | ** Robot Defenses: |
| 1005 |