Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 62c960917..c00420d5d 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -734,15 +734,19 @@ handle_to_fn (HANDLE h, char *posix_fn)
DWORD res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf), NULL);
- // NT seems to do this on an unopened file
- if (!ntfn->Name.Buffer)
- return NULL;
-
if (res)
{
strcpy (posix_fn, "some disk file");
return posix_fn;
}
+
+ // NT seems to do this on an unopened file
+ if (!ntfn->Name.Buffer)
+ {
+ debug_printf ("nt->Name.Buffer == NULL");
+ return NULL;
+ }
+
ntfn->Name.Buffer[ntfn->Name.Length / sizeof (WCHAR)] = 0;
char win32_fn[MAX_PATH + 100];