Fossil SCM

Remove unnecessary double NUL-termination from blob

andygoth 2017-10-14 22:49 UTC andygoth-enhanced-symlink
Commit 95b6fad941774d1d20e0bc6733800227caf42e6f18cba61f2fd959d2289b237b
1 file changed +2 -2
+2 -2
--- src/checkout.c
+++ src/checkout.c
@@ -276,13 +276,13 @@
276276
if( file_wd_size(zFile)<0 ){
277277
return 0;
278278
}
279279
280280
/* Read "manifest.symlinks" into a blob to be analyzed. Simplify processing
281
- * by forcing it to end with newline-NUL. */
281
+ * by forcing it to end with newline. (Blobs are always NUL-terminated.) */
282282
blob_read_from_file(&content, zFile);
283
- blob_append(&content, "\n", 2);
283
+ blob_append(&content, "\n", 1);
284284
zLine = blob_buffer(&content);
285285
286286
/* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287287
* temporary table. */
288288
db_begin_transaction();
289289
--- src/checkout.c
+++ src/checkout.c
@@ -276,13 +276,13 @@
276 if( file_wd_size(zFile)<0 ){
277 return 0;
278 }
279
280 /* Read "manifest.symlinks" into a blob to be analyzed. Simplify processing
281 * by forcing it to end with newline-NUL. */
282 blob_read_from_file(&content, zFile);
283 blob_append(&content, "\n", 2);
284 zLine = blob_buffer(&content);
285
286 /* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287 * temporary table. */
288 db_begin_transaction();
289
--- src/checkout.c
+++ src/checkout.c
@@ -276,13 +276,13 @@
276 if( file_wd_size(zFile)<0 ){
277 return 0;
278 }
279
280 /* Read "manifest.symlinks" into a blob to be analyzed. Simplify processing
281 * by forcing it to end with newline. (Blobs are always NUL-terminated.) */
282 blob_read_from_file(&content, zFile);
283 blob_append(&content, "\n", 1);
284 zLine = blob_buffer(&content);
285
286 /* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287 * temporary table. */
288 db_begin_transaction();
289

Keyboard Shortcuts

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