Fossil

Check-in [02a6aa2d]
Login

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

Overview
Comment:Make arrangements for the output of "fossil status" to go through the UTF8 to MBCS translation. Ticket [3f0216560679fd]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 02a6aa2d5e3ea14de47debbdb93ca8d2fb5c113e
User & Date: drh 2011-05-26 11:29:06
Context
2011-05-26
11:57
Add the --systemtrace option for debugging calls to fossil_system. check-in: 5a4dc223 user: drh tags: trunk
11:29
Make arrangements for the output of "fossil status" to go through the UTF8 to MBCS translation. Ticket [3f0216560679fd] check-in: 02a6aa2d user: drh tags: trunk
2011-05-25
13:54
Update the Mac icon for the download page. check-in: a2e1c483 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/blob.c.

709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
...
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
**
** If the filename is blank or "-" then write to standard output.
**
** Return the number of bytes written.
*/
int blob_write_to_file(Blob *pBlob, const char *zFilename){
  FILE *out;
  int needToClose;
  int wrote;

  if( zFilename[0]==0 || (zFilename[0]=='-' && zFilename[1]==0) ){
    out = stdout;
    needToClose = 0;
  }else{
    int i, nName;
    char *zName, zBuf[1000];

    nName = strlen(zFilename);
    if( nName>=sizeof(zBuf) ){
      zName = mprintf("%s", zFilename);
................................................................................
      }
    }
    out = fossil_fopen(zName, "wb");
    if( out==0 ){
      fossil_fatal_recursive("unable to open file \"%s\" for writing", zName);
      return 0;
    }
    needToClose = 1;
    if( zName!=zBuf ) free(zName);
  }
  blob_is_init(pBlob);
  wrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
  if( needToClose ) fclose(out);
  if( wrote!=blob_size(pBlob) && out!=stdout ){
    fossil_fatal_recursive("short write: %d of %d bytes to %s", wrote,
       blob_size(pBlob), zFilename);
  }
  return wrote;
}








<



|
|







 







<




|







709
710
711
712
713
714
715

716
717
718
719
720
721
722
723
724
725
726
727
...
752
753
754
755
756
757
758

759
760
761
762
763
764
765
766
767
768
769
770
**
** If the filename is blank or "-" then write to standard output.
**
** Return the number of bytes written.
*/
int blob_write_to_file(Blob *pBlob, const char *zFilename){
  FILE *out;

  int wrote;

  if( zFilename[0]==0 || (zFilename[0]=='-' && zFilename[1]==0) ){
    fossil_puts(blob_str(pBlob), 0);
    return blob_size(pBlob);
  }else{
    int i, nName;
    char *zName, zBuf[1000];

    nName = strlen(zFilename);
    if( nName>=sizeof(zBuf) ){
      zName = mprintf("%s", zFilename);
................................................................................
      }
    }
    out = fossil_fopen(zName, "wb");
    if( out==0 ){
      fossil_fatal_recursive("unable to open file \"%s\" for writing", zName);
      return 0;
    }

    if( zName!=zBuf ) free(zName);
  }
  blob_is_init(pBlob);
  wrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
  fclose(out);
  if( wrote!=blob_size(pBlob) && out!=stdout ){
    fossil_fatal_recursive("short write: %d of %d bytes to %s", wrote,
       blob_size(pBlob), zFilename);
  }
  return wrote;
}