Remove the conditional z/OS indentation in pcre2grep (#981)
The z/OS block in pcre2grep alters the indentation level with an ifdef, which I find ugly.
The fallthrough behaviour looks slightly incorrect too. There is a small behavioural adjustment with this.
I have also changed Windows to an "else if" in the same chain of ifs. I believe this has no effect in practice, since directories and wildcards are mutually exclusive conditions.
diff --git a/src/pcre2grep.c b/src/pcre2grep.c
index 31bd7f7..a77b22d 100644
--- a/src/pcre2grep.c
+++ b/src/pcre2grep.c
@@ -3461,14 +3461,17 @@
/* Handle a z/OS directory using common code. */
-else if (zos_type == __ZOS_HFS)
- {
#endif /* NATIVE_ZOS */
/* Handle directories: common code for all OS */
-if (isdirectory(pathname))
+if (
+#if defined NATIVE_ZOS
+ zos_type == __ZOS_HFS &&
+#endif
+ isdirectory(pathname)
+ )
{
if (dee_action == dee_SKIP ||
!test_incexc(lastcomp, include_dir_patterns, exclude_dir_patterns))
@@ -3546,7 +3549,7 @@
}
#ifdef WIN32
-if (iswild(pathname))
+else if (iswild(pathname))
{
char buffer[1024];
char *nextfile;
@@ -3587,10 +3590,6 @@
}
#endif
-#if defined NATIVE_ZOS
- }
-#endif
-
/* If the file is not a directory, check for a regular file, and if it is not,
skip it if that's been requested. Otherwise, check for an explicit inclusion or
exclusion. */