Fossil

Check-in [434adc35]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Eliminate fossil_utf8_to_console() for non-windows platforms: it isn't used then. Thanks to "bytevolcano" for the suggestion.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:434adc35fc75e5fef19809e944e40f72f1e4a0ddb98f02f53764cd9b4dfa8ed8
User & Date: jan.nijtmans 2017-11-30 10:15:48
Context
2017-11-30
11:34
Fix the default CSS diff coloring, broken by check-in [5c9c51be5f033de2] check-in: 3b988301 user: drh tags: trunk
10:15
Eliminate fossil_utf8_to_console() for non-windows platforms: it isn't used then. Thanks to "bytevolcano" for the suggestion. check-in: 434adc35 user: jan.nijtmans tags: trunk
05:09
Still more improvements to the test-file-environment command. check-in: 84347382 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/utf8.c.

303
304
305
306
307
308
309

310
311
312
313
314
315
316
317
318
319
320
321
322
...
350
351
352
353
354
355
356
357
358
359
360


/*
** Display UTF-8 on the console.  Return the number of
** Characters written. If stdout or stderr is redirected
** to a file, -1 is returned and nothing is written
** to the console.
*/

int fossil_utf8_to_console(
  const char *zUtf8,
  int nByte,
  int toStdErr
){
#ifdef _WIN32
  int nChar, written = 0;
  wchar_t *zUnicode; /* Unicode version of zUtf8 */
  DWORD dummy;
  Blob blob;

  static int istty[2] = { -1, -1 };
  assert( toStdErr==0 || toStdErr==1 );
................................................................................
    WriteConsoleW(GetStdHandle(
        toStdErr ? STD_ERROR_HANDLE : STD_OUTPUT_HANDLE),
        zUnicode + written, size, &dummy, 0);
    written += size;
  }
  fossil_free(zUnicode);
  return nChar;
#else
  return -1;  /* No-op on unix */
#endif
}








>





<







 







<
<
<

>
303
304
305
306
307
308
309
310
311
312
313
314
315

316
317
318
319
320
321
322
...
350
351
352
353
354
355
356



357
358

/*
** Display UTF-8 on the console.  Return the number of
** Characters written. If stdout or stderr is redirected
** to a file, -1 is returned and nothing is written
** to the console.
*/
#ifdef _WIN32
int fossil_utf8_to_console(
  const char *zUtf8,
  int nByte,
  int toStdErr
){

  int nChar, written = 0;
  wchar_t *zUnicode; /* Unicode version of zUtf8 */
  DWORD dummy;
  Blob blob;

  static int istty[2] = { -1, -1 };
  assert( toStdErr==0 || toStdErr==1 );
................................................................................
    WriteConsoleW(GetStdHandle(
        toStdErr ? STD_ERROR_HANDLE : STD_OUTPUT_HANDLE),
        zUnicode + written, size, &dummy, 0);
    written += size;
  }
  fossil_free(zUnicode);
  return nChar;



}
#endif