Fossil SCM

another attempt ۠

jan.nijtmans 2012-09-25 21:15 use-utf8-in-win-external-editor
Commit 4358a237783f9729909477a5ca3a21775e079703
1 file changed +4 -4
+4 -4
--- src/checkin.c
+++ src/checkin.c
@@ -1162,11 +1162,11 @@
11621162
static const unsigned short ubom = 0xfeff;
11631163
static const unsigned short urbom = 0xfffe;
11641164
if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
11651165
struct Blob temp;
11661166
char *zUtf8 = blob_str(&comment) + 3;
1167
- blob_set(&temp, zUtf8);
1167
+ blob_append(&temp, zUtf8, -1);
11681168
fossil_mbcs_free(zUtf8);
11691169
blob_swap(&temp, &comment);
11701170
blob_reset(&temp);
11711171
}else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
11721172
&& memcmp(blob_buffer(&comment), &ubom, 2)==0 ) {
@@ -1174,19 +1174,19 @@
11741174
/* Make sure the blob contains two terminating 0-bytes */
11751175
blob_append(&comment, "", 1);
11761176
zUtf8 = blob_str(&comment) + 2;
11771177
zUtf8 = fossil_unicode_to_utf8(zUtf8);
11781178
blob_zero(&comment);
1179
- blob_set(&comment, zUtf8);
1179
+ blob_append(&comment, zUtf8, -1);
11801180
fossil_mbcs_free(zUtf8);
11811181
}else if( blob_size(&comment)>1
1182
- && memcmp(blob_buffer(&comment), &urbom, 2)==0 ){
1182
+ && memcmp(blob_buffer(&comment), &urbom, 2)==0 ){
11831183
fossil_fatal("unicode bom (be) not (yet) implemented");
11841184
}else{
11851185
char *zUtf8 = fossil_mbcs_to_utf8(blob_str(&comment));
11861186
blob_zero(&comment);
1187
- blob_set(&comment, zUtf8);
1187
+ blob_append(&comment, zUtf8, -1);
11881188
fossil_mbcs_free(zUtf8);
11891189
}
11901190
}
11911191
#endif /* _WIN32 */
11921192
db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
11931193
--- src/checkin.c
+++ src/checkin.c
@@ -1162,11 +1162,11 @@
1162 static const unsigned short ubom = 0xfeff;
1163 static const unsigned short urbom = 0xfffe;
1164 if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
1165 struct Blob temp;
1166 char *zUtf8 = blob_str(&comment) + 3;
1167 blob_set(&temp, zUtf8);
1168 fossil_mbcs_free(zUtf8);
1169 blob_swap(&temp, &comment);
1170 blob_reset(&temp);
1171 }else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
1172 && memcmp(blob_buffer(&comment), &ubom, 2)==0 ) {
@@ -1174,19 +1174,19 @@
1174 /* Make sure the blob contains two terminating 0-bytes */
1175 blob_append(&comment, "", 1);
1176 zUtf8 = blob_str(&comment) + 2;
1177 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1178 blob_zero(&comment);
1179 blob_set(&comment, zUtf8);
1180 fossil_mbcs_free(zUtf8);
1181 }else if( blob_size(&comment)>1
1182 && memcmp(blob_buffer(&comment), &urbom, 2)==0 ){
1183 fossil_fatal("unicode bom (be) not (yet) implemented");
1184 }else{
1185 char *zUtf8 = fossil_mbcs_to_utf8(blob_str(&comment));
1186 blob_zero(&comment);
1187 blob_set(&comment, zUtf8);
1188 fossil_mbcs_free(zUtf8);
1189 }
1190 }
1191 #endif /* _WIN32 */
1192 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
1193
--- src/checkin.c
+++ src/checkin.c
@@ -1162,11 +1162,11 @@
1162 static const unsigned short ubom = 0xfeff;
1163 static const unsigned short urbom = 0xfffe;
1164 if( blob_size(&comment)>2 && memcmp(blob_buffer(&comment), bom, 3)==0 ) {
1165 struct Blob temp;
1166 char *zUtf8 = blob_str(&comment) + 3;
1167 blob_append(&temp, zUtf8, -1);
1168 fossil_mbcs_free(zUtf8);
1169 blob_swap(&temp, &comment);
1170 blob_reset(&temp);
1171 }else if( blob_size(&comment)>1 && (blob_size(&comment)&1)==0
1172 && memcmp(blob_buffer(&comment), &ubom, 2)==0 ) {
@@ -1174,19 +1174,19 @@
1174 /* Make sure the blob contains two terminating 0-bytes */
1175 blob_append(&comment, "", 1);
1176 zUtf8 = blob_str(&comment) + 2;
1177 zUtf8 = fossil_unicode_to_utf8(zUtf8);
1178 blob_zero(&comment);
1179 blob_append(&comment, zUtf8, -1);
1180 fossil_mbcs_free(zUtf8);
1181 }else if( blob_size(&comment)>1
1182 && memcmp(blob_buffer(&comment), &urbom, 2)==0 ){
1183 fossil_fatal("unicode bom (be) not (yet) implemented");
1184 }else{
1185 char *zUtf8 = fossil_mbcs_to_utf8(blob_str(&comment));
1186 blob_zero(&comment);
1187 blob_append(&comment, zUtf8, -1);
1188 fossil_mbcs_free(zUtf8);
1189 }
1190 }
1191 #endif /* _WIN32 */
1192 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
1193

Keyboard Shortcuts

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