Mercurial > hg > xemacs-beta
diff src/win32.c @ 707:a307f9a2021d
[xemacs-hg @ 2001-12-20 05:49:28 by andyp]
sync with 21-4-6-windows
author | andyp |
---|---|
date | Thu, 20 Dec 2001 05:49:48 +0000 |
parents | 685b588e92d8 |
children | 943eaba38521 |
line wrap: on
line diff
--- a/src/win32.c Wed Dec 19 00:40:26 2001 +0000 +++ b/src/win32.c Thu Dec 20 05:49:48 2001 +0000 @@ -211,19 +211,25 @@ if ((fname1 = strchr (doc, ':')) != NULL && *++fname1 == '/' && *++fname1 == '/') { - fname1++; - pos = fname1 - doc; - if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1])))) + // URL-style if we get here, but we must only convert file + // arguments, since win32 paths are illegal in http etc. + if (strncmp (doc, "file://", 7) == 0) { - sz = cygwin_posix_to_win32_path_list_buf_size (fname1); - fname2 = alloca (sz + pos); - strncpy (fname2, doc, pos); - doc = fname2; - fname2 += pos; - cygwin_posix_to_win32_path_list (fname1, fname2); + fname1++; + pos = fname1 - doc; + if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1])))) + { + sz = cygwin_posix_to_win32_path_list_buf_size (fname1); + fname2 = alloca (sz + pos); + strncpy (fname2, doc, pos); + doc = fname2; + fname2 += pos; + cygwin_posix_to_win32_path_list (fname1, fname2); + } } } else { + // Not URL-style, must be a straight filename. LOCAL_TO_WIN32_FILE_FORMAT (document, doc); } #endif