Patch for path.cc

John Paulson munch@powertv.com
Thu Jun 8 20:31:00 GMT 2000


Problem:
 At work we develop using cygwin. Some source is inhouse,
 other comes from outside. Most source has "/" as the path
 delimiter. However, some outside source has "\" in various
 places (such as #include). Cygwin prior to 1.1 (b20 and 99r1)
 handled this properly. Cygwin 1.1 and later don't; the "\"
 forces interpretation as an MS-DOS path and the "/" aren't
 properly translated. We don't want to edit files to convert
 "\" to "/"; that is not acceptable.
Solution:
 This change will treat a path as an MS-DOS path if one of two
 conditions are true:
 The path has a ":" character in it, or
 The path has a "\" character and no "/" character.
 The previous test was if either ":" or "\" was present.
ChangeLog entry
2000年06月08日 munch paulson <munch@powertv.com>
	* path.cc (mount_info::conv_to_win32_path): if both '\' and '/' in
	path then treat as posix path, not win.
Patch
*** path.cc.orig	Thu Jun 8 19:32:08 2000
--- path.cc	Thu Jun 8 19:40:04 2000
***************
*** 942,950 ****
 if (dst == NULL)
 goto out;		/* Sanity check. */
! /* An MS-DOS spec has either a : or a \. If this is found, short
 circuit most of the rest of this function. */
! if (strpbrk (src_path, ":\\") != NULL)
 {
 debug_printf ("%s already win32", src_path);
 rc = normalize_win32_path (current_directory_name, src_path, dst);
--- 942,951 ----
 if (dst == NULL)
 goto out;		/* Sanity check. */
! /* An MS-DOS spec has either a : or a \ and no /. If this is found, short
 circuit most of the rest of this function. */
! if (strchr (src_path, ':') != NULL
! || (strchr (src_path, '\\') != NULL && strchr (src_path, '/') == NULL))
 {
 debug_printf ("%s already win32", src_path);
 rc = normalize_win32_path (current_directory_name, src_path, dst);
----------------------------
John Paulson
PowerTV, Inc.
Tel: 408/777-4769
Fax: 408/777-0176
mailto:paulson@powertv.com
http://www.powertv.com/
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /