Fossil SCM

Get the "fossil all ui" command working on Cygwin where the global_config table has "repo:" entries containing the windows drive letter

jan.nijtmans 2016-12-02 10:49 trunk
Commit eb9b2317d57191959cc436399228f92b369cb9ae

No diff available

+2 -2
--- src/file.c
+++ src/file.c
@@ -1440,14 +1440,14 @@
14401440
14411441
/*
14421442
** Remove surplus "/" characters from the beginning of a full pathname.
14431443
** Extra leading "/" characters are benign on unix. But on Windows
14441444
** machines, they must be removed. Example: Convert "/C:/fossil/xyx.fossil"
1445
-** into "c:/fossil/xyz.fossil".
1445
+** into "C:/fossil/xyz.fossil". Cygwin should behave as Windows here.
14461446
*/
14471447
const char *file_cleanup_fullpath(const char *z){
1448
-#ifdef _WIN32
1448
+#if defined(_WIN32) || defined(__CYGWIN__)
14491449
if( z[0]=='/' && fossil_isalpha(z[1]) && z[2]==':' && z[3]=='/' ) z++;
14501450
#else
14511451
while( z[0]=='/' && z[1]=='/' ) z++;
14521452
#endif
14531453
return z;
14541454
--- src/file.c
+++ src/file.c
@@ -1440,14 +1440,14 @@
1440
1441 /*
1442 ** Remove surplus "/" characters from the beginning of a full pathname.
1443 ** Extra leading "/" characters are benign on unix. But on Windows
1444 ** machines, they must be removed. Example: Convert "/C:/fossil/xyx.fossil"
1445 ** into "c:/fossil/xyz.fossil".
1446 */
1447 const char *file_cleanup_fullpath(const char *z){
1448 #ifdef _WIN32
1449 if( z[0]=='/' && fossil_isalpha(z[1]) && z[2]==':' && z[3]=='/' ) z++;
1450 #else
1451 while( z[0]=='/' && z[1]=='/' ) z++;
1452 #endif
1453 return z;
1454
--- src/file.c
+++ src/file.c
@@ -1440,14 +1440,14 @@
1440
1441 /*
1442 ** Remove surplus "/" characters from the beginning of a full pathname.
1443 ** Extra leading "/" characters are benign on unix. But on Windows
1444 ** machines, they must be removed. Example: Convert "/C:/fossil/xyx.fossil"
1445 ** into "C:/fossil/xyz.fossil". Cygwin should behave as Windows here.
1446 */
1447 const char *file_cleanup_fullpath(const char *z){
1448 #if defined(_WIN32) || defined(__CYGWIN__)
1449 if( z[0]=='/' && fossil_isalpha(z[1]) && z[2]==':' && z[3]=='/' ) z++;
1450 #else
1451 while( z[0]=='/' && z[1]=='/' ) z++;
1452 #endif
1453 return z;
1454
+2 -2
--- src/main.c
+++ src/main.c
@@ -1321,11 +1321,11 @@
13211321
i64 szFile; /* File size of the candidate repository */
13221322
13231323
i = zPathInfo[0]!=0;
13241324
if( fossil_strcmp(g.zRepositoryName, "/")==0 ){
13251325
zBase++;
1326
-#ifdef _WIN32
1326
+#if defined(_WIN32) || defined(__CYGWIN__)
13271327
if( sqlite3_strglob("/[a-zA-Z]:/*", zPathInfo)==0 ) i = 4;
13281328
#endif
13291329
}
13301330
while( 1 ){
13311331
while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
@@ -1349,11 +1349,11 @@
13491349
*/
13501350
szFile = 0;
13511351
for(j=strlen(zBase)+1, k=0; zRepo[j] && k<i-1; j++, k++){
13521352
char c = zRepo[j];
13531353
if( fossil_isalnum(c) ) continue;
1354
-#ifdef _WIN32
1354
+#if defined(_WIN32) || defined(__CYGWIN__)
13551355
/* Allow names to begin with "/X:/" on windows */
13561356
if( c==':' && j==2 && sqlite3_strglob("/[a-zA-Z]:/*", zRepo)==0 ){
13571357
continue;
13581358
}
13591359
#endif
13601360
--- src/main.c
+++ src/main.c
@@ -1321,11 +1321,11 @@
1321 i64 szFile; /* File size of the candidate repository */
1322
1323 i = zPathInfo[0]!=0;
1324 if( fossil_strcmp(g.zRepositoryName, "/")==0 ){
1325 zBase++;
1326 #ifdef _WIN32
1327 if( sqlite3_strglob("/[a-zA-Z]:/*", zPathInfo)==0 ) i = 4;
1328 #endif
1329 }
1330 while( 1 ){
1331 while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
@@ -1349,11 +1349,11 @@
1349 */
1350 szFile = 0;
1351 for(j=strlen(zBase)+1, k=0; zRepo[j] && k<i-1; j++, k++){
1352 char c = zRepo[j];
1353 if( fossil_isalnum(c) ) continue;
1354 #ifdef _WIN32
1355 /* Allow names to begin with "/X:/" on windows */
1356 if( c==':' && j==2 && sqlite3_strglob("/[a-zA-Z]:/*", zRepo)==0 ){
1357 continue;
1358 }
1359 #endif
1360
--- src/main.c
+++ src/main.c
@@ -1321,11 +1321,11 @@
1321 i64 szFile; /* File size of the candidate repository */
1322
1323 i = zPathInfo[0]!=0;
1324 if( fossil_strcmp(g.zRepositoryName, "/")==0 ){
1325 zBase++;
1326 #if defined(_WIN32) || defined(__CYGWIN__)
1327 if( sqlite3_strglob("/[a-zA-Z]:/*", zPathInfo)==0 ) i = 4;
1328 #endif
1329 }
1330 while( 1 ){
1331 while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
@@ -1349,11 +1349,11 @@
1349 */
1350 szFile = 0;
1351 for(j=strlen(zBase)+1, k=0; zRepo[j] && k<i-1; j++, k++){
1352 char c = zRepo[j];
1353 if( fossil_isalnum(c) ) continue;
1354 #if defined(_WIN32) || defined(__CYGWIN__)
1355 /* Allow names to begin with "/X:/" on windows */
1356 if( c==':' && j==2 && sqlite3_strglob("/[a-zA-Z]:/*", zRepo)==0 ){
1357 continue;
1358 }
1359 #endif
1360

Keyboard Shortcuts

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