This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Fix argv[0] for dos based filesystem


Kai Tietz wrote:

The problem fixed here is related to the backslashes in argv[0] on dos
based file systems. If you build gcc with option --prefix and
--with-sysroot, gcc uses argv[0] to find the location of the exec_dir.
This path is used within spec parser to relocate the tools, but it
additional eats the backslashes from the path, because they are not
quoted.

I hope I could explain the problem,

In that case, it sounds like the fix is to escape the backslashes in argv[0] -- probably on *all* systems -- before passing it to the specs system. A directory named "x\y" (that's a literal backslash!) is perfectly valid on a UNIX system, and we need to escape that string there too.


IIRC, changing backslashes to forward slashes on Windows is not in general safe; at least on some older versions of the OS, some system functions don't work correctly. And, you certainly confuse users; if I use "C:\foo\bar" as the name of a file, that's what I expect an application to call it too.

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]