summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-04-26 13:10:00 +0200
committerYorhel <git@yorhel.nl>2009-04-26 13:10:00 +0200
commitece21a668d43dac69c25315a22f1f7d0147f7198 (patch)
tree004934bc1fbefe7764451733ea44e6eabff55761
parent9cc79b0fab0b4301801387abb57fc52b03f88228 (diff)
Fixed display of the root directory
-rw-r--r--src/calc.c10
-rw-r--r--src/util.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/src/calc.c b/src/calc.c
index e54eb01..79bd4ec 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -344,9 +344,13 @@ void calc_process() {
strcpy(t->name, orig->name);
} else {
t->name = malloc(strlen(path)+strlen(name)+1);
- strcpy(t->name, path);
- strcat(t->name, "/");
- strcat(t->name, name);
+ if(strcmp(path, "/"))
+ strcpy(t->name, path);
+ if(strcmp(name, ".")) {
+ strcat(t->name, "/");
+ strcat(t->name, name);
+ } else
+ t->name[0] = 0;
}
root = t;
curdev = fs.st_dev;
diff --git a/src/util.c b/src/util.c
index 76f43d7..a19fea0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -214,6 +214,9 @@ char *getpath(struct dir *cur) {
struct dir *d, **list;
int c, i;
+ if(!cur->name[0])
+ return "/";
+
c = i = 1;
for(d=cur; d!=NULL; d=d->parent) {
i += strlen(d->name)+1;