[poppler] goo/gfile.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Apr 3 11:04:40 PDT 2008


 goo/gfile.cc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0b714a61383da1b62daf2a60e3f6fcda09b4e9f2
Author: Adam Batkin <adam at batkin.net>
Date:   Thu Apr 3 20:02:52 2008 +0200

    FindFirstFile returns INVALID_HANDLE_VALUE and not NULL on error

diff --git a/goo/gfile.cc b/goo/gfile.cc
index 24ff63f..811ad14 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -657,9 +657,9 @@ GDir::GDir(char *name, GBool doStatA) {
 GDir::~GDir() {
   delete path;
 #if defined(WIN32)
-  if (hnd) {
+  if (hnd != INVALID_HANDLE_VALUE) {
     FindClose(hnd);
-    hnd = NULL;
+    hnd = INVALID_HANDLE_VALUE;
   }
 #elif defined(ACORN)
 #elif defined(MACOS)
@@ -673,11 +673,11 @@ GDirEntry *GDir::getNextEntry() {
   GDirEntry *e;
 
 #if defined(WIN32)
-  if (hnd) {
+  if (hnd != INVALID_HANDLE_VALUE) {
     e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
-    if (hnd  && !FindNextFile(hnd, &ffd)) {
+    if (!FindNextFile(hnd, &ffd)) {
       FindClose(hnd);
-      hnd = NULL;
+      hnd = INVALID_HANDLE_VALUE;
     }
   } else {
     e = NULL;
@@ -719,7 +719,7 @@ void GDir::rewind() {
 #ifdef WIN32
   GooString *tmp;
 
-  if (hnd)
+  if (hnd != INVALID_HANDLE_VALUE)
     FindClose(hnd);
   tmp = path->copy();
   tmp->append("/*.*");


More information about the poppler mailing list