Fossil

Check-in [9073d8dc]
Login

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

Overview
Comment:Fix an out-of-order variable declaration in blob.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9073d8dcc7611952088f9ce7621d5d0e7d083fde
User & Date: drh 2012-11-02 21:33:54
Context
2012-11-02
21:38
Add the -g option to builds using the Mingw makefile. check-in: 004a31a6 user: drh tags: trunk
21:33
Fix an out-of-order variable declaration in blob.c. check-in: 9073d8dc user: drh tags: trunk
21:20
Fix a segfault that occurs with the "fossil md5sum" command when files named on the command-line do not actually exist. Ticket [8ca2aae39172f90c]. check-in: 52199a50 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/blob.c.

1119
1120
1121
1122
1123
1124
1125
1126
1127

1128
1129
1130
1131
1132
1133
1134
    zUtf8 = blob_str(pBlob) + 2;
    zUtf8 = fossil_unicode_to_utf8(zUtf8);
    blob_zero(pBlob);
    blob_append(pBlob, zUtf8, -1);
    fossil_mbcs_free(zUtf8);
  }else if( blob_size(pBlob)>1 && (blob_size(pBlob)&1)==0
      && memcmp(blob_buffer(pBlob), &urbom, 2)==0 ) {
    zUtf8 = blob_buffer(pBlob);
    unsigned int i = blob_size(pBlob);

    while( i > 0 ){
        /* swap bytes of unicode representation */
        char temp = zUtf8[--i];
        zUtf8[i] = zUtf8[i-1];
        zUtf8[--i] = temp;
    }
    /* Make sure the blob contains two terminating 0-bytes */







<

>







1119
1120
1121
1122
1123
1124
1125

1126
1127
1128
1129
1130
1131
1132
1133
1134
    zUtf8 = blob_str(pBlob) + 2;
    zUtf8 = fossil_unicode_to_utf8(zUtf8);
    blob_zero(pBlob);
    blob_append(pBlob, zUtf8, -1);
    fossil_mbcs_free(zUtf8);
  }else if( blob_size(pBlob)>1 && (blob_size(pBlob)&1)==0
      && memcmp(blob_buffer(pBlob), &urbom, 2)==0 ) {

    unsigned int i = blob_size(pBlob);
    zUtf8 = blob_buffer(pBlob);
    while( i > 0 ){
        /* swap bytes of unicode representation */
        char temp = zUtf8[--i];
        zUtf8[i] = zUtf8[i-1];
        zUtf8[--i] = temp;
    }
    /* Make sure the blob contains two terminating 0-bytes */