]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/attr.c
19July06
[bacula/bacula] / bacula / src / lib / attr.c
index 74076b13c22755d694a3a10cb8d08483532a04bf..34a0088d94b595bf685cbe74ee290452c52f5950 100644 (file)
@@ -6,11 +6,11 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2003-2005 Kern Sibbald
+   Copyright (C) 2003-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   version 2 as ammended with additional clauses defined in the
+   version 2 as amended with additional clauses defined in the
    file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
@@ -23,7 +23,6 @@
 #include "bacula.h"
 #include "jcr.h"
 
-extern const int win32_client;
 
 ATTR *new_attr()
 {
@@ -59,13 +58,13 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr)
     *
     */
    attr->stream = stream;
-   Dmsg1(100, "Attr: %s\n", rec);
+   Dmsg1(400, "Attr: %s\n", rec);
    if (sscanf(rec, "%d %d", &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;
    }
-   Dmsg2(100, "Got Attr: FilInx=%d type=%d\n", attr->file_index, attr->type);
+   Dmsg2(400, "Got Attr: FilInx=%d type=%d\n", attr->file_index, attr->type);
    if (attr->type & AR_DATA_STREAM) {
       attr->data_stream = 1;
    } else {
@@ -96,7 +95,7 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr)
       from_base64(&val, p);
       attr->data_stream = (int32_t)val;
    }
-   Dmsg7(200, "unpack_attr FI=%d Type=%d fname=%s attr=%s lname=%s attrEx=%s ds=%d\n",
+   Dmsg7(400, "unpack_attr FI=%d Type=%d fname=%s attr=%s lname=%s attrEx=%s ds=%d\n",
       attr->file_index, attr->type, attr->fname, attr->attr, attr->lname,
       attr->attrEx, attr->data_stream);
    *attr->ofname = 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);