aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2017-01-18 22:47:42 +0000
committermistachkin <mistachkin@noemail.net>2017-01-18 22:47:42 +0000
commitaac853bae8281e32319c1e5382e2893fa5fb7492 (patch)
treec72d5085e3f69c2670378827fb209b86269ae7f7 /src
parentd3e73d6c1c3161111d494e84859a640d3357c3e7 (diff)
downloadsqlite-aac853bae8281e32319c1e5382e2893fa5fb7492.tar.gz
sqlite-aac853bae8281e32319c1e5382e2893fa5fb7492.zip
In the 'windirent' test module, use a macro for the hidden/system attribute checking.
FossilOrigin-Name: a84a08d0716656dc0b26eafb1841c48d83c67ef2
Diffstat (limited to 'src')
-rw-r--r--src/test_windirent.c11
-rw-r--r--src/test_windirent.h11
2 files changed, 15 insertions, 7 deletions
diff --git a/src/test_windirent.c b/src/test_windirent.c
index 450e4c3cc..ca78d345d 100644
--- a/src/test_windirent.c
+++ b/src/test_windirent.c
@@ -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;
diff --git a/src/test_windirent.h b/src/test_windirent.h
index be454988e..578e2a7c2 100644
--- a/src/test_windirent.h
+++ b/src/test_windirent.h
@@ -93,6 +93,17 @@ struct DIR {
};
/*
+** 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.
*/