mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
Handle drive-letter on MS-DOS.
This commit is contained in:
parent
d3c0ed007e
commit
865e495188
@ -104,7 +104,7 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||||||
char *real_path = curl_unescape(conn->path, 0);
|
char *real_path = curl_unescape(conn->path, 0);
|
||||||
struct FILEPROTO *file;
|
struct FILEPROTO *file;
|
||||||
int fd;
|
int fd;
|
||||||
#if defined(WIN32) || defined(__EMX__)
|
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||||
int i;
|
int i;
|
||||||
char *actual_path;
|
char *actual_path;
|
||||||
#endif
|
#endif
|
||||||
@ -120,7 +120,7 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
conn->proto.file = file;
|
conn->proto.file = file;
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__EMX__)
|
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||||
/* If the first character is a slash, and there's
|
/* If the first character is a slash, and there's
|
||||||
something that looks like a drive at the beginning of
|
something that looks like a drive at the beginning of
|
||||||
the path, skip the slash. If we remove the initial
|
the path, skip the slash. If we remove the initial
|
||||||
@ -144,7 +144,7 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||||||
actual_path++;
|
actual_path++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* change path separators from '/' to '\\' for Windows and OS/2 */
|
/* change path separators from '/' to '\\' for DOS, Windows and OS/2 */
|
||||||
for (i=0; actual_path[i] != '\0'; ++i)
|
for (i=0; actual_path[i] != '\0'; ++i)
|
||||||
if (actual_path[i] == '/')
|
if (actual_path[i] == '/')
|
||||||
actual_path[i] = '\\';
|
actual_path[i] = '\\';
|
||||||
@ -184,7 +184,7 @@ CURLcode Curl_file_done(struct connectdata *conn,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__EMX__)
|
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
|
||||||
#define DIRSEP '\\'
|
#define DIRSEP '\\'
|
||||||
#else
|
#else
|
||||||
#define DIRSEP '/'
|
#define DIRSEP '/'
|
||||||
|
Loading…
Reference in New Issue
Block a user