comparison 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
comparison
equal deleted inserted replaced
706:c9bf82d465b5 707:a307f9a2021d
209 doc = XSTRING_DATA (document); 209 doc = XSTRING_DATA (document);
210 #ifdef CYGWIN 210 #ifdef CYGWIN
211 if ((fname1 = strchr (doc, ':')) != NULL 211 if ((fname1 = strchr (doc, ':')) != NULL
212 && *++fname1 == '/' && *++fname1 == '/') 212 && *++fname1 == '/' && *++fname1 == '/')
213 { 213 {
214 fname1++; 214 // URL-style if we get here, but we must only convert file
215 pos = fname1 - doc; 215 // arguments, since win32 paths are illegal in http etc.
216 if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1])))) 216 if (strncmp (doc, "file://", 7) == 0)
217 { 217 {
218 sz = cygwin_posix_to_win32_path_list_buf_size (fname1); 218 fname1++;
219 fname2 = alloca (sz + pos); 219 pos = fname1 - doc;
220 strncpy (fname2, doc, pos); 220 if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1]))))
221 doc = fname2; 221 {
222 fname2 += pos; 222 sz = cygwin_posix_to_win32_path_list_buf_size (fname1);
223 cygwin_posix_to_win32_path_list (fname1, fname2); 223 fname2 = alloca (sz + pos);
224 strncpy (fname2, doc, pos);
225 doc = fname2;
226 fname2 += pos;
227 cygwin_posix_to_win32_path_list (fname1, fname2);
228 }
224 } 229 }
225 } 230 }
226 else { 231 else {
232 // Not URL-style, must be a straight filename.
227 LOCAL_TO_WIN32_FILE_FORMAT (document, doc); 233 LOCAL_TO_WIN32_FILE_FORMAT (document, doc);
228 } 234 }
229 #endif 235 #endif
230 } 236 }
231 237