From a6229b9e7bc96026dc1f81e83ea4b7206104325f Mon Sep 17 00:00:00 2001
From: Tess Gauthier <tessgauthier@microsoft.com>
Date: Mon, 28 Aug 2023 14:51:40 -0400
Subject: [PATCH] fix hostkey tests

---
 contrib/win32/win32compat/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/win32/win32compat/misc.c b/contrib/win32/win32compat/misc.c
index 035b6f6c8..09b7764df 100644
--- a/contrib/win32/win32compat/misc.c
+++ b/contrib/win32/win32compat/misc.c
@@ -291,7 +291,7 @@ error:
 }
 
 /*fopen on Windows to mimic https://linux.die.net/man/3/fopen
-* only r, w, a are supported for now
+* only r, w, a, a+ are supported for now
 */
 FILE *
 w32_fopen_utf8(const char *input_path, const char *mode)
@@ -304,7 +304,7 @@ w32_fopen_utf8(const char *input_path, const char *mode)
 	errno_t r = 0;
 	int nonfs_dev = 0; /* opening a non file system device */
 
-	if (mode == NULL || mode[1] != '\0') {
+	if (mode == NULL || (mode[1] != '\0' && strncmp(mode, "a+", 2) != 0)) {
 		errno = ENOTSUP;
 		return NULL;
 	}