Fossil SCM

Merge the winFiles branch into trunk.

drh 2012-03-20 14:03 trunk merge
Commit 135ed93375e0ea3b4ed2e3dacb832e4c5fdd6eec
+1 -1
--- src/add.c
+++ src/add.c
@@ -241,11 +241,11 @@
241241
for(i=2; i<g.argc; i++){
242242
char *zName;
243243
int isDir;
244244
Blob fullName;
245245
246
- file_canonical_name(g.argv[i], &fullName);
246
+ file_canonical_name(g.argv[i], &fullName, 0);
247247
zName = blob_str(&fullName);
248248
isDir = file_wd_isdir(zName);
249249
if( isDir==1 ){
250250
vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
251251
}else if( isDir==0 ){
252252
--- src/add.c
+++ src/add.c
@@ -241,11 +241,11 @@
241 for(i=2; i<g.argc; i++){
242 char *zName;
243 int isDir;
244 Blob fullName;
245
246 file_canonical_name(g.argv[i], &fullName);
247 zName = blob_str(&fullName);
248 isDir = file_wd_isdir(zName);
249 if( isDir==1 ){
250 vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
251 }else if( isDir==0 ){
252
--- src/add.c
+++ src/add.c
@@ -241,11 +241,11 @@
241 for(i=2; i<g.argc; i++){
242 char *zName;
243 int isDir;
244 Blob fullName;
245
246 file_canonical_name(g.argv[i], &fullName, 0);
247 zName = blob_str(&fullName);
248 isDir = file_wd_isdir(zName);
249 if( isDir==1 ){
250 vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
251 }else if( isDir==0 ){
252
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -168,11 +168,11 @@
168168
}else if( !file_is_canonical(zFilename) ){
169169
Blob cname;
170170
char *zRepo = mprintf("repo:%s", zFilename);
171171
db_unset(zRepo, 1);
172172
free(zRepo);
173
- file_canonical_name(zFilename, &cname);
173
+ file_canonical_name(zFilename, &cname, 0);
174174
zRepo = mprintf("repo:%s", blob_str(&cname));
175175
db_set(zRepo, "1", 1);
176176
free(zRepo);
177177
}
178178
}
179179
--- src/allrepo.c
+++ src/allrepo.c
@@ -168,11 +168,11 @@
168 }else if( !file_is_canonical(zFilename) ){
169 Blob cname;
170 char *zRepo = mprintf("repo:%s", zFilename);
171 db_unset(zRepo, 1);
172 free(zRepo);
173 file_canonical_name(zFilename, &cname);
174 zRepo = mprintf("repo:%s", blob_str(&cname));
175 db_set(zRepo, "1", 1);
176 free(zRepo);
177 }
178 }
179
--- src/allrepo.c
+++ src/allrepo.c
@@ -168,11 +168,11 @@
168 }else if( !file_is_canonical(zFilename) ){
169 Blob cname;
170 char *zRepo = mprintf("repo:%s", zFilename);
171 db_unset(zRepo, 1);
172 free(zRepo);
173 file_canonical_name(zFilename, &cname, 0);
174 zRepo = mprintf("repo:%s", blob_str(&cname));
175 db_set(zRepo, "1", 1);
176 free(zRepo);
177 }
178 }
179
+4 -1
--- src/blob.c
+++ src/blob.c
@@ -90,10 +90,13 @@
9090
int fossil_isupper(char c){ return c>='A' && c<='Z'; }
9191
int fossil_isdigit(char c){ return c>='0' && c<='9'; }
9292
int fossil_tolower(char c){
9393
return fossil_isupper(c) ? c - 'A' + 'a' : c;
9494
}
95
+int fossil_toupper(char c){
96
+ return fossil_islower(c) ? c - 'a' + 'A' : c;
97
+}
9598
int fossil_isalpha(char c){
9699
return (c>='a' && c<='z') || (c>='A' && c<='Z');
97100
}
98101
int fossil_isalnum(char c){
99102
return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
@@ -791,11 +794,11 @@
791794
zName = mprintf("%s", zFilename);
792795
}else{
793796
zName = zBuf;
794797
memcpy(zName, zFilename, nName+1);
795798
}
796
- nName = file_simplify_name(zName, nName);
799
+ nName = file_simplify_name(zName, nName, 0);
797800
for(i=1; i<nName; i++){
798801
if( zName[i]=='/' ){
799802
zName[i] = 0;
800803
#if defined(_WIN32)
801804
/*
802805
--- src/blob.c
+++ src/blob.c
@@ -90,10 +90,13 @@
90 int fossil_isupper(char c){ return c>='A' && c<='Z'; }
91 int fossil_isdigit(char c){ return c>='0' && c<='9'; }
92 int fossil_tolower(char c){
93 return fossil_isupper(c) ? c - 'A' + 'a' : c;
94 }
 
 
 
95 int fossil_isalpha(char c){
96 return (c>='a' && c<='z') || (c>='A' && c<='Z');
97 }
98 int fossil_isalnum(char c){
99 return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
@@ -791,11 +794,11 @@
791 zName = mprintf("%s", zFilename);
792 }else{
793 zName = zBuf;
794 memcpy(zName, zFilename, nName+1);
795 }
796 nName = file_simplify_name(zName, nName);
797 for(i=1; i<nName; i++){
798 if( zName[i]=='/' ){
799 zName[i] = 0;
800 #if defined(_WIN32)
801 /*
802
--- src/blob.c
+++ src/blob.c
@@ -90,10 +90,13 @@
90 int fossil_isupper(char c){ return c>='A' && c<='Z'; }
91 int fossil_isdigit(char c){ return c>='0' && c<='9'; }
92 int fossil_tolower(char c){
93 return fossil_isupper(c) ? c - 'A' + 'a' : c;
94 }
95 int fossil_toupper(char c){
96 return fossil_islower(c) ? c - 'a' + 'A' : c;
97 }
98 int fossil_isalpha(char c){
99 return (c>='a' && c<='z') || (c>='A' && c<='Z');
100 }
101 int fossil_isalnum(char c){
102 return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
@@ -791,11 +794,11 @@
794 zName = mprintf("%s", zFilename);
795 }else{
796 zName = zBuf;
797 memcpy(zName, zFilename, nName+1);
798 }
799 nName = file_simplify_name(zName, nName, 0);
800 for(i=1; i<nName; i++){
801 if( zName[i]=='/' ){
802 zName[i] = 0;
803 #if defined(_WIN32)
804 /*
805
+3 -3
--- src/checkin.c
+++ src/checkin.c
@@ -55,11 +55,11 @@
5555
int isChnged = db_column_int(&q,2);
5656
int isNew = db_column_int(&q,3)==0;
5757
int isRenamed = db_column_int(&q,4);
5858
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
5959
if( cwdRelative ){
60
- file_relative_name(zFullName, &rewrittenPathname);
60
+ file_relative_name(zFullName, &rewrittenPathname, 0);
6161
zDisplayName = blob_str(&rewrittenPathname);
6262
if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
6363
zDisplayName += 2; /* no unnecessary ./ prefix */
6464
}
6565
}
@@ -313,11 +313,11 @@
313313
blob_zero(&rewrittenPathname);
314314
while( db_step(&q)==SQLITE_ROW ){
315315
zDisplayName = zPathname = db_column_text(&q, 0);
316316
if( cwdRelative ) {
317317
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
318
- file_relative_name(zFullName, &rewrittenPathname);
318
+ file_relative_name(zFullName, &rewrittenPathname, 0);
319319
free(zFullName);
320320
zDisplayName = blob_str(&rewrittenPathname);
321321
if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
322322
zDisplayName += 2; /* no unnecessary ./ prefix */
323323
}
@@ -826,11 +826,11 @@
826826
if( lastNl>1000 ) return; /* Binary if any line longer than 1000 */
827827
}
828828
}
829829
if( nCrNl ){
830830
char c;
831
- file_relative_name(zFilename, &fname);
831
+ file_relative_name(zFilename, &fname, 0);
832832
blob_zero(&ans);
833833
zMsg = mprintf(
834834
"%s contains CR/NL line endings; commit anyhow (yes/no/all)?",
835835
blob_str(&fname));
836836
prompt_user(zMsg, &ans);
837837
--- src/checkin.c
+++ src/checkin.c
@@ -55,11 +55,11 @@
55 int isChnged = db_column_int(&q,2);
56 int isNew = db_column_int(&q,3)==0;
57 int isRenamed = db_column_int(&q,4);
58 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
59 if( cwdRelative ){
60 file_relative_name(zFullName, &rewrittenPathname);
61 zDisplayName = blob_str(&rewrittenPathname);
62 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
63 zDisplayName += 2; /* no unnecessary ./ prefix */
64 }
65 }
@@ -313,11 +313,11 @@
313 blob_zero(&rewrittenPathname);
314 while( db_step(&q)==SQLITE_ROW ){
315 zDisplayName = zPathname = db_column_text(&q, 0);
316 if( cwdRelative ) {
317 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
318 file_relative_name(zFullName, &rewrittenPathname);
319 free(zFullName);
320 zDisplayName = blob_str(&rewrittenPathname);
321 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
322 zDisplayName += 2; /* no unnecessary ./ prefix */
323 }
@@ -826,11 +826,11 @@
826 if( lastNl>1000 ) return; /* Binary if any line longer than 1000 */
827 }
828 }
829 if( nCrNl ){
830 char c;
831 file_relative_name(zFilename, &fname);
832 blob_zero(&ans);
833 zMsg = mprintf(
834 "%s contains CR/NL line endings; commit anyhow (yes/no/all)?",
835 blob_str(&fname));
836 prompt_user(zMsg, &ans);
837
--- src/checkin.c
+++ src/checkin.c
@@ -55,11 +55,11 @@
55 int isChnged = db_column_int(&q,2);
56 int isNew = db_column_int(&q,3)==0;
57 int isRenamed = db_column_int(&q,4);
58 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
59 if( cwdRelative ){
60 file_relative_name(zFullName, &rewrittenPathname, 0);
61 zDisplayName = blob_str(&rewrittenPathname);
62 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
63 zDisplayName += 2; /* no unnecessary ./ prefix */
64 }
65 }
@@ -313,11 +313,11 @@
313 blob_zero(&rewrittenPathname);
314 while( db_step(&q)==SQLITE_ROW ){
315 zDisplayName = zPathname = db_column_text(&q, 0);
316 if( cwdRelative ) {
317 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
318 file_relative_name(zFullName, &rewrittenPathname, 0);
319 free(zFullName);
320 zDisplayName = blob_str(&rewrittenPathname);
321 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
322 zDisplayName += 2; /* no unnecessary ./ prefix */
323 }
@@ -826,11 +826,11 @@
826 if( lastNl>1000 ) return; /* Binary if any line longer than 1000 */
827 }
828 }
829 if( nCrNl ){
830 char c;
831 file_relative_name(zFilename, &fname, 0);
832 blob_zero(&ans);
833 zMsg = mprintf(
834 "%s contains CR/NL line endings; commit anyhow (yes/no/all)?",
835 blob_str(&fname));
836 prompt_user(zMsg, &ans);
837
+1 -1
--- src/clone.c
+++ src/clone.c
@@ -150,11 +150,11 @@
150150
db_set("last-sync-url", g.argv[2], 0);
151151
if( g.zSSLIdentity!=0 ){
152152
/* If the --ssl-identity option was specified, store it as a setting */
153153
Blob fn;
154154
blob_zero(&fn);
155
- file_canonical_name(g.zSSLIdentity, &fn);
155
+ file_canonical_name(g.zSSLIdentity, &fn, 0);
156156
db_set("ssl-identity", blob_str(&fn), 0);
157157
blob_reset(&fn);
158158
}
159159
db_multi_exec(
160160
"REPLACE INTO config(name,value,mtime)"
161161
--- src/clone.c
+++ src/clone.c
@@ -150,11 +150,11 @@
150 db_set("last-sync-url", g.argv[2], 0);
151 if( g.zSSLIdentity!=0 ){
152 /* If the --ssl-identity option was specified, store it as a setting */
153 Blob fn;
154 blob_zero(&fn);
155 file_canonical_name(g.zSSLIdentity, &fn);
156 db_set("ssl-identity", blob_str(&fn), 0);
157 blob_reset(&fn);
158 }
159 db_multi_exec(
160 "REPLACE INTO config(name,value,mtime)"
161
--- src/clone.c
+++ src/clone.c
@@ -150,11 +150,11 @@
150 db_set("last-sync-url", g.argv[2], 0);
151 if( g.zSSLIdentity!=0 ){
152 /* If the --ssl-identity option was specified, store it as a setting */
153 Blob fn;
154 blob_zero(&fn);
155 file_canonical_name(g.zSSLIdentity, &fn, 0);
156 db_set("ssl-identity", blob_str(&fn), 0);
157 blob_reset(&fn);
158 }
159 db_multi_exec(
160 "REPLACE INTO config(name,value,mtime)"
161
+7 -4
--- src/db.c
+++ src/db.c
@@ -1035,11 +1035,11 @@
10351035
}
10361036
if( db_open_local()==0 ){
10371037
fossil_fatal("not in a local checkout");
10381038
return;
10391039
}
1040
- file_canonical_name(g.argv[2], &repo);
1040
+ file_canonical_name(g.argv[2], &repo, 0);
10411041
zRepo = blob_str(&repo);
10421042
if( file_access(zRepo, 0) ){
10431043
fossil_fatal("no such file: %s", zRepo);
10441044
}
10451045
db_open_or_attach(zRepo, "test_repo");
@@ -1698,23 +1698,26 @@
16981698
Blob full;
16991699
if( zName==0 ){
17001700
if( !g.localOpen ) return;
17011701
zName = db_repository_filename();
17021702
}
1703
- file_canonical_name(zName, &full);
1703
+ file_canonical_name(zName, &full, 0);
17041704
db_swap_connections();
17051705
db_multi_exec(
17061706
"INSERT OR IGNORE INTO global_config(name,value)"
17071707
"VALUES('repo:%q',1)",
17081708
blob_str(&full)
17091709
);
17101710
if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
1711
+ Blob localRoot;
1712
+ file_canonical_name(g.zLocalRoot, &localRoot, 1);
17111713
db_multi_exec(
17121714
"REPLACE INTO global_config(name, value)"
17131715
"VALUES('ckout:%q','%q');",
1714
- g.zLocalRoot, blob_str(&full)
1716
+ blob_str(&localRoot), blob_str(&full)
17151717
);
1718
+ blob_reset(&localRoot);
17161719
}
17171720
db_swap_connections();
17181721
blob_reset(&full);
17191722
}
17201723
@@ -1749,11 +1752,11 @@
17491752
usage("REPOSITORY-FILENAME ?VERSION?");
17501753
}
17511754
if( !allowNested && db_open_local() ){
17521755
fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
17531756
}
1754
- file_canonical_name(g.argv[2], &path);
1757
+ file_canonical_name(g.argv[2], &path, 0);
17551758
db_open_repository(blob_str(&path));
17561759
db_init_database("./_FOSSIL_", zLocalSchema, (char*)0);
17571760
db_delete_on_failure("./_FOSSIL_");
17581761
db_open_local();
17591762
db_lset("repository", g.argv[2]);
17601763
--- src/db.c
+++ src/db.c
@@ -1035,11 +1035,11 @@
1035 }
1036 if( db_open_local()==0 ){
1037 fossil_fatal("not in a local checkout");
1038 return;
1039 }
1040 file_canonical_name(g.argv[2], &repo);
1041 zRepo = blob_str(&repo);
1042 if( file_access(zRepo, 0) ){
1043 fossil_fatal("no such file: %s", zRepo);
1044 }
1045 db_open_or_attach(zRepo, "test_repo");
@@ -1698,23 +1698,26 @@
1698 Blob full;
1699 if( zName==0 ){
1700 if( !g.localOpen ) return;
1701 zName = db_repository_filename();
1702 }
1703 file_canonical_name(zName, &full);
1704 db_swap_connections();
1705 db_multi_exec(
1706 "INSERT OR IGNORE INTO global_config(name,value)"
1707 "VALUES('repo:%q',1)",
1708 blob_str(&full)
1709 );
1710 if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
 
 
1711 db_multi_exec(
1712 "REPLACE INTO global_config(name, value)"
1713 "VALUES('ckout:%q','%q');",
1714 g.zLocalRoot, blob_str(&full)
1715 );
 
