VirtualBox

Changeset 3548 in kBuild


Ignore:
Timestamp:
Jan 29, 2022 2:41:10 AM (3 years ago)
Author:
bird
Message:

grep: Use get_crt_codepage(). Don't default to the UTF-8 manifest for older VCC versions as the CRT won't do the right thing.

Location:
trunk/src/grep
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/grep/Makefile.kmk

    r3537 r3548  
    134134       lib/strerror.c \
    135135       \
    136         ../lib/maybe_con_fwrite.c \
    137         ../lib/is_console.c \
     136        ../lib/get_codepage.c \
    138137        ../lib/nt/ntstat.c \
    139138        ../lib/nt/ntdir.c \
     
    240239        $(CP) -f -- "$^" "$@"
    241240
    242 if 1 # Add a manifest making UTF-8 as the active code page.
     241ifndef KBUILD_NEW_VCC # Add a manifest making UTF-8 as the active code page.
    243242kmk_grep_LNK_DEPS.win = \
    244243        $(kmk_grep_0_OUTDIR)/kmk_grep.manifest
  • trunk/src/grep/config.win.h

    r3536 r3548  
    25892589void w32_initialize_main(int *pcArgs, char ***ppapszArgs);
    25902590
     2591#include "get_codepage.h"
     2592
    25912593#endif /* !INCLUDED_CONFIG_WIN_H */
    25922594
  • trunk/src/grep/lib/regcomp.c

    r3532 r3548  
    882882# ifdef _MSC_VER
    883883  (void)codeset_name;
    884   if (GetACP() == 65001 /*utf-8*/)
     884  if (get_crt_codepage() == CP_UTF8)
    885885# else
    886886  codeset_name = nl_langinfo (CODESET);
  • trunk/src/grep/src/grep.c

    r3537 r3548  
    534534      g_fStdOutIsConsole = GetConsoleMode (s_hStdOut, &fModeIgnored)
    535535                         ? TRUE : FALSE;
    536       if (getenv("KMK_GREP_CONSOLE_DEBUG"))
    537         fprintf(stderr, "kmk_grep: g_fStdOutIsConsole=%d s_hStdOut=%p codepage=%u\n",
    538                 g_fStdOutIsConsole, s_hStdOut, ___lc_codepage_func());
     536      if (getenv ("KMK_GREP_CONSOLE_DEBUG"))
     537        fprintf (stderr, "kmk_grep: hStdOut=%p %sconsole codepage=%u ansi=%u\n",
     538                s_hStdOut, g_fStdOutIsConsole ? "" : "!",
     539                get_crt_codepage (), get_ansi_codepage ());
    539540    }
    540541  if (g_fStdOutIsConsole == TRUE && size && nmemb)
     
    560561          if (pawcBuf)
    561562            {
    562               int cwcToWrite = MultiByteToWideChar(___lc_codepage_func(),
     563              int cwcToWrite = MultiByteToWideChar(get_crt_codepage(),
    563564                                                   0 /*dwFlags*/,
    564565                                                   ptr, (int)cbToWrite,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette