In the 'windirent' test module, use a macro for the hidden/system attribute checking.

FossilOrigin-Name: a84a08d0716656dc0b26eafb1841c48d83c67ef2
This commit is contained in:
mistachkin 2017-01-18 22:47:42 +00:00
parent d3e73d6c1c
commit aac853bae8
4 changed files with 23 additions and 15 deletions

View File

@ -1,5 +1,5 @@
C Remove\ssuperfluous\soption\sto\sTcl\s'lsort'\sin\sthe\svtabH\stest\sfile.
D 2017-01-18T22:19:01.508
C In\sthe\s'windirent'\stest\smodule,\suse\sa\smacro\sfor\sthe\shidden/system\sattribute\schecking.
D 2017-01-18T22:47:42.937
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
@ -446,8 +446,8 @@ F src/test_tclvar.c df9fe1213c2634687a9ca0b0bec0d2119d359ae3
F src/test_thread.c 911d15fb14e19c0c542bdc8aabf981c2f10a4858
F src/test_vfs.c f0186261a24de2671d080bcd8050732f0cb64f6e
F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
F src/test_windirent.c 5234b0c38bda5cb7dfc031db6a594af2cbcf7fb7
F src/test_windirent.h 7edc57e2faa727026dbd5d010dd0e2e665d5aa01
F src/test_windirent.c 17f91f5f2aa1bb7328abb49414c363b5d2a9d3ff
F src/test_windirent.h 5d67483a55442e31e1bde0f4a230e6e932ad5906
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
F src/tokenize.c 5c2f516876fc27fbd7753913f032f49eb89e83b5
@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P d3c91c1fb345fbcbfc60a897bebf771c795430c9
R 2cfcfd69ff656c8eb0c9b18b58b2f78e
P b92cc6e58ae31cbe6600a522beb5485f7add04b2
R 28b62fae1b56b071f03984b3c0c7d517
U mistachkin
Z e24ce1e7a409b1f16613abdf400a1354
Z 8396ae361cfa963c7c2449732ae79bb0

View File

@ -1 +1 @@
b92cc6e58ae31cbe6600a522beb5485f7add04b2
a84a08d0716656dc0b26eafb1841c48d83c67ef2

View File

@ -73,7 +73,7 @@ LPDIR opendir(
}
/* TODO: Remove this block to allow hidden and/or system files. */
if( data.attrib&_A_HIDDEN || data.attrib&_A_SYSTEM ){
if( is_filtered(data) ){
next:
memset(&data, 0, sizeof(struct _finddata_t));
@ -83,8 +83,7 @@ next:
}
/* TODO: Remove this block to allow hidden and/or system files. */
if( data.attrib&_A_HIDDEN ) goto next;
if( data.attrib&_A_SYSTEM ) goto next;
if( is_filtered(data) ) goto next;
}
dirp->d_first.d_attributes = data.attrib;
@ -117,8 +116,7 @@ next:
if( _findnext(dirp->d_handle, &data)==-1 ) return NULL;
/* TODO: Remove this block to allow hidden and/or system files. */
if( data.attrib&_A_HIDDEN ) goto next;
if( data.attrib&_A_SYSTEM ) goto next;
if( is_filtered(data) ) goto next;
dirp->d_next.d_ino++;
dirp->d_next.d_attributes = data.attrib;
@ -162,8 +160,7 @@ next:
}
/* TODO: Remove this block to allow hidden and/or system files. */
if( data.attrib&_A_HIDDEN ) goto next;
if( data.attrib&_A_SYSTEM ) goto next;
if( is_filtered(data) ) goto next;
entry->d_ino = (ino_t)-1; /* not available */
entry->d_attributes = data.attrib;

View File

@ -92,6 +92,17 @@ struct DIR {
DIRENT d_next; /* DIRENT constructed based on "_findnext". */
};
/*
** Provide a macro, for use by the implementation, to determine if a
** particular directory entry should be skipped over when searching for
** the next directory entry that should be returned by the readdir() or
** readdir_r() functions.
*/
#ifndef is_filtered
# define is_filtered(a) ((((a).attrib)&_A_HIDDEN) || (((a).attrib)&_A_SYSTEM))
#endif
/*
** Provide the function prototype for the POSIX compatiable getenv()
** function. This function is not thread-safe.