aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-06-23 10:26:21 +0100
committerRon Yorston <rmy@pobox.com>2023-06-23 10:33:30 +0100
commit2984235570c2374adb9ee3234a61f193ee86d654 (patch)
tree1e9527eafb1920772140a958c7a92cf082a05b41
parent1dda33d8c7da2a8a6ab2ed2805fc9bd50c1a0a4f (diff)
downloadbusybox-w32-2984235570c2374adb9ee3234a61f193ee86d654.tar.gz
busybox-w32-2984235570c2374adb9ee3234a61f193ee86d654.tar.bz2
busybox-w32-2984235570c2374adb9ee3234a61f193ee86d654.zip
win32: reduce impact of euro support (2)
winansi_OemToCharBuff() needs to call the real OemToCharBuff(), not itself! (GitHub issue #335)
-rw-r--r--win32/winansi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/winansi.c b/win32/winansi.c
index 45bb8806c..faae44dac 100644
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -751,13 +751,14 @@ static BOOL winansi_CharToOem(LPCSTR s, LPSTR d)
751 return winansi_CharToOemBuff(s, d, strlen(s)+1); 751 return winansi_CharToOemBuff(s, d, strlen(s)+1);
752} 752}
753 753
754#undef OemToCharBuff
754BOOL winansi_OemToCharBuff(LPCSTR s, LPSTR d, DWORD len) 755BOOL winansi_OemToCharBuff(LPCSTR s, LPSTR d, DWORD len)
755{ 756{
756 WCHAR *buf; 757 WCHAR *buf;
757 int i; 758 int i;
758 759
759 if (GetConsoleCP() != 858) 760 if (GetConsoleCP() != 858)
760 return OemToCharBuff(s, d, len); 761 return OemToCharBuffA(s, d, len);
761 762
762 if (!s || !d) 763 if (!s || !d)
763 return FALSE; 764 return FALSE;
@@ -779,6 +780,7 @@ BOOL winansi_OemToCharBuff(LPCSTR s, LPSTR d, DWORD len)
779# undef CharToOem 780# undef CharToOem
780# define CharToOemBuff winansi_CharToOemBuff 781# define CharToOemBuff winansi_CharToOemBuff
781# define CharToOem winansi_CharToOem 782# define CharToOem winansi_CharToOem
783# define OemToCharBuff winansi_OemToCharBuff
782#endif 784#endif
783 785
784static int ansi_emulate(const char *s, FILE *stream) 786static int ansi_emulate(const char *s, FILE *stream)