Commit 6f28fb86c99226aea86023b27704b23c4ec3d5a5
1 parent
c94c8d64
zero file case (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1064 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
1 deletions
linux-user/path.c
| ... | ... | @@ -101,7 +101,12 @@ void init_paths(const char *prefix) |
| 101 | 101 | |
| 102 | 102 | base = new_entry("", NULL, prefix+1); |
| 103 | 103 | base = add_dir_maybe(base); |
| 104 | - set_parents(base, base); | |
| 104 | + if (base->num_entries == 0) { | |
| 105 | + free (base); | |
| 106 | + base = NULL; | |
| 107 | + } else { | |
| 108 | + set_parents(base, base); | |
| 109 | + } | |
| 105 | 110 | } |
| 106 | 111 | |
| 107 | 112 | /* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */ | ... | ... |