Differences From:
File
src/manifest.c
part of check-in
[09c4adeb6f]
- Rework the tag system so that propagation to children is a property
of each tag and does not depend on the tag name beginning with "br".
Older tag artifacts might not work. The database will need to be
rebuilt after upgrading to this version.
by
drh on
2007-09-22 23:41:29.
[view]
To:
File
src/manifest.c
part of check-in
[dea1ae50d3]
- 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.
by
drh on
2007-09-23 11:43:40.
[view]
@@ -101,9 +101,9 @@
int seenHeader = 0;
int i;
Blob line, token, a1, a2, a3;
Blob selfuuid;
- char zPrevLine[10];
+ char cPrevType = 0;
memset(p, 0, sizeof(*p));
memcpy(&p->content, pContent, sizeof(p->content));
sha1sum_blob(&p->content, &selfuuid);
@@ -114,9 +114,8 @@
blob_zero(&a1);
blob_zero(&a2);
md5sum_init();
- zPrevLine[0] = 0;
while( blob_line(pContent, &line) ){
char *z = blob_buffer(&line);
if( z[0]=='-' ){
if( strncmp(z, "-----BEGIN PGP ", 15)!=0 ){
@@ -128,13 +127,13 @@
while( blob_line(pContent, &line)>2 ){}
if( blob_line(pContent, &line)==0 ) break;
z = blob_buffer(&line);
}
- if( strcmp(z, zPrevLine)<0 ){
+ if( z[0]<cPrevType ){
/* Lines of a manifest must occur in lexicographical order */
goto manifest_syntax_error;
}
- sqlite3_snprintf(sizeof(zPrevLine), zPrevLine, "%s", z);
+ cPrevType = z[0];
seenHeader = 1;
if( blob_token(&line, &token)!=1 ) goto manifest_syntax_error;
switch( z[0] ){
/*