diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2021-05-08 17:24:30 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2021-05-08 17:25:36 -0400 |
commit | 054508b5edeaef602ee4251bb3828387cb26f582 (patch) | |
tree | e63aab38e53841cbf15295a8060d8bce7dd860cd | |
parent | ed0ba975e39cebb7e15c1fdac560a66a543fce87 (diff) | |
download | cleanpath-054508b5edeaef602ee4251bb3828387cb26f582.tar.gz |
Warn once about regex on windows from cleanpath utility, not library
-rw-r--r-- | lib/cleanpath.c | 2 | ||||
-rw-r--r-- | src/main.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/cleanpath.c b/lib/cleanpath.c index c3a7e81..fde9e6d 100644 --- a/lib/cleanpath.c +++ b/lib/cleanpath.c @@ -80,8 +80,6 @@ void cleanpath_filter(struct CleanPath *path, unsigned mode, const char *pattern } match = regexec(®ex, path->part[i], 0, NULL, 0) == 0 ? 1 : 0; regfree(®ex); -#else - fprintf(stderr, "WARNING: --regex|-r is not implemented on Windows. Using default filter mode.\n"); #endif break; case CLEANPATH_FILTER_EXACT: @@ -145,6 +145,9 @@ int main(int argc, char *argv[]) { } if (ARGM("--regex") || ARGM("-r")) { filter_mode = CLEANPATH_FILTER_REGEX; +#if OS_WINDOWS + fprintf(stderr, "WARNING: --regex|-r is not implemented on Windows. Using default filter mode.\n"); +#endif continue; } if (ARGM("--sep") || ARGM("-s")) { |