[poppler] [PATCH] Fix GDir's handling of return values from FindFirstFile
Patrick Spendrin
ps_ml at gmx.de
Thu Apr 3 14:12:16 PDT 2008
Albert Astals Cid schrieb:
> A Dijous 03 Abril 2008, Adam Batkin va escriure:
>> Hi,
>>
>> I believe that there is a small bug in GDir's Windows implementation, if
>> called on a directory that does not exist and you then try to enumerate
>> its entries (getNextEntry()).
>>
>> Basically GDir was storing the return value of its call to
>> FindFirstFile() in GDir::hnd, but using NULL as a sentinel for invalid
>> values, but in fact FindFirstFile() returns INVALID_HANDLE_VALUE (-1).
>>
>> This patch replaces assignments to NULL with assignments to
>> INVALID_HANDLE_VALUE and all checks now check against
>> INVALID_HANDLE_VALUE instead of NULL.
>>
>> So if you are ever using poppler on Windows and your app suddenly
>> crashes (which I was only able to do by compiling with all the debugging
>> options turned on, otherwise I only got funny entries in my log like
>> "Error: Couldn't open 'nameToUnicode' file
>> 'D:\kde-mingw\share\poppler\nameToUnicode\{„žYø!'") this may be why.
>>
>> You know what would also be nice...(would you be open to a patch?) not
>> hardcoding POPPLER_DATADIR, since especially on Windows you never know
>> where it will be installed.
>
> Patch pushed to the repo.
>
> And we are always open to interesting patches, but what are you going to do to
> search for the POPPLER_DATADIR? Check each and every directory?
Yes, I think as the poppler Windows packages you seem to use are not
stable yet, you might consider translating poppler on your own - if you
have any questions you can ask me of course. Then the directory will be
set correctly.
regards
Patrick
>
>> I hope this helps (and I hope I did everything properly...),
>>
>> -Adam Batkin
>
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
--
web: http://windows.kde.org
mailing list: kde-windows at kde.org
irc: #kde-windows (irc.freenode.net)
More information about the poppler
mailing list