Fossil

Check-in [fa4371f3b5]
Login

Check-in [fa4371f3b5]

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

Overview
Comment:Cleanup: Move all occurrences of setmode() into fossil_binary_mode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fa4371f3b53de0e3a2ed106b7e0dd4c3c8069e70
User & Date: drh 2012-04-06 13:05:15.045
Context
2012-04-06
17:24
(1) Show cherrypick and backout merges in the status command (2) Allow partial commits of cherrypick and backout merges (3) Prompt user to continue if a check-in comment is unedited (4) Fixing a jump on uninitialized data on web sbs diff - cherrypick of [92b2a5c390467a] (5) Updates against an uncommitted merge are now a warning, not a fatal error. ... (check-in: 195517a9c9 user: drh tags: trunk)
13:05
Cleanup: Move all occurrences of setmode() into fossil_binary_mode. ... (check-in: fa4371f3b5 user: drh tags: trunk)
2012-04-02
01:19
Fix a bug in the previous check-in. ... (check-in: b65ed0b106 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
710
711
712
713
714
715
716



717
718
719
720
721
722
723
** Turn off any NL to CRNL translation on the stream given as an
** argument.  This is a no-op on unix but is necessary on windows.
*/
void fossil_binary_mode(FILE *p){
#if defined(_WIN32)
  _setmode(_fileno(p), _O_BINARY);
#endif



}



/*
** Return a name for an SQLite error code
*/







>
>
>







710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
** Turn off any NL to CRNL translation on the stream given as an
** argument.  This is a no-op on unix but is necessary on windows.
*/
void fossil_binary_mode(FILE *p){
#if defined(_WIN32)
  _setmode(_fileno(p), _O_BINARY);
#endif
#ifdef __EMX__     /* OS/2 */
  setmode(fileno(p), O_BINARY);
#endif
}



/*
** Return a name for an SQLite error code
*/
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
  if( g.argc==3 && fossil_strcmp(g.argv[1],"cgi")==0 ){
    zFile = g.argv[2];
  }else{
    zFile = g.argv[1];
  }
  g.httpOut = stdout;
  g.httpIn = stdin;
#if defined(_WIN32)
  /* Set binary mode on windows to avoid undesired translations
  ** between \n and \r\n. */
  setmode(_fileno(g.httpOut), _O_BINARY);
  setmode(_fileno(g.httpIn), _O_BINARY);
#endif
#ifdef __EMX__
  /* Similar hack for OS/2 */
  setmode(fileno(g.httpOut), O_BINARY);
  setmode(fileno(g.httpIn), O_BINARY);
#endif
  g.cgiOutput = 1;
  blob_read_from_file(&config, zFile);
  while( blob_line(&config, &line) ){
    if( !blob_token(&line, &key) ) continue;
    if( blob_buffer(&key)[0]=='#' ) continue;
    if( blob_eq(&key, "debug:") && blob_token(&line, &value) ){
      g.fDebug = fopen(blob_str(&value), "a");







<
<
<
<
<
<
<
<
|
|
<







1407
1408
1409
1410
1411
1412
1413








1414
1415

1416
1417
1418
1419
1420
1421
1422
  if( g.argc==3 && fossil_strcmp(g.argv[1],"cgi")==0 ){
    zFile = g.argv[2];
  }else{
    zFile = g.argv[1];
  }
  g.httpOut = stdout;
  g.httpIn = stdin;








  fossil_binary_mode(g.httpOut);
  fossil_binary_mode(g.httpIn);

  g.cgiOutput = 1;
  blob_read_from_file(&config, zFile);
  while( blob_line(&config, &line) ){
    if( !blob_token(&line, &key) ) continue;
    if( blob_buffer(&key)[0]=='#' ) continue;
    if( blob_eq(&key, "debug:") && blob_token(&line, &value) ){
      g.fDebug = fopen(blob_str(&value), "a");