1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2026-10-23 06:08:56 +03:00

WIP busybox: update UTF-8 manifest (#315)

This commit is contained in:
Christopher Wellons
2025-12-01 13:15:59 -05:00
parent b5b123da5b
commit 0391bf96bd
2 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,47 @@
diff --git a/win32/resources/utf8.manifest b/win32/resources/utf8.manifest
index efe6a3d2f..70cd1c070 100644
--- a/win32/resources/utf8.manifest
+++ b/win32/resources/utf8.manifest
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="busybox.exe" version="6.0.0.0"/>
- <application>
- <windowsSettings>
+ <asmv3:application>
+ <asmv3:windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
- </windowsSettings>
- </application>
+ </asmv3:windowsSettings>
+ </asmv3:application>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -1456,6 +1456,7 @@ static int writeCon_utf8(int fd, const char *u8buf, size_t u8siz)
HANDLE h = (HANDLE)_get_osfhandle(fd);
int wlen = 0;
+ DWORD nwritten = 0;
if (!wbuf)
wbuf = xmalloc(wbufwsiz * sizeof(wchar_t));
@@ -1519,13 +1520,13 @@ static int writeCon_utf8(int fd, const char *u8buf, size_t u8siz)
// flush if we have less than two empty spaces
if (wlen > wbufwsiz - 2) {
- if (!WriteConsoleW(h, wbuf, wlen, 0, 0))
+ if (!WriteConsoleW(h, wbuf, wlen, &nwritten, 0) || nwritten != wlen)
return -1;
wlen = 0;
}
}
- if (wlen && !WriteConsoleW(h, wbuf, wlen, 0, 0))
+ if (wlen && (!WriteConsoleW(h, wbuf, wlen, &nwritten, 0) || nwritten != wlen))
return -1;
return 0;
}

View File

@@ -39,8 +39,7 @@
--disable-win32-registry \
+ --disable-win32-utf8-manifest \
--enable-mingw-wildcard \
@@ -384,3 +389,3 @@
RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \
- && make mingw64u_defconfig \
+ && make mingw64_defconfig \
&& sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \
@@ -425,2 +425,3 @@ RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \
&& sed -ri 's/^(CONFIG_XXD)=y/\1=n/' .config \
+ && sed -ri 's/^(CONFIG_FEATURE_USE_CNG_API)=y/\1=n/' .config \
&& make -j$(nproc) CROSS_COMPILE=$ARCH- \