Fixed display of the root directory

This commit is contained in:
Yorhel 2009-04-26 13:10:00 +02:00
parent 9cc79b0fab
commit ece21a668d
2 changed files with 10 additions and 3 deletions

View file

@ -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;

View file

@ -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;