Diff
Not logged in

Differences From:

File src/add.c part of check-in [e146d800ac] - Add the "mv" and "rename" commands (aliases for the same thing). by drh on 2008-11-09 19:22:06. [view]

To:

File src/add.c part of check-in [9fd8009007] - Bug fix in the "mv" command. Add filename change tracking to the check-in information screens. You must run rebuild on existing respositories when upgrading to this version of fossil. by drh on 2008-11-09 22:43:04. [view]

@@ -195,8 +195,13 @@
     db_multi_exec(
       "INSERT INTO mv VALUES(%B,%B)", &orig, &dest
     );
   }else{
+    if( blob_eq(&dest, ".") ){
+      blob_reset(&dest);
+    }else{
+      blob_append(&dest, "/", 1);
+    }
     for(i=2; i<g.argc-1; i++){
       Blob orig;
       char *zOrig;
       int nOrig;
@@ -219,9 +224,9 @@
         }else{
           zTail = &zPath[nOrig+1];
         }
         db_multi_exec(
-          "INSERT INTO mv VALUES('%s','%s/%s')",
+          "INSERT INTO mv VALUES('%s','%s%s')",
           zPath, blob_str(&dest), zTail
         );
       }
       db_finalize(&q);