[shlwapi] Path: Fix to PathRemoveExtension()

carlo.bramix at libero.it carlo.bramix at libero.it
Mon Apr 9 16:55:53 CDT 2012


FROM BUG #29099:

I tried to do some debugging on this bug and I discovered that
PathRemoveExtension() crashes on Windows too if a constant string like 
"labview.
txt"is given as parameter, but it does not if the parameter is just "labview":
still constant but without dot and extension.

The implementation of PathRemoveExtensionA/W in the source of WINE is using
PathFindExtensionA/W for finding the extension to be removed; according to
MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773587%28v=vs.85%29.
aspx

"Returns the address of the "." that precedes the extension within pszPath if
an extension is found, or the address of the terminating null character
otherwise."

So, the only logical explanation I can think on this behavior is that the
function does not write the NUL character if it is already existing at the
given position. This condition makes lucky working the function, but the 
reason
why LabView is feeding a constant string is a bit unknown to me...

Sincerely,

Carlo Bramini.

PS: I clicked the wrong button and previous email was started with missing the 
object.
Sorry, please excuse me.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: path.txt
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120409/f6896666/attachment.txt>


More information about the wine-patches mailing list