]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/tree.c
Remove obsolete .cvsignore files.
[bacula/bacula] / bacula / src / lib / tree.c
index 0d8f24db8c155fa51b6bb543b8058eb73196adea..74f5f6a8e91b760a9ded6759c2be103abdd67580 100755 (executable)
@@ -7,7 +7,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -294,7 +294,7 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type,
    TREE_NODE *node, *found_node;
    node = new_tree_node(root);
    node->fname = fname;
-   found_node = (TREE_NODE *)parent->child.binary_insert(node, node_compare);
+   found_node = (TREE_NODE *)parent->child.insert(node, node_compare);
    if (found_node != node) {          /* already in list */
       free_tree_node(root);           /* free node allocated above */
       found_node->inserted = false;
@@ -352,11 +352,11 @@ int tree_getpath(TREE_NODE *node, char *buf, int buf_size)
  */
 TREE_NODE *tree_cwd(char *path, TREE_ROOT *root, TREE_NODE *node)
 {
-   if (strcmp(path, ".") == 0) {
+   if (path[0] == '.' && path[1] == '\0') {
       return node;
    }
    /* Handle relative path */
-   if (strncmp(path, "..", 2) == 0 && (path[2] == '/' || path[2] == 0)) {
+   if (path[0] == '.' && path[1] == '.' && (IsPathSeparator(path[2]) || path[2] == '\0')) {
       TREE_NODE *parent = node->parent ? node->parent : node;
       if (path[2] == 0) { 
          return parent;