935 |
if (*p=='\\') *p='/'; |
if (*p=='\\') *p='/'; |
936 |
p++; |
p++; |
937 |
} |
} |
|
AGAIN: |
|
938 |
/* grok filename to have only '/' not '\', |
/* grok filename to have only '/' not '\', |
939 |
fix up for cygnus: /cygdrive/h/ becomes h:/ |
fix up for cygnus: /cygdrive/h/ becomes h:/ |
940 |
//h/ab and /h/ab become h:/ab |
//h/ab and /h/ab become h:/ab |
973 |
} |
} |
974 |
} |
} |
975 |
|
|
976 |
if ( filename[1] == ':' && filename[2] != '/' ) { |
/* If the drive is just a letter with a colon eg "c:" or "c:hello.txt" it needs to |
977 |
|
* be resolved to the current directory on that device */ |
978 |
|
if ( ( filename[1] == ':' ) && (( strlen ( filename ) == 2 ) || ( filename[2] != '/' ) ) ) { |
979 |
char buf[4]; |
char buf[4]; |
980 |
|
int len; |
981 |
/* fprintf ( stderr, "fix_filename: In current dir fixup phase\n" );*/ |
/* fprintf ( stderr, "fix_filename: In current dir fixup phase\n" );*/ |
982 |
bcopy(filename,buf,2); |
bcopy(filename,buf,2); |
983 |
buf[2]='/'; |
buf[2]='/'; |
984 |
buf[3]=0; |
buf[3]=0; |
985 |
getwd(current_directory); |
getwd(current_directory); |
986 |
if ( chdir(buf) < 0 ) { |
len = strlen ( current_directory ); |
987 |
FEerror("fix_filename: Cannot get the truename of ~S.", 1, pathname); |
strcpy ( directory, filename ); |
988 |
} |
strncpy ( filename, current_directory, MAXPATHLEN-1 ); |
989 |
p = getwd ( directory ); |
filename[len]='/'; |
990 |
chdir ( current_directory ); |
filename[len+1]='\0'; |
991 |
strncat ( directory, filename+2, MAXPATHLEN-strlen(directory)-2 ); |
strncat ( filename, directory+2, MAXPATHLEN - 2 - strlen ( current_directory ) ); |
992 |
strcpy ( filename1, directory ); |
filename [MAXPATHLEN-1] = '\0'; |
993 |
filename = filename1; |
filename = filename1; |
994 |
goto AGAIN; |
p = filename; |
995 |
|
while ( *p ) { |
996 |
|
if (*p=='\\') *p='/'; |
997 |
|
p++; |
998 |
|
} |
999 |
} |
} |
1000 |
|
|
1001 |
/* move the name back to beginning of buffer */ |
/* move the name back to beginning of buffer */ |