Re: Patch for toolsets with spaces in them
Bram Moolenaar <[email protected]> Fri, 08 Oct 2004 22:17:33 +0200
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Cory Dodt wrote:
> Ran into this problem on Windows. Coworker had installed cygwin into
> C:\Program Files\cygwin. When we tried to run aap, we got:
>
> 'C:\Program' is not recognized as an internal or external executable,
> operable program or batch file.
>
> This occurs when mingw.py tries to detect the gcc --version.
>
> The patch to fix this:
>
> --- RecPython.py 2004-06-19 19:54:36.000000000 -0700
> +++ RecPython.py.patched 2004-10-08 10:03:59.915575800 -0700
> @@ -429,7 +429,7 @@
> x_ok = 1
> if not x_ok:
> continue
> - return fullname
> + return '"%s"' % (fullname,)
>
> return None
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?
--
hundred-and-one symptoms of being an internet addict:
97. Your mother tells you to remember something, and you look for
a File/Save command.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
-------------------------------------------------------
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