aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-13 21:39:32 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-13 21:39:32 +0000
commit6f28fb86c99226aea86023b27704b23c4ec3d5a5 (patch)
tree60de514322d56787cb48c0645f15d83b2cf844cd /linux-user/path.c
parentwin32 + Mac OS X compile (diff)
downloadqemu-kvm-6f28fb86c99226aea86023b27704b23c4ec3d5a5.tar.gz
qemu-kvm-6f28fb86c99226aea86023b27704b23c4ec3d5a5.tar.bz2
qemu-kvm-6f28fb86c99226aea86023b27704b23c4ec3d5a5.zip
zero file case (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1064 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/path.c')
-rw-r--r--linux-user/path.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/linux-user/path.c b/linux-user/path.c
index 9e49076dc..76809705a 100644
--- a/linux-user/path.c
+++ b/linux-user/path.c
@@ -101,7 +101,12 @@ void init_paths(const char *prefix)
base = new_entry("", NULL, prefix+1);
base = add_dir_maybe(base);
- set_parents(base, base);
+ if (base->num_entries == 0) {
+ free (base);
+ base = NULL;
+ } else {
+ set_parents(base, base);
+ }
}
/* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */