aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/iobuf.c2
-rw-r--r--common/mischelp.c21
2 files changed, 20 insertions, 3 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index 2137604a9..c88d67908 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -1282,7 +1282,7 @@ iobuf_cancel (iobuf_t a)
{
/* Argg, MSDOS does not allow removing open files. So
* we have to do it here */
- remove (remove_name);
+ gnupg_remove (remove_name);
xfree (remove_name);
}
diff --git a/common/mischelp.c b/common/mischelp.c
index 68fd2bc24..ee8500297 100644
--- a/common/mischelp.c
+++ b/common/mischelp.c
@@ -80,13 +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;
- file1 = CreateFile (name1, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
if (file1 == INVALID_HANDLE_VALUE)
yes = 0; /* If we can't open the file, it is not the same. */
else
{
- file2 = CreateFile (name2, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ 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