]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/match.c
Add my_postgresql_max_length which caculates the maximum width for all values in...
[bacula/bacula] / bacula / src / findlib / match.c
index b22d2883b3919d905e75243145654d5925da2d67..823e3b5a1065902927877260fd50a0d56fd1b2b3 100644 (file)
@@ -103,48 +103,54 @@ 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 |= OPT_multifs;
-              break;
-            case 'h':                 /* no recursion */
-              inc->options |= OPT_no_recursion;
-              break;
-            case 'M':                 /* MD5 */
-              inc->options |= OPT_compute_MD5;
-              break;
-            case 'n':
-              inc->options |= OPT_never_replace;
-              break;
-            case 'r':                 /* read fifo */
-              inc->options |= OPT_read_fifo;
-              break;
-            case 's':
-              inc->options |= OPT_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 '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 |= OPT_replace_if_newer;
-              break;
-            case 'Z':                 /* gzip compression */
-              inc->options |= OPT_GZIP_compression;
-               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) */
@@ -155,6 +161,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
    }
 
    strcpy(inc->fname, p);                
+   p = inc->fname;
    len = strlen(p);
    /* Zap trailing slashes.  */
    p += len - 1;
@@ -171,6 +178,14 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
         break;
       }
    }
+#ifdef HAVE_CYGWIN
+   /* Convert any \'s into /'s */
+   for (p=inc->fname; *p; p++) {
+      if (*p == '\\') {
+         *p = '/';
+      }
+   }
+#endif
    inc->next = NULL;
    /* Chain this one on the end of the list */
    if (!ff->included_files_list) {
@@ -195,6 +210,14 @@ void add_fname_to_exclude_list(FF_PKT *ff, char *fname)
    int len;
    struct s_excluded_file *exc, **list;
 
+#ifdef HAVE_CYGWIN
+   /* Convert any \'s into /'s */
+   for (char *p=fname; *p; p++) {
+      if (*p == '\\') {
+         *p = '/';
+      }
+   }
+#endif
    Dmsg1(20, "Add name to exclude: %s\n", fname);
 
    if (strchr(fname, '/')) {