Fossil SCM

Modify file_simplify_name to accept a parameter used to determine if the trailing slash, if any, should be retained. Make use of this when converting the local root to its canonical form.

mistachkin 2012-03-19 05:24 UTC winFiles
Commit e94c7cc4dee7e23321b0069f1d46ddf3277ddff5
+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
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -794,11 +794,11 @@
794794
zName = mprintf("%s", zFilename);
795795
}else{
796796
zName = zBuf;
797797
memcpy(zName, zFilename, nName+1);
798798
}
799
- nName = file_simplify_name(zName, nName);
799
+ nName = file_simplify_name(zName, nName, 0);
800800
for(i=1; i<nName; i++){
801801
if( zName[i]=='/' ){
802802
zName[i] = 0;
803803
#if defined(_WIN32)
804804
/*
805805
--- src/blob.c
+++ src/blob.c
@@ -794,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);
800 for(i=1; i<nName; i++){
801 if( zName[i]=='/' ){
802 zName[i] = 0;
803 #if defined(_WIN32)
804 /*
805
--- src/blob.c
+++ src/blob.c
@@ -794,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
+4 -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,20 +1698,20 @@
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] ){
17111711
Blob localRoot;
1712
- file_canonical_name(g.zLocalRoot, &localRoot);
1712
+ file_canonical_name(g.zLocalRoot, &localRoot, 1);
17131713
db_multi_exec(
17141714
"REPLACE INTO global_config(name, value)"
17151715
"VALUES('ckout:%q','%q');",
17161716
blob_str(&localRoot), blob_str(&full)
17171717
);
@@ -1752,11 +1752,11 @@
17521752
usage("REPOSITORY-FILENAME ?VERSION?");
17531753
}
17541754
if( !allowNested && db_open_local() ){
17551755
fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
17561756
}
1757
- file_canonical_name(g.argv[2], &path);
1757
+ file_canonical_name(g.argv[2], &path, 0);
17581758
db_open_repository(blob_str(&path));
17591759
db_init_database("./_FOSSIL_", zLocalSchema, (char*)0);
17601760
db_delete_on_failure("./_FOSSIL_");
17611761
db_open_local();
17621762
db_lset("repository", g.argv[2]);
17631763
--- 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,20 +1698,20 @@
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 Blob localRoot;
1712 file_canonical_name(g.zLocalRoot, &localRoot);
1713 db_multi_exec(
1714 "REPLACE INTO global_config(name, value)"
1715 "VALUES('ckout:%q','%q');",
1716 blob_str(&localRoot), blob_str(&full)
1717 );
@@ -1752,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);
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
--- 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,20 +1698,20 @@
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 );
@@ -1752,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
+25 -21
--- src/file.c
+++ src/file.c
@@ -175,11 +175,11 @@
175175
zName = mprintf("%s", zLinkFile);
176176
}else{
177177
zName = zBuf;
178178
memcpy(zName, zLinkFile, nName+1);
179179
}
180
- nName = file_simplify_name(zName, nName);
180
+ nName = file_simplify_name(zName, nName, 0);
181181
for(i=1; i<nName; i++){
182182
if( zName[i]=='/' ){
183183
zName[i] = 0;
184184
if( file_mkdir(zName, 1) ){
185185
fossil_fatal_recursive("unable to create directory %s", zName);
@@ -266,11 +266,11 @@
266266
int file_isdir(const char *zFilename){
267267
int rc;
268268
269269
if( zFilename ){
270270
char *zFN = mprintf("%s", zFilename);
271
- file_simplify_name(zFN, -1);
271
+ file_simplify_name(zFN, -1, 0);
272272
rc = getStat(zFN, 0);
273273
free(zFN);
274274
}else{
275275
rc = getStat(0, 0);
276276
}
@@ -283,11 +283,11 @@
283283
int file_wd_isdir(const char *zFilename){
284284
int rc;
285285
286286
if( zFilename ){
287287
char *zFN = mprintf("%s", zFilename);
288
- file_simplify_name(zFN, -1);
288
+ file_simplify_name(zFN, -1, 0);
289289
rc = getStat(zFN, 1);
290290
free(zFN);
291291
}else{
292292
rc = getStat(0, 1);
293293
}
@@ -321,11 +321,11 @@
321321
fossil_free(z);
322322
z = mprintf("%s-%s-%d", zBase, zSuffix, cnt++);
323323
}
324324
if( relFlag ){
325325
Blob x;
326
- file_relative_name(z, &x);
326
+ file_relative_name(z, &x, 0);
327327
fossil_free(z);
328328
z = blob_str(&x);
329329
}
330330
return z;
331331
}
@@ -480,12 +480,14 @@
480480
** * removing any trailing and duplicate /
481481
** * removing /./
482482
** * removing /A/../
483483
**
484484
** 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.
485487
*/
486
-int file_simplify_name(char *z, int n){
488
+int file_simplify_name(char *z, int n, int slash){
487489
int i, j;
488490
if( n<0 ) n = strlen(z);
489491
490492
/* On windows convert all \ characters to / */
491493
#if defined(_WIN32)
@@ -493,11 +495,13 @@
493495
if( z[i]=='\\' ) z[i] = '/';
494496
}
495497
#endif
496498
497499
/* Removing trailing "/" characters */
498
- while( n>1 && z[n-1]=='/' ){ n--; }
500
+ if ( !slash ){
501
+ while( n>1 && z[n-1]=='/' ){ n--; }
502
+ }
499503
500504
/* Remove duplicate '/' characters. Except, two // at the beginning
501505
** of a pathname is allowed since this is important on windows. */
502506
for(i=j=1; i<n; i++){
503507
z[j++] = z[i];
@@ -547,11 +551,11 @@
547551
int i;
548552
char *z;
549553
for(i=2; i<g.argc; i++){
550554
z = mprintf("%s", g.argv[i]);
551555
fossil_print("[%s] -> ", z);
552
- file_simplify_name(z, -1);
556
+ file_simplify_name(z, -1, 0);
553557
fossil_print("[%s]\n", z);
554558
fossil_free(z);
555559
}
556560
}
557561
@@ -613,12 +617,14 @@
613617
** Compute a canonical pathname for a file or directory.
614618
** Make the name absolute if it is relative.
615619
** Remove redundant / characters
616620
** Remove all /./ path elements.
617621
** Convert /A/../ to just /
622
+** If the slash parameter is non-zero, the trailing slash, if any,
623
+** is retained.
618624
*/
619
-void file_canonical_name(const char *zOrigName, Blob *pOut){
625
+void file_canonical_name(const char *zOrigName, Blob *pOut, int slash){
620626
if( file_is_absolute_path(zOrigName) ){
621627
#if defined(_WIN32)
622628
char *zOut;
623629
#endif
624630
blob_set(pOut, zOrigName);
@@ -644,11 +650,12 @@
644650
}
645651
#endif
646652
blob_zero(pOut);
647653
blob_appendf(pOut, "%//%/", zPwd, zOrigName);
648654
}
649
- 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));
650657
}
651658
652659
/*
653660
** COMMAND: test-canonical-name
654661
** Usage: %fossil test-canonical-name FILENAME...
@@ -661,11 +668,11 @@
661668
Blob x;
662669
blob_zero(&x);
663670
for(i=2; i<g.argc; i++){
664671
char zBuf[100];
665672
const char *zName = g.argv[i];
666
- file_canonical_name(zName, &x);
673
+ file_canonical_name(zName, &x, 0);
667674
fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
668675
blob_reset(&x);
669676
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
670677
fossil_print(" file_size = %s\n", zBuf);
671678
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -715,16 +722,18 @@
715722
return zIn;
716723
}
717724
718725
/*
719726
** Compute a pathname for a file or directory that is relative
720
-** to the current directory.
727
+** to the current directory. If the slash parameter is non-zero,
728
+** the trailing slash, if any, is retained.
721729
*/
722
-void file_relative_name(const char *zOrigName, Blob *pOut){
730
+void file_relative_name(const char *zOrigName, Blob *pOut, int slash){
723731
char *zPath;
724732
blob_set(pOut, zOrigName);
725
- 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));
726735
zPath = file_without_drive_letter(blob_buffer(pOut));
727736
if( zPath[0]=='/' ){
728737
int i, j;
729738
Blob tmp;
730739
char *zPwd;
@@ -780,11 +789,11 @@
780789
void cmd_test_relative_name(void){
781790
int i;
782791
Blob x;
783792
blob_zero(&x);
784793
for(i=2; i<g.argc; i++){
785
- file_relative_name(g.argv[i], &x);
794
+ file_relative_name(g.argv[i], &x, 0);
786795
fossil_print("%s\n", blob_buffer(&x));
787796
blob_reset(&x);
788797
}
789798
}
790799
@@ -804,20 +813,15 @@
804813
int nFull;
805814
char *zFull;
806815
807816
blob_zero(pOut);
808817
db_must_be_within_tree();
809
- file_canonical_name(g.zLocalRoot, &localRoot);
818
+ file_canonical_name(g.zLocalRoot, &localRoot, 1);
810819
nLocalRoot = blob_size(&localRoot);
811820
zLocalRoot = blob_buffer(&localRoot);
812
- if ( zLocalRoot[nLocalRoot-1]!='/' ){
813
- blob_append(&localRoot, "/", 1);
814
- nLocalRoot = blob_size(&localRoot);
815
- zLocalRoot = blob_buffer(&localRoot);
816
- }
817821
assert( nLocalRoot>0 && zLocalRoot[nLocalRoot-1]=='/' );
818
- file_canonical_name(zOrigName, &full);
822
+ file_canonical_name(zOrigName, &full, 0);
819823
nFull = blob_size(&full);
820824
zFull = blob_buffer(&full);
821825
822826
/* Special case. zOrigName refers to g.zLocalRoot directory. */
823827
if( nFull==nLocalRoot-1 && memcmp(zLocalRoot, zFull, nFull)==0 ){
824828
--- src/file.c
+++ src/file.c
@@ -175,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);
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);
@@ -266,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);
272 rc = getStat(zFN, 0);
273 free(zFN);
274 }else{
275 rc = getStat(0, 0);
276 }
@@ -283,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);
289 rc = getStat(zFN, 1);
290 free(zFN);
291 }else{
292 rc = getStat(0, 1);
293 }
@@ -321,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);
327 fossil_free(z);
328 z = blob_str(&x);
329 }
330 return z;
331 }
@@ -480,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 */
486 int file_simplify_name(char *z, int n){
487 int i, j;
488 if( n<0 ) n = strlen(z);
489
490 /* On windows convert all \ characters to / */
491 #if defined(_WIN32)
@@ -493,11 +495,13 @@
493 if( z[i]=='\\' ) z[i] = '/';
494 }
495 #endif
496
497 /* Removing trailing "/" characters */
498 while( n>1 && z[n-1]=='/' ){ n--; }
 
 
499
500 /* Remove duplicate '/' characters. Except, two // at the beginning
501 ** of a pathname is allowed since this is important on windows. */
502 for(i=j=1; i<n; i++){
503 z[j++] = z[i];
@@ -547,11 +551,11 @@
547 int i;
548 char *z;
549 for(i=2; i<g.argc; i++){
550 z = mprintf("%s", g.argv[i]);
551 fossil_print("[%s] -> ", z);
552 file_simplify_name(z, -1);
553 fossil_print("[%s]\n", z);
554 fossil_free(z);
555 }
556 }
557
@@ -613,12 +617,14 @@
613 ** Compute a canonical pathname for a file or directory.
614 ** Make the name absolute if it is relative.
615 ** Remove redundant / characters
616 ** Remove all /./ path elements.
617 ** Convert /A/../ to just /
 
 
618 */
619 void file_canonical_name(const char *zOrigName, Blob *pOut){
620 if( file_is_absolute_path(zOrigName) ){
621 #if defined(_WIN32)
622 char *zOut;
623 #endif
624 blob_set(pOut, zOrigName);
@@ -644,11 +650,12 @@
644 }
645 #endif
646 blob_zero(pOut);
647 blob_appendf(pOut, "%//%/", zPwd, zOrigName);
648 }
649 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
 
