Fix --remove-source-files sanity check w/--copy-links the right way.
[rsync.git] / wildtest.c
index 5327b030e54abff4a6dba5c7033e6d5aba0131b3..07960bb9afb8747cd72b28b396673cb6016f38c4 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Test suite for the wildmatch code.
  *
- * Copyright (C) 2003, 2004, 2006 Wayne Davison
+ * Copyright (C) 2003-2018 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
  */
 
 /*#define COMPARE_WITH_FNMATCH*/
@@ -51,15 +50,16 @@ static struct poptOption long_options[] = {
 
 /* match just at the start of string (anchored tests) */
 static void
-run_test(int line, bool matches, bool same_as_fnmatch,
+run_test(int line, bool matches,
+#ifdef COMPARE_WITH_FNMATCH
+        bool same_as_fnmatch,
+#endif
         const char *text, const char *pattern)
 {
     bool matched;
 #ifdef COMPARE_WITH_FNMATCH
     bool fn_matched;
     int flags = strstr(pattern, "**")? 0 : FNM_PATHNAME;
-#else
-    same_as_fnmatch = 0; /* Get rid of unused-variable compiler warning. */
 #endif
 
     if (explode_mod) {
@@ -195,7 +195,11 @@ main(int argc, char **argv)
            while (*++s == ' ' || *s == '\t') {}
        }
        *end[0] = *end[1] = '\0';
-       run_test(line, flag[0], flag[1], string[0], string[1]);
+       run_test(line, flag[0],
+#ifdef COMPARE_WITH_FNMATCH
+                flag[1],
+#endif
+                string[0], string[1]);
     }
 
     if (!wildmatch_errors)