Hi,
2014/1/11 Sat 0:24:26 UTC+9 Ken Takata wrote:
> This issue can be fixed by mattn's following patch:
> https://groups.google.com/d/topic/vim_dev/eEBXYLz0NHI/discussion
>
> The patch is already listed in the todo.txt:
> > Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan
> > 30)
It seems that mattn's patch needs update for the latest source code.
Additionally,
+ wcscpy(wnewpath, L";.;");
(snip)
+ STRCPY(newpath, ";.;");
the first ";" of each line is unnecessary, I think.
Updated patch is attached.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1863,6 +1863,8 @@
{
char *dum;
char fname[_MAX_PATH];
+ char *path, *newpath;
+ long n;
#ifdef FEAT_MBYTE
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
@@ -1870,11 +1872,19 @@
WCHAR *p = enc_to_utf16(name, NULL);
WCHAR fnamew[_MAX_PATH];
WCHAR *dumw;
- long n;
+ WCHAR *wpath, *wnewpath;
if (p != NULL)
{
- n = (long)SearchPathW(NULL, p, NULL, _MAX_PATH, fnamew, &dumw);
+ wpath = _wgetenv(L"PATH");
+ wnewpath = (WCHAR*)alloc((unsigned)(wcslen(wpath) + 3)
+ * sizeof(WCHAR));
+ if (wnewpath == NULL)
+ return FALSE;
+ wcscpy(wnewpath, L".;");
+ wcscat(wnewpath, wpath);
+ n = (long)SearchPathW(wnewpath, p, NULL, _MAX_PATH, fnamew, &dumw);
+ vim_free(wnewpath);
vim_free(p);
if (n > 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
{
@@ -1888,7 +1898,16 @@
}
}
#endif
- if (SearchPath(NULL, name, NULL, _MAX_PATH, fname, &dum) == 0)
+
+ path = getenv("PATH");
+ newpath = (char*)alloc((unsigned)(STRLEN(path) + 3));
+ if (newpath == NULL)
+ return FALSE;
+ STRCPY(newpath, ".;");
+ STRCAT(newpath, path);
+ n = (long)SearchPath(newpath, name, NULL, _MAX_PATH, fname, &dum);
+ vim_free(newpath);
+ if (n == 0)
return FALSE;
if (mch_isdir(fname))
return FALSE;