Date: Thu, 3 Feb 2000 19:27:10 +0200 (WET) From: Andris Pavenis To: Mumit Khan , djgpp-workers AT delorie DOT com Subject: Re: (patch) updated protoize patch In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Here is patch to avoids trying to generate relative paths in shortpath() in protoize.c on DOS based file systems when files are on different drives. Currently I still treated /foo/bar and c:/foo/bar as different when C: is current drive (perhaps there is no harm from that). Patch is for gcc-2.95.2 Andris --- protoize.c~1 Tue Feb 1 10:57:44 2000 +++ protoize.c Thu Feb 3 19:30:00 2000 @@ -1471,6 +1471,23 @@ shortpath (cwd, filename) cwd_p++; path_p++; } + +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + /* For DOS based file system we should chech whether cwd_p and path_p + points to the same drive. Only then we can look for relative paths */ + if ((cwd_p[0] && cwd_p[1]==':' && IS_DIR_SEPARATOR(cwd_p[2])) || + (path_p[0] && path_p[1]==':' && IS_DIR_SEPARATOR(path_p[2]))) + { + if (!IS_SAME_PATH_CHAR(cwd_p[0],path_p[0]) || + cwd_p[1]!=path_p[1] || + !IS_DIR_SEPARATOR(cwd_p[2]) || + !IS_DIR_SEPARATOR(path_p[2])) + { + return filename; + } + } +#endif + if (!*cwd_p && (!*path_p || IS_DIR_SEPARATOR (*path_p))) { /* whole pwd matched */