591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
|
** If the slash parameter is non-zero, the trailing slash, if any,
** is retained.
*/
int file_simplify_name(char *z, int n, int slash){
int i, j;
if( n<0 ) n = strlen(z);
/* On windows convert all \ characters to / */
#if defined(_WIN32)
for(i=0; i<n; i++){
if( z[i]=='\\' ) z[i] = '/';
}
#endif
/* Removing trailing "/" characters */
if( !slash ){
|
|
|
|
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
|
** If the slash parameter is non-zero, the trailing slash, if any,
** is retained.
*/
int file_simplify_name(char *z, int n, int slash){
int i, j;
if( n<0 ) n = strlen(z);
/* On windows and cygwin convert all \ characters to / */
#if defined(_WIN32) && defined(__CYGWIN__)
for(i=0; i<n; i++){
if( z[i]=='\\' ) z[i] = '/';
}
#endif
/* Removing trailing "/" characters */
if( !slash ){
|
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
|
Blob tmp;
char *zPwd;
char zBuf[2000];
zPwd = zBuf;
file_getcwd(zBuf, sizeof(zBuf)-20);
zPwd = file_without_drive_letter(zBuf);
i = 1;
#ifdef _WIN32
while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
#else
while( zPath[i] && zPwd[i]==zPath[i] ) i++;
#endif
if( zPath[i]==0 ){
blob_reset(pOut);
if( zPwd[i]==0 ){
|
|
|
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
|
Blob tmp;
char *zPwd;
char zBuf[2000];
zPwd = zBuf;
file_getcwd(zBuf, sizeof(zBuf)-20);
zPwd = file_without_drive_letter(zBuf);
i = 1;
#if defined(_WIN32) || defined(__CYGWIN__)
while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
#else
while( zPath[i] && zPwd[i]==zPath[i] ) i++;
#endif
if( zPath[i]==0 ){
blob_reset(pOut);
if( zPwd[i]==0 ){
|