diff options
author | Stefan Siegl <stesie@brokenpipe.de> | 2005-03-19 18:30:08 +0000 |
---|---|---|
committer | Stefan Siegl <stesie@brokenpipe.de> | 2005-03-19 18:30:08 +0000 |
commit | 6e557dfead959c87dd783b3d026d7dadf405ecbe (patch) | |
tree | e4d039884750530519c39a10745e15a5efddfe1c /cvs_tree.c | |
parent | 11f9deac59255f6188adcbaa19fcfd6131eadf39 (diff) |
* added debug prologue/epilogue cvs_tree_enqueue
* cvs_tree_enqueue: allow multiple cvs root directories, i.e. allow
browsing a whole repository by specifying '.' as module name argument
Diffstat (limited to 'cvs_tree.c')
-rw-r--r-- | cvs_tree.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cvs_tree.c b/cvs_tree.c index 1361de552..b99c25c5e 100644 --- a/cvs_tree.c +++ b/cvs_tree.c @@ -196,13 +196,20 @@ cvs_tree_enqueue(struct netnode *dir, const char *path) struct netnode *new, *parent = NULL; char *end; + DEBUG("tree-enqueue", "root=%s, path=%s\n", dir ? dir->name : NULL, path); + if(! (end = strchr(path, '/'))) { /* request for root directory, else there would be a '/' within * path. return existing rootdir (dir), if available. */ - if(dir) - return dir; + if(dir) { + if(! strcmp(dir->name, path)) + return dir; + + parent = dir; + dir = (parent = dir)->child; + } } else do { @@ -236,6 +243,9 @@ cvs_tree_enqueue(struct netnode *dir, const char *path) return new; /* okay, create new directory structure right in place ... */ + DEBUG("tree-enqueue", "adding new node: parent=%s, path=%s\n", + parent ? parent->name : NULL, path); + new = malloc(sizeof(*new)); if(! new) { |