430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
**
** Files whose names begin with "." are omitted unless allFlag is true.
**
** Any files or directories that match the glob pattern pIgnore are
** excluded from the scan. Name matching occurs after the first
** nPrefix characters are elided from the filename.
*/
void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore,
int caseSensitive){
DIR *d;
int origSize;
const char *zDir;
struct dirent *pEntry;
int skipAll = 0;
static Stmt ins;
static int depth = 0;
|
|
<
|
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
**
** Files whose names begin with "." are omitted unless allFlag is true.
**
** Any files or directories that match the glob pattern pIgnore are
** excluded from the scan. Name matching occurs after the first
** nPrefix characters are elided from the filename.
*/
void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
DIR *d;
int origSize;
const char *zDir;
struct dirent *pEntry;
int skipAll = 0;
static Stmt ins;
static int depth = 0;
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
}
if( skipAll ) return;
if( depth==0 ){
db_prepare(&ins,
"INSERT OR IGNORE INTO sfile(x) SELECT :file"
" WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
" pathname=:file %s)", caseSensitive ? "" : "COLLATE nocase"
);
}
depth++;
zDir = blob_str(pPath);
zNative = fossil_utf8_to_filename(zDir);
d = opendir(zNative);
|
|
|
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
}
if( skipAll ) return;
if( depth==0 ){
db_prepare(&ins,
"INSERT OR IGNORE INTO sfile(x) SELECT :file"
" WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
" pathname=:file %s)", filename_collation()
);
}
depth++;
zDir = blob_str(pPath);
zNative = fossil_utf8_to_filename(zDir);
d = opendir(zNative);
|
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
|
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
blob_appendf(pPath, "/%s", zUtf8);
zPath = blob_str(pPath);
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
/* do nothing */
}else if( file_wd_isdir(zPath)==1 ){
if( !vfile_top_of_checkout(zPath) ){
vfile_scan(pPath, nPrefix, scanFlags, pIgnore, caseSensitive);
}
}else if( file_wd_isfile_or_link(zPath) ){
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
db_step(&ins);
db_reset(&ins);
}
|
|
|
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
blob_appendf(pPath, "/%s", zUtf8);
zPath = blob_str(pPath);
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
/* do nothing */
}else if( file_wd_isdir(zPath)==1 ){
if( !vfile_top_of_checkout(zPath) ){
vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
}
}else if( file_wd_isfile_or_link(zPath) ){
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
db_step(&ins);
db_reset(&ins);
}
|