On Thu, Nov 02, 2000 at 10:19:25AM +0600, Ian Pilcher wrote:
> First the disclaimer: I am not an experienced WINE developer, or even
> a frequent coder; call me a motivated power user.
>
> I use WINE to run one application, Lotus Notes 4.6.7, and I must say
> that the job that the WINE team has done is absolutely remarkable. Well
> done!
>
> Attaching files to Notes has always been somewhat problematic. Until
> recently it required the use of native DLLs, but WINE 20001002 seemed to
> remove this dependency. WINE 20001026, on the other hand, seemed to
> break it entirely. The symptom is that after the user selects a file,
> "foo", for attachment an error dialog pops up, stating that
> "foo<garbage characters>" does not exist.
>
> Some further experimentation revealed that 20001002 didn't really work
> either. A user can successfully attach a file immediately after
> starting Notes, but if the user first detaches a file the "garbage"
> problem appears. Interestingly, the "garbage" characters in this case
> are sometimes part of of the Notes user ID of the sender of the note
> from which the file was detached previously. (Got that?) This led me
> to suspect that either:
>
> - a buffer is not being properly cleared (by Notes or WINE), or
>
> - the file name string is not being properly terminated (by Notes
> or WINE).
>
> After much perusal of dlls/commdlg/filedlg95.c, I was able to locate the
> point at which FILEDLG95_OnOpen returns the filename in fodInfos->
> ofnInfos->lpstrFile. I created a quick hack (patch attached) which adds
> an additional '\0' to the end of the string. Much to my surprise, it
> seems to actually work.
Yes.
Actually this bug fix has been done in the Corel tree, but I wasn't sure
whether I should add it to Wine, as I'm not experienced enough in that area
to be able to judge whether it's valid or not.
/* fill destination buffer */
strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile);
+ fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)] = '\0';
+ fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)+1] = '\0';
That's approximately what Corel did.
So should we include that fix ?
Andreas Mohr