]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/match.c
Update doc
[bacula/bacula] / bacula / src / findlib / match.c
index 4a66dab5c2acf17702fd90e93a89617290636b50..95a574572f846610c02b7e8a425dcd6c4f7cccb0 100644 (file)
 #undef bmalloc
 #define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
 
-#ifdef HAVE_CYGWIN
-static int win32_client = 1;
-#else
-static int win32_client = 0;
-#endif
-
+extern const int win32_client;
        
 /*
  * Initialize structures for filename matching
@@ -103,54 +98,60 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
    if (prefixed) {
       for (p=fname; *p && *p != ' '; p++) {
         switch (*p) {
-            case 'a':                 /* alway replace */
-            case '0':                 /* no option */
-              break;
-            case 'f':
-              inc->options |= FO_MULTIFS;
-              break;
-            case 'h':                 /* no recursion */
-              inc->options |= FO_NO_RECURSION;
-              break;
-            case 'M':                 /* MD5 */
-              inc->options |= FO_MD5;
-              break;
-            case 'n':
-              inc->options |= FO_NOREPLACE;
-              break;
-            case 'p':                 /* use portable data format */
-              inc->options |= FO_PORTABLE;
-              break;
-            case 'r':                 /* read fifo */
-              inc->options |= FO_READFIFO;
-              break;
-            case 'S':
-              inc->options |= FO_SHA1;
-              break;
-            case 's':
-              inc->options |= FO_SPARSE;
-              break;
-            case 'V':                  /* verify options */
-              /* Copy Verify Options */
-               for (j=0; *p && *p != ':'; p++) {
-                 inc->VerifyOpts[j] = *p;
-                 if (j < (int)sizeof(inc->VerifyOpts) - 1) {
-                    j++;
-                 }
+         case 'a':                 /* alway replace */
+         case '0':                 /* no option */
+           break;
+         case 'f':
+           inc->options |= FO_MULTIFS;
+           break;
+         case 'h':                 /* no recursion */
+           inc->options |= FO_NO_RECURSION;
+           break;
+         case 'M':                 /* MD5 */
+           inc->options |= FO_MD5;
+           break;
+         case 'n':
+           inc->options |= FO_NOREPLACE;
+           break;
+         case 'p':                 /* use portable data format */
+           inc->options |= FO_PORTABLE;
+           break;
+         case 'r':                 /* read fifo */
+           inc->options |= FO_READFIFO;
+           break;
+         case 'S':
+           inc->options |= FO_SHA1;
+           break;
+         case 's':
+           inc->options |= FO_SPARSE;
+           break;
+         case 'm':
+           inc->options |= FO_MTIMEONLY;
+           break;
+         case 'k':
+           inc->options |= FO_KEEPATIME;
+           break;
+         case 'V':                  /* verify options */
+           /* Copy Verify Options */
+            for (j=0; *p && *p != ':'; p++) {
+              inc->VerifyOpts[j] = *p;
+              if (j < (int)sizeof(inc->VerifyOpts) - 1) {
+                 j++;
               }
-              inc->VerifyOpts[j] = 0;
-              break;
-            case 'w':
-              inc->options |= FO_IF_NEWER;
-              break;
-            case 'Z':                 /* gzip compression */
-              inc->options |= FO_GZIP;
-               inc->level = *++p - '0';
-               Dmsg1(200, "Compression level=%d\n", inc->level);
-              break;
-           default:
-               Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *p);
-              break;
+           }
+           inc->VerifyOpts[j] = 0;
+           break;
+         case 'w':
+           inc->options |= FO_IF_NEWER;
+           break;
+         case 'Z':                 /* gzip compression */
+           inc->options |= FO_GZIP;
+            inc->level = *++p - '0';
+            Dmsg1(200, "Compression level=%d\n", inc->level);
+           break;
+        default:
+            Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *p);
+           break;
         }
       }
       /* Skip past space(s) */
@@ -178,7 +179,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
         break;
       }
    }
-#ifdef HAVE_CYGWIN
+#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
    /* Convert any \'s into /'s */
    for (p=inc->fname; *p; p++) {
       if (*p == '\\') {
@@ -210,7 +211,7 @@ void add_fname_to_exclude_list(FF_PKT *ff, char *fname)
    int len;
    struct s_excluded_file *exc, **list;
 
-#ifdef HAVE_CYGWIN
+#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
    /* Convert any \'s into /'s */
    for (char *p=fname; *p; p++) {
       if (*p == '\\') {