Diff
Not logged in

Differences From:

File src/manifest.c part of check-in [55fc643eda] - Add a test command to invoke the manifest parser from the command-line on an arbitrary text file. For testing only. by drh on 2008-11-09 13:21:57. [view]

To:

File src/manifest.c part of check-in [6eddf50cfe] - Allow the U card of a ticket change artifact to have no argument. When that happens, the user is assumed to be "anonymous". Ticket 1b4f9f30c1 by drh on 2008-11-09 13:41:39. [view]

@@ -519,20 +519,24 @@
         break;
       }
 
       /*
-      **     U <login>
+      **     U ?<login>?
       **
       ** Identify the user who created this control file by their
       ** login.  Only one U line is allowed.  Prohibited in clusters.
+      ** If the user name is omitted, take that to be "anonymous".
       */
       case 'U': {
         md5sum_step_text(blob_buffer(&line), blob_size(&line));
         if( p->zUser!=0 ) goto manifest_syntax_error;
-        if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
-        if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
-        p->zUser = blob_terminate(&a1);
-        defossilize(p->zUser);
+        if( blob_token(&line, &a1)==0 ){
+          p->zUser = "anonymous";
+        }else{
+          p->zUser = blob_terminate(&a1);
+          defossilize(p->zUser);
+        }
+        if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
         break;
       }
 
       /*