]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/attr.c
Ignore UTF-8 marker at the start of .conf files.
[bacula/bacula] / bacula / src / lib / attr.c
index c041f5fd566eb2297b04dbaef45e42c3013fd187..ac509288cd641fd6c447cb882b27e45f3fbb3470 100644 (file)
@@ -23,7 +23,6 @@
 #include "bacula.h"
 #include "jcr.h"
 
-extern int win32_client;
 
 ATTR *new_attr()
 {
@@ -60,7 +59,7 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr)
     */
    attr->stream = stream;
    Dmsg1(400, "Attr: %s\n", rec);
-   if (sscanf(rec, "%d %d", &attr->file_index, &attr->type) != 2) {
+   if (sscanf(rec, "%ld %ld", &attr->file_index, &attr->type) != 2) {
       Jmsg(jcr, M_FATAL, 0, _("Error scanning attributes: %s\n"), rec);
       Dmsg1(100, "\nError scanning attributes. %s\n", rec);
       return 0;
@@ -104,6 +103,7 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr)
    return 1;
 }
 
+#if defined(HAVE_WIN32)
 static void strip_double_slashes(char *fname)
 {
    char *p = fname;
@@ -117,6 +117,7 @@ static void strip_double_slashes(char *fname)
       }
    }
 }
+#endif
 
 /*
  * Build attr->ofname from attr->fname and
@@ -141,9 +142,11 @@ void build_attr_output_fnames(JCR *jcr, ATTR *attr)
       const char *fn;
       int wherelen = strlen(jcr->where);
       pm_strcpy(attr->ofname, jcr->where);  /* copy prefix */
-      if (win32_client && attr->fname[1] == ':') {
+#if defined(HAVE_WIN32)
+      if (attr->fname[1] == ':') {
          attr->fname[1] = '/';     /* convert : to / */
       }
+#endif
       fn = attr->fname;            /* take whole name */
       /* Ensure where is terminated with a slash */
       if (jcr->where[wherelen-1] != '/' && fn[0] != '/') {
@@ -166,9 +169,12 @@ void build_attr_output_fnames(JCR *jcr, ATTR *attr)
             attr->olname[0] = 0;
             add_link = false;
          }
-         if (win32_client && attr->lname[1] == ':') {
+
+#if defined(HAVE_WIN32)
+         if (attr->lname[1] == ':') {
             attr->lname[1] = '/';    /* turn : into / */
          }
+#endif
          fn = attr->lname;       /* take whole name */
          /* Ensure where is terminated with a slash */
          if (add_link && jcr->where[wherelen-1] != '/' && fn[0] != '/') {
@@ -177,10 +183,10 @@ void build_attr_output_fnames(JCR *jcr, ATTR *attr)
          pm_strcat(attr->olname, fn);     /* copy rest of link */
       }
    }
-   if (win32_client) {
+#if defined(HAVE_WIN32)
       strip_double_slashes(attr->ofname);
       strip_double_slashes(attr->olname);
-   }
+#endif
 }
 
 extern char *getuser(uid_t uid, char *name, int len);