Diff
Not logged in

Differences From:

File src/checkin.c part of check-in [e976aa6fcb] - Use cr/nl instead of just nl at the end of every line on the check-in comment template for windows. Strip out the cr characters before completing the commit. by drh on 2008-06-08 19:31:28. [view]

To:

File src/checkin.c part of check-in [849b94c631] - Avoid the use of chdir() since this seems to cause problems on windows. by drh on 2008-07-17 01:49:16. [view]

@@ -156,13 +156,14 @@
 */
 void extra_cmd(void){
   Blob path;
   Stmt q;
+  int n;
   db_must_be_within_tree();
   db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
-  chdir(g.zLocalRoot);
-  blob_zero(&path);
-  vfile_scan(0, &path);
+  n = strlen(g.zLocalRoot);
+  blob_init(&path, g.zLocalRoot, n-1);
+  vfile_scan(0, &path, blob_size(&path));
   db_prepare(&q,
       "SELECT x FROM sfile"
       " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')"
       " ORDER BY 1");
@@ -187,14 +188,15 @@
 void clean_cmd(void){
   int allFlag;
   Blob path;
   Stmt q;
+  int n;
   allFlag = find_option("all","a",0)!=0;
   db_must_be_within_tree();
   db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
-  chdir(g.zLocalRoot);
-  blob_zero(&path);
-  vfile_scan(0, &path);
+  n = strlen(g.zLocalRoot);
+  blob_init(&path, g.zLocalRoot, n-1);
+  vfile_scan(0, &path, blob_size(&path));
   db_prepare(&q,
       "SELECT %Q || x FROM sfile"
       " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')"
       " ORDER BY 1", g.zLocalRoot);