Check-in [73a9b3d5d1]
Not logged in
Overview

SHA1 Hash:73a9b3d5d1539b1e98b7349bc07db89198c2b4cb
Date: 2008-02-08 22:36:29
User: drh
Comment:Truncate the name of the toplevel directory added to ZIP archives to be the first 10 characters of the UUID.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/zip.c from [d33c17b312] to [0e35e8f120].

@@ -352,28 +352,29 @@
 ** Return that ZIP archive as the HTTP reply content.
 */
 void baseline_zip_page(void){
   int rid;
   char *zName;
-  int i;
+  int nName;
   Blob zip;
 
   login_check_credentials();
   if( !g.okRead || !g.okHistory ){ login_needed(); return; }
   zName = mprintf("%s", PD("name",""));
-  i = strlen(zName);
-  for(i=strlen(zName)-1; i>5; i--){
-    if( zName[i]=='.' ){
-      zName[i] = 0;
+  nName = strlen(zName);
+  for(nName=strlen(zName)-1; nName>5; nName--){
+    if( zName[nName]=='.' ){
+      zName[nName] = 0;
       break;
     }
   }
   rid = name_to_rid(zName);
   if( rid==0 ){
     @ Not found
     return;
   }
+  if( nName>10 ) zName[10] = 0;
   zip_of_baseline(rid, &zip, zName);
   cgi_set_content(&zip);
   cgi_set_content_type("application/zip");
   cgi_reply();
 }