650 }
651
652 /*
653 ** COMMAND: test-canonical-name
654 ** Usage: %fossil test-canonical-name FILENAME...
@@ -661,11 +668,11 @@
661 Blob x;
662 blob_zero(&x);
663 for(i=2; i<g.argc; i++){
664 char zBuf[100];
665 const char *zName = g.argv[i];
666 file_canonical_name(zName, &x);
667 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
668 blob_reset(&x);
669 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
670 fossil_print(" file_size = %s\n", zBuf);
671 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -715,16 +722,18 @@
715 return zIn;
716 }
717
718 /*
719 ** Compute a pathname for a file or directory that is relative
720 ** to the current directory.
 
721 */
722 void file_relative_name(const char *zOrigName, Blob *pOut){
723 char *zPath;
724 blob_set(pOut, zOrigName);
725 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
 
726 zPath = file_without_drive_letter(blob_buffer(pOut));
727 if( zPath[0]=='/' ){
728 int i, j;
729 Blob tmp;
730 char *zPwd;
@@ -780,11 +789,11 @@
780 void cmd_test_relative_name(void){
781 int i;
782 Blob x;
783 blob_zero(&x);
784 for(i=2; i<g.argc; i++){
785 file_relative_name(g.argv[i], &x);
786 fossil_print("%s\n", blob_buffer(&x));
787 blob_reset(&x);
788 }
789 }
790
@@ -804,20 +813,15 @@
804 int nFull;
805 char *zFull;
806
807 blob_zero(pOut);
808 db_must_be_within_tree();
809 file_canonical_name(g.zLocalRoot, &localRoot);
810 nLocalRoot = blob_size(&localRoot);
811 zLocalRoot = blob_buffer(&localRoot);
812 if ( zLocalRoot[nLocalRoot-1]!='/' ){
813 blob_append(&localRoot, "/", 1);
814 nLocalRoot = blob_size(&localRoot);
815 zLocalRoot = blob_buffer(&localRoot);
816 }
817 assert( nLocalRoot>0 && zLocalRoot[nLocalRoot-1]=='/' );
818 file_canonical_name(zOrigName, &full);
819 nFull = blob_size(&full);
820 zFull = blob_buffer(&full);
821
822 /* Special case. zOrigName refers to g.zLocalRoot directory. */
823 if( nFull==nLocalRoot-1 && memcmp(zLocalRoot, zFull, nFull)==0 ){
824
--- src/file.c
+++ src/file.c
@@ -175,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);
@@ -266,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 }
@@ -283,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 }
@@ -321,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 }
@@ -480,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)
@@ -493,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];
@@ -547,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
@@ -613,12 +617,14 @@
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);
@@ -644,11 +650,12 @@
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...
@@ -661,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));
@@ -715,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;
@@ -780,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
@@ -804,20 +813,15 @@
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
+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
+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.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
4646
--- 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
46
--- 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
46

Keyboard Shortcuts

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