mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 02:24:46 +08:00
* win32-nat.c (register_loaded_dll): Handle case where FindFirstFile fails.
This commit is contained in:
parent
ff3a6ee3fd
commit
c914e0cc47
@ -1,3 +1,8 @@
|
||||
2002-02-20 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* win32-nat.c (register_loaded_dll): Handle case where FindFirstFile
|
||||
fails.
|
||||
|
||||
2002-02-20 Daniel Jacobowitz <drow@mvista.com>
|
||||
|
||||
* jv-exp.y (parse_number): Change type of implicit longs
|
||||
|
@ -582,16 +582,19 @@ register_loaded_dll (const char *name, DWORD load_addr)
|
||||
HANDLE h = FindFirstFile(name, &w32_fd);
|
||||
size_t len;
|
||||
|
||||
FindClose (h);
|
||||
strcpy (buf, name);
|
||||
if (GetCurrentDirectory (MAX_PATH + 1, cwd))
|
||||
if (h)
|
||||
{
|
||||
p = strrchr (buf, '\\');
|
||||
if (p)
|
||||
p[1] = '\0';
|
||||
SetCurrentDirectory (buf);
|
||||
GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
|
||||
SetCurrentDirectory (cwd);
|
||||
FindClose (h);
|
||||
strcpy (buf, name);
|
||||
if (GetCurrentDirectory (MAX_PATH + 1, cwd))
|
||||
{
|
||||
p = strrchr (buf, '\\');
|
||||
if (p)
|
||||
p[1] = '\0';
|
||||
SetCurrentDirectory (buf);
|
||||
GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
|
||||
SetCurrentDirectory (cwd);
|
||||
}
|
||||
}
|
||||
|
||||
cygwin_conv_to_posix_path (buf, ppath);
|
||||
|
@ -582,16 +582,19 @@ register_loaded_dll (const char *name, DWORD load_addr)
|
||||
HANDLE h = FindFirstFile(name, &w32_fd);
|
||||
size_t len;
|
||||
|
||||
FindClose (h);
|
||||
strcpy (buf, name);
|
||||
if (GetCurrentDirectory (MAX_PATH + 1, cwd))
|
||||
if (h)
|
||||
{
|
||||
p = strrchr (buf, '\\');
|
||||
if (p)
|
||||
p[1] = '\0';
|
||||
SetCurrentDirectory (buf);
|
||||
GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
|
||||
SetCurrentDirectory (cwd);
|
||||
FindClose (h);
|
||||
strcpy (buf, name);
|
||||
if (GetCurrentDirectory (MAX_PATH + 1, cwd))
|
||||
{
|
||||
p = strrchr (buf, '\\');
|
||||
if (p)
|
||||
p[1] = '\0';
|
||||
SetCurrentDirectory (buf);
|
||||
GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
|
||||
SetCurrentDirectory (cwd);
|
||||
}
|
||||
}
|
||||
|
||||
cygwin_conv_to_posix_path (buf, ppath);
|
||||
|
Loading…
Reference in New Issue
Block a user