mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
w32: Allow Unicode filenames for iobuf_cancel.
* common/iobuf.c (iobuf_cancel): Use gnupg_remove * common/mischelp.c (same_file_p): Allow for Unicode names. -- Note that the second patch is used to handle Unicode filenames which are symbolic links.
This commit is contained in:
parent
e3db6c74a6
commit
10db566489
3 changed files with 24 additions and 35 deletions
|
@ -80,35 +80,30 @@ same_file_p (const char *name1, const char *name2)
|
|||
#ifdef HAVE_W32_SYSTEM
|
||||
HANDLE file1, file2;
|
||||
BY_HANDLE_FILE_INFORMATION info1, info2;
|
||||
wchar_t *wname;
|
||||
|
||||
wname = gpgrt_fname_to_wchar (name1);
|
||||
if (wname)
|
||||
{
|
||||
file1 = CreateFileW (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
xfree (wname);
|
||||
}
|
||||
else
|
||||
file1 = INVALID_HANDLE_VALUE;
|
||||
|
||||
#ifdef HAVE_W32CE_SYSTEM
|
||||
{
|
||||
wchar_t *wname = utf8_to_wchar (name1);
|
||||
if (wname)
|
||||
file1 = CreateFile (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
else
|
||||
file1 = INVALID_HANDLE_VALUE;
|
||||
xfree (wname);
|
||||
}
|
||||
#else
|
||||
file1 = CreateFile (name1, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
#endif
|
||||
if (file1 == INVALID_HANDLE_VALUE)
|
||||
yes = 0; /* If we can't open the file, it is not the same. */
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_W32CE_SYSTEM
|
||||
{
|
||||
wchar_t *wname = utf8_to_wchar (name2);
|
||||
if (wname)
|
||||
file2 = CreateFile (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
else
|
||||
file2 = INVALID_HANDLE_VALUE;
|
||||
xfree (wname);
|
||||
}
|
||||
#else
|
||||
file2 = CreateFile (name2, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
#endif
|
||||
wname = gpgrt_fname_to_wchar (name2);
|
||||
if (wname)
|
||||
{
|
||||
file2 = CreateFileW (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
xfree (wname);
|
||||
}
|
||||
else
|
||||
file2 = INVALID_HANDLE_VALUE;
|
||||
|
||||
if (file2 == INVALID_HANDLE_VALUE)
|
||||
yes = 0; /* If we can't open the file, it is not the same. */
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue