Fossil SCM
Relax the lexigraphical ordering requirement on manifests. Now the lines of a manifest (or cluster or control file) must occur in lexigraphical order after the arguments have been defossilized.
Commit
dea1ae50d3f9d7e76de5aa2fe93bb80e08af4aa0
Parent
17596784d040118…
1 file changed
+3
-4
+3
-4
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -100,11 +100,11 @@ | ||
| 100 | 100 | int manifest_parse(Manifest *p, Blob *pContent){ |
| 101 | 101 | int seenHeader = 0; |
| 102 | 102 | int i; |
| 103 | 103 | Blob line, token, a1, a2, a3; |
| 104 | 104 | Blob selfuuid; |
| 105 | - char zPrevLine[10]; | |
| 105 | + char cPrevType = 0; | |
| 106 | 106 | |
| 107 | 107 | memset(p, 0, sizeof(*p)); |
| 108 | 108 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 109 | 109 | sha1sum_blob(&p->content, &selfuuid); |
| 110 | 110 | memcpy(p->zUuid, blob_buffer(&selfuuid), UUID_SIZE); |
| @@ -113,11 +113,10 @@ | ||
| 113 | 113 | pContent = &p->content; |
| 114 | 114 | |
| 115 | 115 | blob_zero(&a1); |
| 116 | 116 | blob_zero(&a2); |
| 117 | 117 | md5sum_init(); |
| 118 | - zPrevLine[0] = 0; | |
| 119 | 118 | while( blob_line(pContent, &line) ){ |
| 120 | 119 | char *z = blob_buffer(&line); |
| 121 | 120 | if( z[0]=='-' ){ |
| 122 | 121 | if( strncmp(z, "-----BEGIN PGP ", 15)!=0 ){ |
| 123 | 122 | goto manifest_syntax_error; |
| @@ -127,15 +126,15 @@ | ||
| 127 | 126 | } |
| 128 | 127 | while( blob_line(pContent, &line)>2 ){} |
| 129 | 128 | if( blob_line(pContent, &line)==0 ) break; |
| 130 | 129 | z = blob_buffer(&line); |
| 131 | 130 | } |
| 132 | - if( strcmp(z, zPrevLine)<0 ){ | |
| 131 | + if( z[0]<cPrevType ){ | |
| 133 | 132 | /* Lines of a manifest must occur in lexicographical order */ |
| 134 | 133 | goto manifest_syntax_error; |
| 135 | 134 | } |
| 136 | - sqlite3_snprintf(sizeof(zPrevLine), zPrevLine, "%s", z); | |
| 135 | + cPrevType = z[0]; | |
| 137 | 136 | seenHeader = 1; |
| 138 | 137 | if( blob_token(&line, &token)!=1 ) goto manifest_syntax_error; |
| 139 | 138 | switch( z[0] ){ |
| 140 | 139 | /* |
| 141 | 140 | ** C <comment> |
| 142 | 141 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | int manifest_parse(Manifest *p, Blob *pContent){ |
| 101 | int seenHeader = 0; |
| 102 | int i; |
| 103 | Blob line, token, a1, a2, a3; |
| 104 | Blob selfuuid; |
| 105 | char zPrevLine[10]; |
| 106 | |
| 107 | memset(p, 0, sizeof(*p)); |
| 108 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 109 | sha1sum_blob(&p->content, &selfuuid); |
| 110 | memcpy(p->zUuid, blob_buffer(&selfuuid), UUID_SIZE); |
| @@ -113,11 +113,10 @@ | |
| 113 | pContent = &p->content; |
| 114 | |
| 115 | blob_zero(&a1); |
| 116 | blob_zero(&a2); |
| 117 | md5sum_init(); |
| 118 | zPrevLine[0] = 0; |
| 119 | while( blob_line(pContent, &line) ){ |
| 120 | char *z = blob_buffer(&line); |
| 121 | if( z[0]=='-' ){ |
| 122 | if( strncmp(z, "-----BEGIN PGP ", 15)!=0 ){ |
| 123 | goto manifest_syntax_error; |
| @@ -127,15 +126,15 @@ | |
| 127 | } |
| 128 | while( blob_line(pContent, &line)>2 ){} |
| 129 | if( blob_line(pContent, &line)==0 ) break; |
| 130 | z = blob_buffer(&line); |
| 131 | } |
| 132 | if( strcmp(z, zPrevLine)<0 ){ |
| 133 | /* Lines of a manifest must occur in lexicographical order */ |
| 134 | goto manifest_syntax_error; |
| 135 | } |
| 136 | sqlite3_snprintf(sizeof(zPrevLine), zPrevLine, "%s", z); |
| 137 | seenHeader = 1; |
| 138 | if( blob_token(&line, &token)!=1 ) goto manifest_syntax_error; |
| 139 | switch( z[0] ){ |
| 140 | /* |
| 141 | ** C <comment> |
| 142 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | int manifest_parse(Manifest *p, Blob *pContent){ |
| 101 | int seenHeader = 0; |
| 102 | int i; |
| 103 | Blob line, token, a1, a2, a3; |
| 104 | Blob selfuuid; |
| 105 | char cPrevType = 0; |
| 106 | |
| 107 | memset(p, 0, sizeof(*p)); |
| 108 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 109 | sha1sum_blob(&p->content, &selfuuid); |
| 110 | memcpy(p->zUuid, blob_buffer(&selfuuid), UUID_SIZE); |
| @@ -113,11 +113,10 @@ | |
| 113 | pContent = &p->content; |
| 114 | |
| 115 | blob_zero(&a1); |
| 116 | blob_zero(&a2); |
| 117 | md5sum_init(); |
| 118 | while( blob_line(pContent, &line) ){ |
| 119 | char *z = blob_buffer(&line); |
| 120 | if( z[0]=='-' ){ |
| 121 | if( strncmp(z, "-----BEGIN PGP ", 15)!=0 ){ |
| 122 | goto manifest_syntax_error; |
| @@ -127,15 +126,15 @@ | |
| 126 | } |
| 127 | while( blob_line(pContent, &line)>2 ){} |
| 128 | if( blob_line(pContent, &line)==0 ) break; |
| 129 | z = blob_buffer(&line); |
| 130 | } |
| 131 | if( z[0]<cPrevType ){ |
| 132 | /* Lines of a manifest must occur in lexicographical order */ |
| 133 | goto manifest_syntax_error; |
| 134 | } |
| 135 | cPrevType = z[0]; |
| 136 | seenHeader = 1; |
| 137 | if( blob_token(&line, &token)!=1 ) goto manifest_syntax_error; |
| 138 | switch( z[0] ){ |
| 139 | /* |
| 140 | ** C <comment> |
| 141 |