Diff
Not logged in

Differences From Artifact [366d56c159]:

To Artifact [56a1d69405]:


812
813
814
815
816
817
818
819
820
821
822

823
824
825

826

827
828
829
830
831
832
833
834
835
836
837
838
839
840
812
813
814
815
816
817
818




819



820
821
822
823

824




825
826
827
828
829
830
831







-
-
-
-
+
-
-
-
+

+

-

-
-
-
-







**
** On windows, transform the output into the current terminal encoding
** if the output is going to the screen.  If output is redirected into
** a file, no translation occurs.  No translation ever occurs on unix.
*/
void fossil_puts(const char *z, int toStdErr){
#if defined(_WIN32)
  static int once = 1;
  static int istty[2];
  char *zToFree = 0;
  if( once ){
  if( fossil_utf8_to_console(z, strlen(z), toStdErr) >= 0 ){
    istty[0] = _isatty(fileno(stdout));
    istty[1] = _isatty(fileno(stderr));
    once = 0;
	  return;
  }
#endif
  assert( toStdErr==0 || toStdErr==1 );
  if( istty[toStdErr] ) z = zToFree = fossil_utf8_to_console(z);
  fwrite(z, 1, strlen(z), toStdErr ? stderr : stdout);
  free(zToFree);
#else
  fwrite(z, 1, strlen(z), toStdErr ? stderr : stdout);
#endif
  fflush(toStdErr ? stderr : stdout);
}

/*
** Write output for user consumption.  If g.cgiOutput is enabled, then
** send the output as part of the CGI reply.  If g.cgiOutput is false,
** then write on standard output.