Re: Patch for toolsets with spaces in them

Cory Dodt <corydodt-wgPraSjSqjuEakHPNWoOSQC/[email protected]> Fri, 08 Oct 2004 13:31:33 -0700
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Yes, your patch fixes the same problem.  Awesome :-)

Thanks, Bram!

C



Bram Moolenaar wrote:
~ >
| Thanks for looking into this problem.
|
| I think this is not the right place to fix it.  Callers of
| program_path() should expect a literal file name.  But in some places
| the quotes need to be added.  I think ":progsearch" should do that.
| And the mingw tool.  Patch for these:
|
| *** Commands.py~	Sat Oct  2 20:10:16 2004
| --- Commands.py	Fri Oct  8 21:59:15 2004
| ***************
| *** 3093,3098 ****
| --- 3093,3103 ----
|       if not prog:
|           msg_note(recdict, _(':progsearch did not find any of %s')
|                                             % map(lambda x: x["name"],
args[1:]))
| +
| +     # If the program name includes a space put it in double quotes.
| +     if " " in prog:
| +         prog = '"%s"' % prog
| +
|       try:
|           rd[varname] = prog
|       except StandardError, e:
| *** tools/mingw.py~	Sat May  8 15:20:23 2004
| --- tools/mingw.py	Fri Oct  8 22:03:53 2004
| ***************
| *** 115,122 ****
|           if not path:
|               continue
|
|           # Run gcc with --version to see if it really is MingW
| !         ok, out = redir_system(path + ' --version', 0)
|           if not ok:
|               msg_log(rd, "%s returned error code" % path)
|               continue
| --- 115,128 ----
|           if not path:
|               continue
|
| +         # Add double quotes if the name contains a space.
| +         if " " in path:
| +             prog = '"%s"' % path
| +         else:
| +             prog = path
| +
|           # Run gcc with --version to see if it really is MingW
| !         ok, out = redir_system(prog + ' --version', 0)
|           if not ok:
|               msg_log(rd, "%s returned error code" % path)
|               continue
|
| Does that fix your problem?
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBZvkl3A5SrXAiHQcRAsiCAJ0Zl+bQ82OXpFjOZyA9BkFyFq9H6QCfSvJL
FaywIYquctaRHC/AToqjc7s=
=86lq
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl