Fossil SCM

Bug-fix: missing blob_zero. This commit is done with a big-endian unicode comment file

jan.nijtmans 2012-10-14 20:09 use-utf8-in-win-external-editor
Commit 8a0c2c366c655c8e025318889e7d7a970ae491c3
1 file changed +1
--- src/checkin.c
+++ src/checkin.c
@@ -1205,10 +1205,11 @@
12051205
static const unsigned short ubom = 0xfeff;
12061206
static const unsigned short urbom = 0xfffe;
12071207
if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
12081208
struct Blob temp;
12091209
char *zUtf8 = blob_str(&comment) + 3;
1210
+ blob_zero(&temp);
12101211
blob_append(&temp, zUtf8, -1);
12111212
fossil_mbcs_free(zUtf8);
12121213
blob_swap(&temp, &comment);
12131214
blob_reset(&temp);
12141215
}else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
12151216
--- src/checkin.c
+++ src/checkin.c
@@ -1205,10 +1205,11 @@
1205 static const unsigned short ubom = 0xfeff;
1206 static const unsigned short urbom = 0xfffe;
1207 if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
1208 struct Blob temp;
1209 char *zUtf8 = blob_str(&comment) + 3;
 
1210 blob_append(&temp, zUtf8, -1);
1211 fossil_mbcs_free(zUtf8);
1212 blob_swap(&temp, &comment);
1213 blob_reset(&temp);
1214 }else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
1215
--- src/checkin.c
+++ src/checkin.c
@@ -1205,10 +1205,11 @@
1205 static const unsigned short ubom = 0xfeff;
1206 static const unsigned short urbom = 0xfffe;
1207 if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
1208 struct Blob temp;
1209 char *zUtf8 = blob_str(&comment) + 3;
1210 blob_zero(&temp);
1211 blob_append(&temp, zUtf8, -1);
1212 fossil_mbcs_free(zUtf8);
1213 blob_swap(&temp, &comment);
1214 blob_reset(&temp);
1215 }else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
1216

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button