comparison src/win32.c @ 819:6504113e7c2d

[xemacs-hg @ 2002-04-25 18:03:23 by andyp] sync up windows branch from 21.4
author andyp
date Thu, 25 Apr 2002 18:04:24 +0000
parents a634e3b7acc8
children 6728e641994e
comparison
equal deleted inserted replaced
818:accc481aef34 819:6504113e7c2d
330 if (STRINGP (current_dir)) 330 if (STRINGP (current_dir))
331 LOCAL_FILE_FORMAT_TO_TSTR (current_dir, path); 331 LOCAL_FILE_FORMAT_TO_TSTR (current_dir, path);
332 if (STRINGP (document)) 332 if (STRINGP (document))
333 { 333 {
334 #ifdef CYGWIN 334 #ifdef CYGWIN
335 Intbyte *docint = XSTRING_DATA (document); 335 Extbyte *fname1;
336 /* If URL style file, the innards may have Cygwin mount points and 336 Extbyte *fname2;
337 the like. so separate out the innards, process them, and put back 337 int pos, sz;
338 together. */ 338 LISP_STRING_TO_TSTR (document, doc);
339 if (qxestrncasecmp_c (docint, "file://", 7) == 0) 339
340 if ((fname1 = strchr (doc, ':')) != NULL
341 && *++fname1 == '/' && *++fname1 == '/')
340 { 342 {
341 Intbyte *fname_windows; 343 /* If URL style file, the innards may have Cygwin mount points and
342 Intbyte *docint_windows; 344 the like. so separate out the innards, process them, and put back
343 345 together. */
344 LOCAL_TO_WIN32_FILE_FORMAT (docint + 7, fname_windows); 346 if (qxestrncasecmp (doc, "file://", 7) == 0)
345 docint_windows = alloca_intbytes (7 + qxestrlen (fname_windows) + 1); 347 {
346 qxestrcpy_c (docint_windows, "file://"); 348 fname1++;
347 qxestrcat (docint_windows, fname_windows); 349 pos = fname1 - doc;
348 C_STRING_TO_TSTR (docint, doc); 350 if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1]))))
351 {
352 sz = cygwin_posix_to_win32_path_list_buf_size (fname1);
353 fname2 = alloca (sz + pos);
354 qxestrncpy (fname2, doc, pos);
355 doc = fname2;
356 fname2 += pos;
357 cygwin_posix_to_win32_path_list (fname1, fname2);
358 }
359 }
349 } 360 }
350 else 361 else {
362 /* Not URL-style, must be a straight filename. */
363 LOCAL_FILE_FORMAT_TO_TSTR (document, doc);
364 }
351 #endif 365 #endif
352 LOCAL_FILE_FORMAT_TO_TSTR (document, doc); 366
353 } 367 }
354 368
355 ret = (int) qxeShellExecute (NULL, opext, doc, parmext, path, 369 ret = (int) qxeShellExecute (NULL, opext, doc, parmext, path,
356 (INTP (show_flag) ? 370 (INTP (show_flag) ?
357 XINT (show_flag) : SW_SHOWDEFAULT)); 371 XINT (show_flag) : SW_SHOWDEFAULT));