1716 }
1717 db_swap_connections();
1718 blob_reset(&full);
1719 }
1720
@@ -1749,11 +1752,11 @@
1749 usage("REPOSITORY-FILENAME ?VERSION?");
1750 }
1751 if( !allowNested && db_open_local() ){
1752 fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
1753 }
1754 file_canonical_name(g.argv[2], &path);
1755 db_open_repository(blob_str(&path));
1756 db_init_database("./_FOSSIL_", zLocalSchema, (char*)0);
1757 db_delete_on_failure("./_FOSSIL_");
1758 db_open_local();
1759 db_lset("repository", g.argv[2]);
1760
--- src/db.c
+++ src/db.c
@@ -1035,11 +1035,11 @@
1035 }
1036 if( db_open_local()==0 ){
1037 fossil_fatal("not in a local checkout");
1038 return;
1039 }
1040 file_canonical_name(g.argv[2], &repo, 0);
1041 zRepo = blob_str(&repo);
1042 if( file_access(zRepo, 0) ){
1043 fossil_fatal("no such file: %s", zRepo);
1044 }
1045 db_open_or_attach(zRepo, "test_repo");
@@ -1698,23 +1698,26 @@
1698 Blob full;
1699 if( zName==0 ){
1700 if( !g.localOpen ) return;
1701 zName = db_repository_filename();
1702 }
1703 file_canonical_name(zName, &full, 0);
1704 db_swap_connections();
1705 db_multi_exec(
1706 "INSERT OR IGNORE INTO global_config(name,value)"
1707 "VALUES('repo:%q',1)",
1708 blob_str(&full)
1709 );
1710 if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
1711 Blob localRoot;
1712 file_canonical_name(g.zLocalRoot, &localRoot, 1);
1713 db_multi_exec(
1714 "REPLACE INTO global_config(name, value)"
1715 "VALUES('ckout:%q','%q');",
1716 blob_str(&localRoot), blob_str(&full)
1717 );
1718 blob_reset(&localRoot);
1719 }
1720 db_swap_connections();
1721 blob_reset(&full);
1722 }
1723
@@ -1749,11 +1752,11 @@
1752 usage("REPOSITORY-FILENAME ?VERSION?");
1753 }
1754 if( !allowNested && db_open_local() ){
1755 fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
1756 }
1757 file_canonical_name(g.argv[2], &path, 0);
1758 db_open_repository(blob_str(&path));
1759 db_init_database("./_FOSSIL_", zLocalSchema, (char*)0);
1760 db_delete_on_failure("./_FOSSIL_");
1761 db_open_local();
1762 db_lset("repository", g.argv[2]);
1763
+11 -2
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -19,10 +19,19 @@
1919
*/
2020
#include "config.h"
2121
#include "diffcmd.h"
2222
#include <assert.h>
2323
24
+/*
25
+** Use the right null device for the platform.
26
+*/
27
+#if defined(_WIN32)
28
+# define NULL_DEVICE "NUL"
29
+#else
30
+# define NULL_DEVICE "/dev/null"
31
+#endif
32
+
2433
/*
2534
** Print the "Index:" message that patches wants to see at the top of a diff.
2635
*/
2736
void diff_print_index(const char *zFile, int diffFlags){
2837
if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){
@@ -76,11 +85,11 @@
7685
const char *zName2; /* Name of zFile2 for display */
7786
7887
/* Read content of zFile2 into memory */
7988
blob_zero(&file2);
8089
if( file_wd_size(zFile2)<0 ){
81
- zName2 = "/dev/null";
90
+ zName2 = NULL_DEVICE;
8291
}else{
8392
if( file_wd_islink(zFile2) ){
8493
blob_read_link(&file2, zFile2);
8594
}else{
8695
blob_read_from_file(&file2, zFile2);
@@ -283,11 +292,11 @@
283292
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
284293
char *zToFree = zFullName;
285294
int showDiff = 1;
286295
if( isDeleted ){
287296
fossil_print("DELETED %s\n", zPathname);
288
- if( !asNewFile ){ showDiff = 0; zFullName = "/dev/null"; }
297
+ if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
289298
}else if( file_access(zFullName, 0) ){
290299
fossil_print("MISSING %s\n", zPathname);
291300
if( !asNewFile ){ showDiff = 0; }
292301
}else if( isNew ){
293302
fossil_print("ADDED %s\n", zPathname);
294303
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -19,10 +19,19 @@
19 */
20 #include "config.h"
21 #include "diffcmd.h"
22 #include <assert.h>
23
 
 
 
 
 
 
 
 
 
24 /*
25 ** Print the "Index:" message that patches wants to see at the top of a diff.
26 */
27 void diff_print_index(const char *zFile, int diffFlags){
28 if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){
@@ -76,11 +85,11 @@
76 const char *zName2; /* Name of zFile2 for display */
77
78 /* Read content of zFile2 into memory */
79 blob_zero(&file2);
80 if( file_wd_size(zFile2)<0 ){
81 zName2 = "/dev/null";
82 }else{
83 if( file_wd_islink(zFile2) ){
84 blob_read_link(&file2, zFile2);
85 }else{
86 blob_read_from_file(&file2, zFile2);
@@ -283,11 +292,11 @@
283 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
284 char *zToFree = zFullName;
285 int showDiff = 1;
286 if( isDeleted ){
287 fossil_print("DELETED %s\n", zPathname);
288 if( !asNewFile ){ showDiff = 0; zFullName = "/dev/null"; }
289 }else if( file_access(zFullName, 0) ){
290 fossil_print("MISSING %s\n", zPathname);
291 if( !asNewFile ){ showDiff = 0; }
292 }else if( isNew ){
293 fossil_print("ADDED %s\n", zPathname);
294
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -19,10 +19,19 @@
19 */
20 #include "config.h"
21 #include "diffcmd.h"
22 #include <assert.h>
23
24 /*
25 ** Use the right null device for the platform.
26 */
27 #if defined(_WIN32)
28 # define NULL_DEVICE "NUL"
29 #else
30 # define NULL_DEVICE "/dev/null"
31 #endif
32
33 /*
34 ** Print the "Index:" message that patches wants to see at the top of a diff.
35 */
36 void diff_print_index(const char *zFile, int diffFlags){
37 if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){
@@ -76,11 +85,11 @@
85 const char *zName2; /* Name of zFile2 for display */
86
87 /* Read content of zFile2 into memory */
88 blob_zero(&file2);
89 if( file_wd_size(zFile2)<0 ){
90 zName2 = NULL_DEVICE;
91 }else{
92 if( file_wd_islink(zFile2) ){
93 blob_read_link(&file2, zFile2);
94 }else{
95 blob_read_from_file(&file2, zFile2);
@@ -283,11 +292,11 @@
292 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
293 char *zToFree = zFullName;
294 int showDiff = 1;
295 if( isDeleted ){
296 fossil_print("DELETED %s\n", zPathname);
297 if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
298 }else if( file_access(zFullName, 0) ){
299 fossil_print("MISSING %s\n", zPathname);
300 if( !asNewFile ){ showDiff = 0; }
301 }else if( isNew ){
302 fossil_print("ADDED %s\n", zPathname);
303
+90 -24
--- src/file.c
+++ src/file.c
@@ -28,10 +28,17 @@
2828
#include <unistd.h>
2929
#include <string.h>
3030
#include <errno.h>
3131
#include "file.h"
3232
33
+/*
34
+** On Windows, include the Platform SDK header file.
35
+*/
36
+#ifdef _WIN32
37
+# include <windows.h>
38
+#endif
39
+
3340
/*
3441
** The file status information from the most recent stat() call.
3542
**
3643
** Use _stati64 rather than stat on windows, in order to handle files
3744
** larger than 2GB.
@@ -168,11 +175,11 @@
168175
zName = mprintf("%s", zLinkFile);
169176
}else{
170177
zName = zBuf;
171178
memcpy(zName, zLinkFile, nName+1);
172179
}
173
- nName = file_simplify_name(zName, nName);
180
+ nName = file_simplify_name(zName, nName, 0);
174181
for(i=1; i<nName; i++){
175182
if( zName[i]=='/' ){
176183
zName[i] = 0;
177184
if( file_mkdir(zName, 1) ){
178185
fossil_fatal_recursive("unable to create directory %s", zName);
@@ -259,11 +266,11 @@
259266
int file_isdir(const char *zFilename){
260267
int rc;
261268
262269
if( zFilename ){
263270
char *zFN = mprintf("%s", zFilename);
264
- file_simplify_name(zFN, -1);
271
+ file_simplify_name(zFN, -1, 0);
265272
rc = getStat(zFN, 0);
266273
free(zFN);
267274
}else{
268275
rc = getStat(0, 0);
269276
}
@@ -276,11 +283,11 @@
276283
int file_wd_isdir(const char *zFilename){
277284
int rc;
278285
279286
if( zFilename ){
280287
char *zFN = mprintf("%s", zFilename);
281
- file_simplify_name(zFN, -1);
288
+ file_simplify_name(zFN, -1, 0);
282289
rc = getStat(zFN, 1);
283290
free(zFN);
284291
}else{
285292
rc = getStat(0, 1);
286293
}
@@ -314,11 +321,11 @@
314321
fossil_free(z);
315322
z = mprintf("%s-%s-%d", zBase, zSuffix, cnt++);
316323
}
317324
if( relFlag ){
318325
Blob x;
319
- file_relative_name(z, &x);
326
+ file_relative_name(z, &x, 0);
320327
fossil_free(z);
321328
z = blob_str(&x);
322329
}
323330
return z;
324331
}
@@ -473,12 +480,14 @@
473480
** * removing any trailing and duplicate /
474481
** * removing /./
475482
** * removing /A/../
476483
**
477484
** Changes are made in-place. Return the new name length.
485
+** If the slash parameter is non-zero, the trailing slash, if any,
486
+** is retained.
478487
*/
479
-int file_simplify_name(char *z, int n){
488
+int file_simplify_name(char *z, int n, int slash){
480489
int i, j;
481490
if( n<0 ) n = strlen(z);
482491
483492
/* On windows convert all \ characters to / */
484493
#if defined(_WIN32)
@@ -486,11 +495,13 @@
486495
if( z[i]=='\\' ) z[i] = '/';
487496
}
488497
#endif
489498
490499
/* Removing trailing "/" characters */
491
- while( n>1 && z[n-1]=='/' ){ n--; }
500
+ if ( !slash ){
501
+ while( n>1 && z[n-1]=='/' ){ n--; }
502
+ }
492503
493504
/* Remove duplicate '/' characters. Except, two // at the beginning
494505
** of a pathname is allowed since this is important on windows. */
495506
for(i=j=1; i<n; i++){
496507
z[j++] = z[i];
@@ -540,11 +551,11 @@
540551
int i;
541552
char *z;
542553
for(i=2; i<g.argc; i++){
543554
z = mprintf("%s", g.argv[i]);
544555
fossil_print("[%s] -> ", z);
545
- file_simplify_name(z, -1);
556
+ file_simplify_name(z, -1, 0);
546557
fossil_print("[%s]\n", z);
547558
fossil_free(z);
548559
}
549560
}
550561
@@ -606,22 +617,45 @@
606617
** Compute a canonical pathname for a file or directory.
607618
** Make the name absolute if it is relative.
608619
** Remove redundant / characters
609620
** Remove all /./ path elements.
610621
** Convert /A/../ to just /
622
+** If the slash parameter is non-zero, the trailing slash, if any,
623
+** is retained.
611624
*/
612
-void file_canonical_name(const char *zOrigName, Blob *pOut){
625
+void file_canonical_name(const char *zOrigName, Blob *pOut, int slash){
613626
if( file_is_absolute_path(zOrigName) ){
627
+#if defined(_WIN32)
628
+ char *zOut;
629
+#endif
614630
blob_set(pOut, zOrigName);
615631
blob_materialize(pOut);
632
+#if defined(_WIN32)
633
+ /*
634
+ ** On Windows, normalize the drive letter to upper case.
635
+ */
636
+ zOut = blob_str(pOut);
637
+ if( fossil_isalpha(zOut[0]) && zOut[1]==':' ){
638
+ zOut[0] = fossil_toupper(zOut[0]);
639
+ }
640
+#endif
616641
}else{
617642
char zPwd[2000];
618643
file_getcwd(zPwd, sizeof(zPwd)-strlen(zOrigName));
644
+#if defined(_WIN32)
645
+ /*
646
+ ** On Windows, normalize the drive letter to upper case.
647
+ */
648
+ if( fossil_isalpha(zPwd[0]) && zPwd[1]==':' ){
649
+ zPwd[0] = fossil_toupper(zPwd[0]);
650
+ }
651
+#endif
619652
blob_zero(pOut);
620653
blob_appendf(pOut, "%//%/", zPwd, zOrigName);
621654
}
622
- blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
655
+ blob_resize(pOut, file_simplify_name(blob_buffer(pOut),
656
+ blob_size(pOut), slash));
623657
}
624658
625659
/*
626660
** COMMAND: test-canonical-name
627661
** Usage: %fossil test-canonical-name FILENAME...
@@ -634,11 +668,11 @@
634668
Blob x;
635669
blob_zero(&x);
636670
for(i=2; i<g.argc; i++){
637671
char zBuf[100];
638672
const char *zName = g.argv[i];
639
- file_canonical_name(zName, &x);
673
+ file_canonical_name(zName, &x, 0);
640674
fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
641675
blob_reset(&x);
642676
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
643677
fossil_print(" file_size = %s\n", zBuf);
644678
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -688,16 +722,18 @@
688722
return zIn;
689723
}
690724
691725
/*
692726
** Compute a pathname for a file or directory that is relative
693
-** to the current directory.
727
+** to the current directory. If the slash parameter is non-zero,
728
+** the trailing slash, if any, is retained.
694729
*/
695
-void file_relative_name(const char *zOrigName, Blob *pOut){
730
+void file_relative_name(const char *zOrigName, Blob *pOut, int slash){
696731
char *zPath;
697732
blob_set(pOut, zOrigName);
698
- blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
733
+ blob_resize(pOut, file_simplify_name(blob_buffer(pOut),
734
+ blob_size(pOut), slash));
699735
zPath = file_without_drive_letter(blob_buffer(pOut));
700736
if( zPath[0]=='/' ){
701737
int i, j;
702738
Blob tmp;
703739
char *zPwd;
@@ -753,11 +789,11 @@
753789
void cmd_test_relative_name(void){
754790
int i;
755791
Blob x;
756792
blob_zero(&x);
757793
for(i=2; i<g.argc; i++){
758
- file_relative_name(g.argv[i], &x);
794
+ file_relative_name(g.argv[i], &x, 0);
759795
fossil_print("%s\n", blob_buffer(&x));
760796
blob_reset(&x);
761797
}
762798
}
763799
@@ -768,37 +804,46 @@
768804
** false, then simply return 0.
769805
**
770806
** The root of the tree is defined by the g.zLocalRoot variable.
771807
*/
772808
int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){
773
- int n;
809
+ Blob localRoot;
810
+ int nLocalRoot;
811
+ char *zLocalRoot;
774812
Blob full;
775813
int nFull;
776814
char *zFull;
777815
778816
blob_zero(pOut);
779817
db_must_be_within_tree();
780
- file_canonical_name(zOrigName, &full);
781
- n = strlen(g.zLocalRoot);
782
- assert( n>0 && g.zLocalRoot[n-1]=='/' );
818
+ file_canonical_name(g.zLocalRoot, &localRoot, 1);
819
+ nLocalRoot = blob_size(&localRoot);
820
+ zLocalRoot = blob_buffer(&localRoot);
821
+ assert( nLocalRoot>0 && zLocalRoot[nLocalRoot-1]=='/' );
822
+ file_canonical_name(zOrigName, &full, 0);
783823
nFull = blob_size(&full);
784824
zFull = blob_buffer(&full);
785825
786826
/* Special case. zOrigName refers to g.zLocalRoot directory. */
787
- if( nFull==n-1 && memcmp(g.zLocalRoot, zFull, nFull)==0 ){
827
+ if( nFull==nLocalRoot-1 && memcmp(zLocalRoot, zFull, nFull)==0 ){
788828
blob_append(pOut, ".", 1);
829
+ blob_reset(&localRoot);
830
+ blob_reset(&full);
789831
return 1;
790832
}
791833
792
- if( nFull<=n || memcmp(g.zLocalRoot, zFull, n) ){
834
+ if( nFull<=nLocalRoot || memcmp(zLocalRoot, zFull, nLocalRoot) ){
835
+ blob_reset(&localRoot);
793836
blob_reset(&full);
794837
if( errFatal ){
795838
fossil_fatal("file outside of checkout tree: %s", zOrigName);
796839
}
797840
return 0;
798841
}
799
- blob_append(pOut, &zFull[n], nFull-n);
842
+ blob_append(pOut, &zFull[nLocalRoot], nFull-nLocalRoot);
843
+ blob_reset(&localRoot);
844
+ blob_reset(&full);
800845
return 1;
801846
}
802847
803848
/*
804849
** COMMAND: test-tree-name
@@ -861,25 +906,44 @@
861906
/*
862907
** Construct a random temporary filename into zBuf[].
863908
*/
864909
void file_tempname(int nBuf, char *zBuf){
865910
static const char *azDirs[] = {
911
+#if defined(_WIN32)
912
+ 0, /* GetTempPath */
913
+ 0, /* TEMP */
914
+ 0, /* TMP */
915
+#else
866916
"/var/tmp",
867917
"/usr/tmp",
868918
"/tmp",
869919
"/temp",
920
+#endif
870921
".",
871922
};
872923
static const unsigned char zChars[] =
873924
"abcdefghijklmnopqrstuvwxyz"
874925
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
875926
"0123456789";
876927
unsigned int i, j;
877928
const char *zDir = ".";
878929
int cnt = 0;
930
+
931
+#if defined(_WIN32)
932
+ char zTmpPath[MAX_PATH];
933
+
934
+ if( GetTempPath(sizeof(zTmpPath), zTmpPath) ){
935
+ azDirs[0] = zTmpPath;
936
+ }
937
+
938
+ azDirs[1] = fossil_getenv("TEMP");
939
+ azDirs[2] = fossil_getenv("TMP");
940
+#endif
941
+
879942
880943
for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
944
+ if( azDirs[i]==0 ) continue;
881945
if( !file_isdir(azDirs[i]) ) continue;
882946
zDir = azDirs[i];
883947
break;
884948
}
885949
@@ -898,10 +962,15 @@
898962
for(i=0; i<15; i++, j++){
899963
zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
900964
}
901965
zBuf[j] = 0;
902966
}while( file_size(zBuf)>=0 );
967
+
968
+#if defined(_WIN32)
969
+ fossil_mbcs_free((char *)azDirs[1]);
970
+ fossil_mbcs_free((char *)azDirs[2]);
971
+#endif
903972
}
904973
905974
906975
/*
907976
** Return true if a file named zName exists and has identical content
@@ -930,13 +999,10 @@
930999
/**************************************************************************
9311000
** The following routines translate between MBCS and UTF8 on windows.
9321001
** Since everything is always UTF8 on unix, these routines are no-ops
9331002
** there.
9341003
*/
935
-#ifdef _WIN32
936
-# include <windows.h>
937
-#endif
9381004
9391005
/*
9401006
** Translate MBCS to UTF8. Return a pointer to the translated text.
9411007
** Call fossil_mbcs_free() to deallocate any memory used to store the
9421008
** returned pointer when done.
9431009
--- src/file.c
+++ src/file.c
@@ -28,10 +28,17 @@
28 #include <unistd.h>
29 #include <string.h>
30 #include <errno.h>
31 #include "file.h"
32
 
 
 
 
 
 
 
33 /*
34 ** The file status information from the most recent stat() call.
35 **
36 ** Use _stati64 rather than stat on windows, in order to handle files
37 ** larger than 2GB.
@@ -168,11 +175,11 @@
168 zName = mprintf("%s", zLinkFile);
169 }else{
170 zName = zBuf;
171 memcpy(zName, zLinkFile, nName+1);
172 }
173 nName = file_simplify_name(zName, nName);
174 for(i=1; i<nName; i++){
175 if( zName[i]=='/' ){
176 zName[i] = 0;
177 if( file_mkdir(zName, 1) ){
178 fossil_fatal_recursive("unable to create directory %s", zName);
@@ -259,11 +266,11 @@
259 int file_isdir(const char *zFilename){
260 int rc;
261
262 if( zFilename ){
263 char *zFN = mprintf("%s", zFilename);
264 file_simplify_name(zFN, -1);
265 rc = getStat(zFN, 0);
266 free(zFN);
267 }else{
268 rc = getStat(0, 0);
269 }
@@ -276,11 +283,11 @@
276 int file_wd_isdir(const char *zFilename){
277 int rc;
278
279 if( zFilename ){
280 char *zFN = mprintf("%s", zFilename);
281 file_simplify_name(zFN, -1);
282 rc = getStat(zFN, 1);
283 free(zFN);
284 }else{
285 rc = getStat(0, 1);
286 }
@@ -314,11 +321,11 @@
314 fossil_free(z);
315 z = mprintf("%s-%s-%d", zBase, zSuffix, cnt++);
316 }
317 if( relFlag ){
318 Blob x;
319 file_relative_name(z, &x);
320 fossil_free(z);
321 z = blob_str(&x);
322 }
323 return z;
324 }
@@ -473,12 +480,14 @@
473 ** * removing any trailing and duplicate /
474 ** * removing /./
475 ** * removing /A/../
476 **
477 ** Changes are made in-place. Return the new name length.
 
 
478 */
479 int file_simplify_name(char *z, int n){
480 int i, j;
481 if( n<0 ) n = strlen(z);
482
483 /* On windows convert all \ characters to / */
484 #if defined(_WIN32)
@@ -486,11 +495,13 @@
486 if( z[i]=='\\' ) z[i] = '/';
487 }
488 #endif
489
490 /* Removing trailing "/" characters */
491 while( n>1 && z[n-1]=='/' ){ n--; }
 
 
492
493 /* Remove duplicate '/' characters. Except, two // at the beginning
494 ** of a pathname is allowed since this is important on windows. */
495 for(i=j=1; i<n; i++){
496 z[j++] = z[i];
@@ -540,11 +551,11 @@
540 int i;
541 char *z;
542 for(i=2; i<g.argc; i++){
543 z = mprintf("%s", g.argv[i]);
544 fossil_print("[%s] -> ", z);
545 file_simplify_name(z, -1);
546 fossil_print("[%s]\n", z);
547 fossil_free(z);
548 }
549 }
550
@@ -606,22 +617,45 @@
606 ** Compute a canonical pathname for a file or directory.
607 ** Make the name absolute if it is relative.
608 ** Remove redundant / characters
609 ** Remove all /./ path elements.
610 ** Convert /A/../ to just /
 
 
611 */
612 void file_canonical_name(const char *zOrigName, Blob *pOut){
613 if( file_is_absolute_path(zOrigName) ){
 
 
 
614 blob_set(pOut, zOrigName);
615 blob_materialize(pOut);
 
 
 
 
 
 
 
 
 
616 }else{
617 char zPwd[2000];
618 file_getcwd(zPwd, sizeof(zPwd)-strlen(zOrigName));
 
 
 
 
 
 
 
 
619 blob_zero(pOut);
620 blob_appendf(pOut, "%//%/", zPwd, zOrigName);
621 }
622 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
 
623 }
624
625 /*
626 ** COMMAND: test-canonical-name
627 ** Usage: %fossil test-canonical-name FILENAME...
@@ -634,11 +668,11 @@
634 Blob x;
635 blob_zero(&x);
636 for(i=2; i<g.argc; i++){
637 char zBuf[100];
638 const char *zName = g.argv[i];
639 file_canonical_name(zName, &x);
640 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
641 blob_reset(&x);
642 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
643 fossil_print(" file_size = %s\n", zBuf);
644 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -688,16 +722,18 @@
688 return zIn;
689 }
690
691 /*
692 ** Compute a pathname for a file or directory that is relative
693 ** to the current directory.
 
694 */
695 void file_relative_name(const char *zOrigName, Blob *pOut){
696 char *zPath;
697 blob_set(pOut, zOrigName);
698 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
 
699 zPath = file_without_drive_letter(blob_buffer(pOut));
700 if( zPath[0]=='/' ){
701 int i, j;
702 Blob tmp;
703 char *zPwd;
@@ -753,11 +789,11 @@
753 void cmd_test_relative_name(void){
754 int i;
755 Blob x;
756 blob_zero(&x);
757 for(i=2; i<g.argc; i++){
758 file_relative_name(g.argv[i], &x);
759 fossil_print("%s\n", blob_buffer(&x));
760 blob_reset(&x);
761 }
762 }
763
@@ -768,37 +804,46 @@
768 ** false, then simply return 0.
769 **
770 ** The root of the tree is defined by the g.zLocalRoot variable.
771 */
772 int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){
773 int n;
 
 
774 Blob full;
775 int nFull;
776 char *zFull;
777
778 blob_zero(pOut);
779 db_must_be_within_tree();
780 file_canonical_name(zOrigName, &full);
781 n = strlen(g.zLocalRoot);
782 assert( n>0 && g.zLocalRoot[n-1]=='/' );
 
 
783 nFull = blob_size(&full);
784 zFull = blob_buffer(&full);
785
786 /* Special case. zOrigName refers to g.zLocalRoot directory. */
787 if( nFull==n-1 && memcmp(g.zLocalRoot, zFull, nFull)==0 ){
788 blob_append(pOut, ".", 1);
 
 
789 return 1;
790 }
791
792 if( nFull<=n || memcmp(g.zLocalRoot, zFull, n) ){
 
793 blob_reset(&full);
794 if( errFatal ){
795 fossil_fatal("file outside of checkout tree: %s", zOrigName);
796 }
797 return 0;
798 }
799 blob_append(pOut, &zFull[n], nFull-n);
 
 
800 return 1;
801 }
802
803 /*
804 ** COMMAND: test-tree-name
@@ -861,25 +906,44 @@
861 /*
862 ** Construct a random temporary filename into zBuf[].
863 */
864 void file_tempname(int nBuf, char *zBuf){
865 static const char *azDirs[] = {
 
 
 
 
 
866 "/var/tmp",
867 "/usr/tmp",
868 "/tmp",
869 "/temp",
 
870 ".",
871 };
872 static const unsigned char zChars[] =
873 "abcdefghijklmnopqrstuvwxyz"
874 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
875 "0123456789";
876 unsigned int i, j;
877 const char *zDir = ".";
878 int cnt = 0;
 
 
 
 
 
 
 
 
 
 
 
 
879
880 for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
 
881 if( !file_isdir(azDirs[i]) ) continue;
882 zDir = azDirs[i];
883 break;
884 }
885
@@ -898,10 +962,15 @@
898 for(i=0; i<15; i++, j++){
899 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
900 }
901 zBuf[j] = 0;
902 }while( file_size(zBuf)>=0 );
 
 
 
 
 
903 }
904
905
906 /*
907 ** Return true if a file named zName exists and has identical content
@@ -930,13 +999,10 @@
930 /**************************************************************************
931 ** The following routines translate between MBCS and UTF8 on windows.
932 ** Since everything is always UTF8 on unix, these routines are no-ops
933 ** there.
934 */
935 #ifdef _WIN32
936 # include <windows.h>
937 #endif
938
939 /*
940 ** Translate MBCS to UTF8. Return a pointer to the translated text.
941 ** Call fossil_mbcs_free() to deallocate any memory used to store the
942 ** returned pointer when done.
943
--- src/file.c
+++ src/file.c
@@ -28,10 +28,17 @@
28 #include <unistd.h>
29 #include <string.h>
30 #include <errno.h>
31 #include "file.h"
32
33 /*
34 ** On Windows, include the Platform SDK header file.
35 */
36 #ifdef _WIN32
37 # include <windows.h>
38 #endif
39
40 /*
41 ** The file status information from the most recent stat() call.
42 **
43 ** Use _stati64 rather than stat on windows, in order to handle files
44 ** larger than 2GB.
@@ -168,11 +175,11 @@
175 zName = mprintf("%s", zLinkFile);
176 }else{
177 zName = zBuf;
178 memcpy(zName, zLinkFile, nName+1);
179 }
180 nName = file_simplify_name(zName, nName, 0);
181 for(i=1; i<nName; i++){
182 if( zName[i]=='/' ){
183 zName[i] = 0;
184 if( file_mkdir(zName, 1) ){
185 fossil_fatal_recursive("unable to create directory %s", zName);
@@ -259,11 +266,11 @@
266 int file_isdir(const char *zFilename){
267 int rc;
268
269 if( zFilename ){
270 char *zFN = mprintf("%s", zFilename);
271 file_simplify_name(zFN, -1, 0);
272 rc = getStat(zFN, 0);
273 free(zFN);
274 }else{
275 rc = getStat(0, 0);
276 }
@@ -276,11 +283,11 @@
283 int file_wd_isdir(const char *zFilename){
284 int rc;
285
286 if( zFilename ){
287 char *zFN = mprintf("%s", zFilename);
288 file_simplify_name(zFN, -1, 0);
289 rc = getStat(zFN, 1);
290 free(zFN);
291 }else{
292 rc = getStat(0, 1);
293 }
@@ -314,11 +321,11 @@
321 fossil_free(z);
322 z = mprintf("%s-%s-%d", zBase, zSuffix, cnt++);
323 }
324 if( relFlag ){
325 Blob x;
326 file_relative_name(z, &x, 0);
327 fossil_free(z);
328 z = blob_str(&x);
329 }
330 return z;
331 }
@@ -473,12 +480,14 @@
480 ** * removing any trailing and duplicate /
481 ** * removing /./
482 ** * removing /A/../
483 **
484 ** Changes are made in-place. Return the new name length.
485 ** If the slash parameter is non-zero, the trailing slash, if any,
486 ** is retained.
487 */
488 int file_simplify_name(char *z, int n, int slash){
489 int i, j;
490 if( n<0 ) n = strlen(z);
491
492 /* On windows convert all \ characters to / */
493 #if defined(_WIN32)
@@ -486,11 +495,13 @@
495 if( z[i]=='\\' ) z[i] = '/';
496 }
497 #endif
498
499 /* Removing trailing "/" characters */
500 if ( !slash ){
501 while( n>1 && z[n-1]=='/' ){ n--; }
502 }
503
504 /* Remove duplicate '/' characters. Except, two // at the beginning
505 ** of a pathname is allowed since this is important on windows. */
506 for(i=j=1; i<n; i++){
507 z[j++] = z[i];
@@ -540,11 +551,11 @@
551 int i;
552 char *z;
553 for(i=2; i<g.argc; i++){
554 z = mprintf("%s", g.argv[i]);
555 fossil_print("[%s] -> ", z);
556 file_simplify_name(z, -1, 0);
557 fossil_print("[%s]\n", z);
558 fossil_free(z);
559 }
560 }
561
@@ -606,22 +617,45 @@
617 ** Compute a canonical pathname for a file or directory.
618 ** Make the name absolute if it is relative.
619 ** Remove redundant / characters
620 ** Remove all /./ path elements.
621 ** Convert /A/../ to just /
622 ** If the slash parameter is non-zero, the trailing slash, if any,
623 ** is retained.
624 */
625 void file_canonical_name(const char *zOrigName, Blob *pOut, int slash){
626 if( file_is_absolute_path(zOrigName) ){
627 #if defined(_WIN32)
628 char *zOut;
629 #endif
630 blob_set(pOut, zOrigName);
631 blob_materialize(pOut);
632 #if defined(_WIN32)
633 /*
634 ** On Windows, normalize the drive letter to upper case.
635 */
636 zOut = blob_str(pOut);
637 if( fossil_isalpha(zOut[0]) && zOut[1]==':' ){
638 zOut[0] = fossil_toupper(zOut[0]);
639 }
640 #endif
641 }else{
642 char zPwd[2000];
643 file_getcwd(zPwd, sizeof(zPwd)-strlen(zOrigName));
644 #if defined(_WIN32)
645 /*
646 ** On Windows, normalize the drive letter to upper case.
647 */
648 if( fossil_isalpha(zPwd[0]) && zPwd[1]==':' ){
649 zPwd[0] = fossil_toupper(zPwd[0]);
650 }
651 #endif
652 blob_zero(pOut);
653 blob_appendf(pOut, "%//%/", zPwd, zOrigName);
654 }
655 blob_resize(pOut, file_simplify_name(blob_buffer(pOut),
656 blob_size(pOut), slash));
657 }
658
659 /*
660 ** COMMAND: test-canonical-name
661 ** Usage: %fossil test-canonical-name FILENAME...
@@ -634,11 +668,11 @@
668 Blob x;
669 blob_zero(&x);
670 for(i=2; i<g.argc; i++){
671 char zBuf[100];
672 const char *zName = g.argv[i];
673 file_canonical_name(zName, &x, 0);
674 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
675 blob_reset(&x);
676 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
677 fossil_print(" file_size = %s\n", zBuf);
678 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -688,16 +722,18 @@
722 return zIn;
723 }
724
725 /*
726 ** Compute a pathname for a file or directory that is relative
727 ** to the current directory. If the slash parameter is non-zero,
728 ** the trailing slash, if any, is retained.
729 */
730 void file_relative_name(const char *zOrigName, Blob *pOut, int slash){
731 char *zPath;
732 blob_set(pOut, zOrigName);
733 blob_resize(pOut, file_simplify_name(blob_buffer(pOut),
734 blob_size(pOut), slash));
735 zPath = file_without_drive_letter(blob_buffer(pOut));
736 if( zPath[0]=='/' ){
737 int i, j;
738 Blob tmp;
739 char *zPwd;
@@ -753,11 +789,11 @@
789 void cmd_test_relative_name(void){
790 int i;
791 Blob x;
792 blob_zero(&x);
793 for(i=2; i<g.argc; i++){
794 file_relative_name(g.argv[i], &x, 0);
795 fossil_print("%s\n", blob_buffer(&x));
796 blob_reset(&x);
797 }
798 }
799
@@ -768,37 +804,46 @@
804 ** false, then simply return 0.
805 **
806 ** The root of the tree is defined by the g.zLocalRoot variable.
807 */
808 int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){
809 Blob localRoot;
810 int nLocalRoot;
811 char *zLocalRoot;
812 Blob full;
813 int nFull;
814 char *zFull;
815
816 blob_zero(pOut);
817 db_must_be_within_tree();
818 file_canonical_name(g.zLocalRoot, &localRoot, 1);
819 nLocalRoot = blob_size(&localRoot);
820 zLocalRoot = blob_buffer(&localRoot);
821 assert( nLocalRoot>0 && zLocalRoot[nLocalRoot-1]=='/' );
822 file_canonical_name(zOrigName, &full, 0);
823 nFull = blob_size(&full);
824 zFull = blob_buffer(&full);
825
826 /* Special case. zOrigName refers to g.zLocalRoot directory. */
827 if( nFull==nLocalRoot-1 && memcmp(zLocalRoot, zFull, nFull)==0 ){
828 blob_append(pOut, ".", 1);
829 blob_reset(&localRoot);
830 blob_reset(&full);
831 return 1;
832 }
833
834 if( nFull<=nLocalRoot || memcmp(zLocalRoot, zFull, nLocalRoot) ){
835 blob_reset(&localRoot);
836 blob_reset(&full);
837 if( errFatal ){
838 fossil_fatal("file outside of checkout tree: %s", zOrigName);
839 }
840 return 0;
841 }
842 blob_append(pOut, &zFull[nLocalRoot], nFull-nLocalRoot);
843 blob_reset(&localRoot);
844 blob_reset(&full);
845 return 1;
846 }
847
848 /*
849 ** COMMAND: test-tree-name
@@ -861,25 +906,44 @@
906 /*
907 ** Construct a random temporary filename into zBuf[].
908 */
909 void file_tempname(int nBuf, char *zBuf){
910 static const char *azDirs[] = {
911 #if defined(_WIN32)
912 0, /* GetTempPath */
913 0, /* TEMP */
914 0, /* TMP */
915 #else
916 "/var/tmp",
917 "/usr/tmp",
918 "/tmp",
919 "/temp",
920 #endif
921 ".",
922 };
923 static const unsigned char zChars[] =
924 "abcdefghijklmnopqrstuvwxyz"
925 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
926 "0123456789";
927 unsigned int i, j;
928 const char *zDir = ".";
929 int cnt = 0;
930
931 #if defined(_WIN32)
932 char zTmpPath[MAX_PATH];
933
934 if( GetTempPath(sizeof(zTmpPath), zTmpPath) ){
935 azDirs[0] = zTmpPath;
936 }
937
938 azDirs[1] = fossil_getenv("TEMP");
939 azDirs[2] = fossil_getenv("TMP");
940 #endif
941
942
943 for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
944 if( azDirs[i]==0 ) continue;
945 if( !file_isdir(azDirs[i]) ) continue;
946 zDir = azDirs[i];
947 break;
948 }
949
@@ -898,10 +962,15 @@
962 for(i=0; i<15; i++, j++){
963 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
964 }
965 zBuf[j] = 0;
966 }while( file_size(zBuf)>=0 );
967
968 #if defined(_WIN32)
969 fossil_mbcs_free((char *)azDirs[1]);
970 fossil_mbcs_free((char *)azDirs[2]);
971 #endif
972 }
973
974
975 /*
976 ** Return true if a file named zName exists and has identical content
@@ -930,13 +999,10 @@
999 /**************************************************************************
1000 ** The following routines translate between MBCS and UTF8 on windows.
1001 ** Since everything is always UTF8 on unix, these routines are no-ops
1002 ** there.
1003 */
 
 
 
1004
1005 /*
1006 ** Translate MBCS to UTF8. Return a pointer to the translated text.
1007 ** Call fossil_mbcs_free() to deallocate any memory used to store the
1008 ** returned pointer when done.
1009
+2 -2
--- src/login.c
+++ src/login.c
@@ -1404,17 +1404,17 @@
14041404
14051405
*pzErrMsg = 0; /* Default to no errors */
14061406
zSelf = db_name("repository");
14071407
14081408
/* Get the full pathname of the other repository */
1409
- file_canonical_name(zRepo, &fullName);
1409
+ file_canonical_name(zRepo, &fullName, 0);
14101410
zRepo = mprintf(blob_str(&fullName));
14111411
blob_reset(&fullName);
14121412
14131413
/* Get the full pathname for our repository. Also the project code
14141414
** and project name for ourself. */
1415
- file_canonical_name(g.zRepositoryName, &fullName);
1415
+ file_canonical_name(g.zRepositoryName, &fullName, 0);
14161416
zSelfRepo = mprintf(blob_str(&fullName));
14171417
blob_reset(&fullName);
14181418
zSelfProjCode = db_get("project-code", "unknown");
14191419
zSelfLabel = db_get("project-name", 0);
14201420
if( zSelfLabel==0 ){
14211421
--- src/login.c
+++ src/login.c
@@ -1404,17 +1404,17 @@
1404
1405 *pzErrMsg = 0; /* Default to no errors */
1406 zSelf = db_name("repository");
1407
1408 /* Get the full pathname of the other repository */
1409 file_canonical_name(zRepo, &fullName);
1410 zRepo = mprintf(blob_str(&fullName));
1411 blob_reset(&fullName);
1412
1413 /* Get the full pathname for our repository. Also the project code
1414 ** and project name for ourself. */
1415 file_canonical_name(g.zRepositoryName, &fullName);
1416 zSelfRepo = mprintf(blob_str(&fullName));
1417 blob_reset(&fullName);
1418 zSelfProjCode = db_get("project-code", "unknown");
1419 zSelfLabel = db_get("project-name", 0);
1420 if( zSelfLabel==0 ){
1421
--- src/login.c
+++ src/login.c
@@ -1404,17 +1404,17 @@
1404
1405 *pzErrMsg = 0; /* Default to no errors */
1406 zSelf = db_name("repository");
1407
1408 /* Get the full pathname of the other repository */
1409 file_canonical_name(zRepo, &fullName, 0);
1410 zRepo = mprintf(blob_str(&fullName));
1411 blob_reset(&fullName);
1412
1413 /* Get the full pathname for our repository. Also the project code
1414 ** and project name for ourself. */
1415 file_canonical_name(g.zRepositoryName, &fullName, 0);
1416 zSelfRepo = mprintf(blob_str(&fullName));
1417 blob_reset(&fullName);
1418 zSelfProjCode = db_get("project-code", "unknown");
1419 zSelfLabel = db_get("project-name", 0);
1420 if( zSelfLabel==0 ){
1421
+3 -3
--- src/main.c
+++ src/main.c
@@ -1112,11 +1112,11 @@
11121112
int i;
11131113
struct stat sStat;
11141114
Blob dir;
11151115
char *zDir;
11161116
1117
- file_canonical_name(zRepo, &dir);
1117
+ file_canonical_name(zRepo, &dir, 0);
11181118
zDir = blob_str(&dir);
11191119
if( file_isdir(zDir)==1 ){
11201120
if( chdir(zDir) || chroot(zDir) || chdir("/") ){
11211121
fossil_fatal("unable to chroot into %s", zDir);
11221122
}
@@ -1288,11 +1288,11 @@
12881288
zUser = "nobody";
12891289
}
12901290
if( g.zLogin==0 ) zUser = "nobody";
12911291
if( zAltRepo[0]!='/' ){
12921292
zAltRepo = mprintf("%s/../%s", g.zRepositoryName, zAltRepo);
1293
- file_simplify_name(zAltRepo, -1);
1293
+ file_simplify_name(zAltRepo, -1, 0);
12941294
}
12951295
db_close(1);
12961296
db_open_repository(zAltRepo);
12971297
login_as_user(zUser);
12981298
g.perm.Password = 0;
@@ -1550,11 +1550,11 @@
15501550
static void find_server_repository(int disallowDir){
15511551
if( g.argc<3 ){
15521552
db_must_be_within_tree();
15531553
}else if( !disallowDir && file_isdir(g.argv[2])==1 ){
15541554
g.zRepositoryName = mprintf("%s", g.argv[2]);
1555
- file_simplify_name(g.zRepositoryName, -1);
1555
+ file_simplify_name(g.zRepositoryName, -1, 0);
15561556
}else{
15571557
db_open_repository(g.argv[2]);
15581558
}
15591559
}
15601560
15611561
--- src/main.c
+++ src/main.c
@@ -1112,11 +1112,11 @@
1112 int i;
1113 struct stat sStat;
1114 Blob dir;
1115 char *zDir;
1116
1117 file_canonical_name(zRepo, &dir);
1118 zDir = blob_str(&dir);
1119 if( file_isdir(zDir)==1 ){
1120 if( chdir(zDir) || chroot(zDir) || chdir("/") ){
1121 fossil_fatal("unable to chroot into %s", zDir);
1122 }
@@ -1288,11 +1288,11 @@
1288 zUser = "nobody";
1289 }
1290 if( g.zLogin==0 ) zUser = "nobody";
1291 if( zAltRepo[0]!='/' ){
1292 zAltRepo = mprintf("%s/../%s", g.zRepositoryName, zAltRepo);
1293 file_simplify_name(zAltRepo, -1);
1294 }
1295 db_close(1);
1296 db_open_repository(zAltRepo);
1297 login_as_user(zUser);
1298 g.perm.Password = 0;
@@ -1550,11 +1550,11 @@
1550 static void find_server_repository(int disallowDir){
1551 if( g.argc<3 ){
1552 db_must_be_within_tree();
1553 }else if( !disallowDir && file_isdir(g.argv[2])==1 ){
1554 g.zRepositoryName = mprintf("%s", g.argv[2]);
1555 file_simplify_name(g.zRepositoryName, -1);
1556 }else{
1557 db_open_repository(g.argv[2]);
1558 }
1559 }
1560
1561
--- src/main.c
+++ src/main.c
@@ -1112,11 +1112,11 @@
1112 int i;
1113 struct stat sStat;
1114 Blob dir;
1115 char *zDir;
1116
1117 file_canonical_name(zRepo, &dir, 0);
1118 zDir = blob_str(&dir);
1119 if( file_isdir(zDir)==1 ){
1120 if( chdir(zDir) || chroot(zDir) || chdir("/") ){
1121 fossil_fatal("unable to chroot into %s", zDir);
1122 }
@@ -1288,11 +1288,11 @@
1288 zUser = "nobody";
1289 }
1290 if( g.zLogin==0 ) zUser = "nobody";
1291 if( zAltRepo[0]!='/' ){
1292 zAltRepo = mprintf("%s/../%s", g.zRepositoryName, zAltRepo);
1293 file_simplify_name(zAltRepo, -1, 0);
1294 }
1295 db_close(1);
1296 db_open_repository(zAltRepo);
1297 login_as_user(zUser);
1298 g.perm.Password = 0;
@@ -1550,11 +1550,11 @@
1550 static void find_server_repository(int disallowDir){
1551 if( g.argc<3 ){
1552 db_must_be_within_tree();
1553 }else if( !disallowDir && file_isdir(g.argv[2])==1 ){
1554 g.zRepositoryName = mprintf("%s", g.argv[2]);
1555 file_simplify_name(g.zRepositoryName, -1, 0);
1556 }else{
1557 db_open_repository(g.argv[2]);
1558 }
1559 }
1560
1561
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -469,11 +469,11 @@
469469
# or linking with it will not work (exact reason unknown).
470470
#
471471
ifdef FOSSIL_ENABLE_TCL
472472
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
473473
else
474
-LIB += -lws2_32
474
+LIB += -lkernel32 -lws2_32
475475
endif
476476
477477
#### Tcl shell for use in running the fossil test suite. This is only
478478
# used for testing.
479479
#
480480
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -469,11 +469,11 @@
469 # or linking with it will not work (exact reason unknown).
470 #
471 ifdef FOSSIL_ENABLE_TCL
472 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
473 else
474 LIB += -lws2_32
475 endif
476
477 #### Tcl shell for use in running the fossil test suite. This is only
478 # used for testing.
479 #
480
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -469,11 +469,11 @@
469 # or linking with it will not work (exact reason unknown).
470 #
471 ifdef FOSSIL_ENABLE_TCL
472 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
473 else
474 LIB += -lkernel32 -lws2_32
475 endif
476
477 #### Tcl shell for use in running the fossil test suite. This is only
478 # used for testing.
479 #
480
+1 -1
--- src/setup.c
+++ src/setup.c
@@ -951,11 +951,11 @@
951951
952952
login_check_credentials();
953953
if( !g.perm.Setup ){
954954
login_needed();
955955
}
956
- file_canonical_name(g.zRepositoryName, &fullName);
956
+ file_canonical_name(g.zRepositoryName, &fullName, 0);
957957
zSelfRepo = mprintf(blob_str(&fullName));
958958
blob_reset(&fullName);
959959
if( P("join")!=0 ){
960960
login_group_join(zRepo, zLogin, zPw, zNewName, &zErrMsg);
961961
}else if( P("leave") ){
962962
--- src/setup.c
+++ src/setup.c
@@ -951,11 +951,11 @@
951
952 login_check_credentials();
953 if( !g.perm.Setup ){
954 login_needed();
955 }
956 file_canonical_name(g.zRepositoryName, &fullName);
957 zSelfRepo = mprintf(blob_str(&fullName));
958 blob_reset(&fullName);
959 if( P("join")!=0 ){
960 login_group_join(zRepo, zLogin, zPw, zNewName, &zErrMsg);
961 }else if( P("leave") ){
962
--- src/setup.c
+++ src/setup.c
@@ -951,11 +951,11 @@
951
952 login_check_credentials();
953 if( !g.perm.Setup ){
954 login_needed();
955 }
956 file_canonical_name(g.zRepositoryName, &fullName, 0);
957 zSelfRepo = mprintf(blob_str(&fullName));
958 blob_reset(&fullName);
959 if( P("join")!=0 ){
960 login_group_join(zRepo, zLogin, zPw, zNewName, &zErrMsg);
961 }else if( P("leave") ){
962
+1 -1
--- src/url.c
+++ src/url.c
@@ -187,11 +187,11 @@
187187
fossil_panic("unknown repository: %s", zUrl);
188188
}
189189
if( g.urlIsFile ){
190190
Blob cfile;
191191
dehttpize(zFile);
192
- file_canonical_name(zFile, &cfile);
192
+ file_canonical_name(zFile, &cfile, 0);
193193
free(zFile);
194194
g.urlProtocol = "file";
195195
g.urlPath = "";
196196
g.urlName = mprintf("%b", &cfile);
197197
g.urlCanonical = mprintf("file://%T", g.urlName);
198198
--- src/url.c
+++ src/url.c
@@ -187,11 +187,11 @@
187 fossil_panic("unknown repository: %s", zUrl);
188 }
189 if( g.urlIsFile ){
190 Blob cfile;
191 dehttpize(zFile);
192 file_canonical_name(zFile, &cfile);
193 free(zFile);
194 g.urlProtocol = "file";
195 g.urlPath = "";
196 g.urlName = mprintf("%b", &cfile);
197 g.urlCanonical = mprintf("file://%T", g.urlName);
198
--- src/url.c
+++ src/url.c
@@ -187,11 +187,11 @@
187 fossil_panic("unknown repository: %s", zUrl);
188 }
189 if( g.urlIsFile ){
190 Blob cfile;
191 dehttpize(zFile);
192 file_canonical_name(zFile, &cfile, 0);
193 free(zFile);
194 g.urlProtocol = "file";
195 g.urlPath = "";
196 g.urlName = mprintf("%b", &cfile);
197 g.urlCanonical = mprintf("file://%T", g.urlName);
198
+1 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -596,11 +596,11 @@
596596
zRepository = find_option("repository", "R", 1);
597597
if( !zRepository ){
598598
db_must_be_within_tree();
599599
}else if( file_isdir(zRepository)==1 ){
600600
g.zRepositoryName = mprintf("%s", zRepository);
601
- file_simplify_name(g.zRepositoryName, -1);
601
+ file_simplify_name(g.zRepositoryName, -1, 0);
602602
}else{
603603
db_open_repository(zRepository);
604604
}
605605
db_close(0);
606606
verify_all_options();
607607
--- src/winhttp.c
+++ src/winhttp.c
@@ -596,11 +596,11 @@
596 zRepository = find_option("repository", "R", 1);
597 if( !zRepository ){
598 db_must_be_within_tree();
599 }else if( file_isdir(zRepository)==1 ){
600 g.zRepositoryName = mprintf("%s", zRepository);
601 file_simplify_name(g.zRepositoryName, -1);
602 }else{
603 db_open_repository(zRepository);
604 }
605 db_close(0);
606 verify_all_options();
607
--- src/winhttp.c
+++ src/winhttp.c
@@ -596,11 +596,11 @@
596 zRepository = find_option("repository", "R", 1);
597 if( !zRepository ){
598 db_must_be_within_tree();
599 }else if( file_isdir(zRepository)==1 ){
600 g.zRepositoryName = mprintf("%s", zRepository);
601 file_simplify_name(g.zRepositoryName, -1, 0);
602 }else{
603 db_open_repository(zRepository);
604 }
605 db_close(0);
606 verify_all_options();
607
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -150,11 +150,11 @@
150150
# or linking with it will not work (exact reason unknown).
151151
#
152152
ifdef FOSSIL_ENABLE_TCL
153153
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154154
else
155
-LIB += -lws2_32
155
+LIB += -lkernel32 -lws2_32
156156
endif
157157
158158
#### Tcl shell for use in running the fossil test suite. This is only
159159
# used for testing.
160160
#
161161
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -150,11 +150,11 @@
150 # or linking with it will not work (exact reason unknown).
151 #
152 ifdef FOSSIL_ENABLE_TCL
153 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154 else
155 LIB += -lws2_32
156 endif
157
158 #### Tcl shell for use in running the fossil test suite. This is only
159 # used for testing.
160 #
161
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -150,11 +150,11 @@
150 # or linking with it will not work (exact reason unknown).
151 #
152 ifdef FOSSIL_ENABLE_TCL
153 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154 else
155 LIB += -lkernel32 -lws2_32
156 endif
157
158 #### Tcl shell for use in running the fossil test suite. This is only
159 # used for testing.
160 #
161
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -35,11 +35,11 @@
3535
#
3636
FOSSIL_ENABLE_SSL = 1
3737
3838
#### Enable scripting support via Tcl/Tk
3939
#
40
-FOSSIL_ENABLE_TCL = 1
40
+# FOSSIL_ENABLE_TCL = 1
4141
4242
#### Use the Tcl source directory instead of the install directory?
4343
# This is useful when Tcl has been compiled statically with MinGW.
4444
#
4545
FOSSIL_TCL_SOURCE = 1
@@ -150,11 +150,11 @@
150150
# or linking with it will not work (exact reason unknown).
151151
#
152152
ifdef FOSSIL_ENABLE_TCL
153153
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154154
else
155
-LIB += -lws2_32
155
+LIB += -lkernel32 -lws2_32
156156
endif
157157
158158
#### Tcl shell for use in running the fossil test suite. This is only
159159
# used for testing.
160160
#
161161
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -35,11 +35,11 @@
35 #
36 FOSSIL_ENABLE_SSL = 1
37
38 #### Enable scripting support via Tcl/Tk
39 #
40 FOSSIL_ENABLE_TCL = 1
41
42 #### Use the Tcl source directory instead of the install directory?
43 # This is useful when Tcl has been compiled statically with MinGW.
44 #
45 FOSSIL_TCL_SOURCE = 1
@@ -150,11 +150,11 @@
150 # or linking with it will not work (exact reason unknown).
151 #
152 ifdef FOSSIL_ENABLE_TCL
153 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154 else
155 LIB += -lws2_32
156 endif
157
158 #### Tcl shell for use in running the fossil test suite. This is only
159 # used for testing.
160 #
161
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -35,11 +35,11 @@
35 #
36 FOSSIL_ENABLE_SSL = 1
37
38 #### Enable scripting support via Tcl/Tk
39 #
40 # FOSSIL_ENABLE_TCL = 1
41
42 #### Use the Tcl source directory instead of the install directory?
43 # This is useful when Tcl has been compiled statically with MinGW.
44 #
45 FOSSIL_TCL_SOURCE = 1
@@ -150,11 +150,11 @@
150 # or linking with it will not work (exact reason unknown).
151 #
152 ifdef FOSSIL_ENABLE_TCL
153 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
154 else
155 LIB += -lkernel32 -lws2_32
156 endif
157
158 #### Tcl shell for use in running the fossil test suite. This is only
159 # used for testing.
160 #
161

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button