281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
+
+
|
* by forcing it to end with newline-NUL. */
blob_read_from_file(&content, zFile);
blob_append(&content, "\n", 2);
zLine = blob_buffer(&content);
/* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
* temporary table. */
db_begin_transaction();
db_multi_exec("CREATE TEMP TABLE IF NOT EXISTS symlink_perm("
"filename TEXT PRIMARY KEY %s)", filename_collation());
while( *zLine ){
/* Find end of line and replace with NUL. */
for( zEnd = zLine; *zEnd!='\r' && *zEnd!='\n'; ++zEnd );
*zEnd = 0;
/* If not a blank line, insert filename into symlink table. */
if( *zLine ){
db_multi_exec("INSERT OR IGNORE INTO symlink_perm VALUES(%Q)", zLine);
}
/* Find start of next line, or find terminating NUL at end of file. */
for( zLine = zEnd+1; *zLine=='\r' || *zLine=='\n'; ++zLine );
}
db_end_transaction(0);
blob_reset(&content);
/* Let the caller know the "symlink_perm" table was created and is valid. */
return 1;
}
#endif
|