diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-04 13:17:32 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-04 13:17:32 +0100 |
commit | 6941420efeefc48100a545806271af2de92dda26 (patch) | |
tree | 667f546863a872e635fe90b01e4fbb6187eeca38 /src | |
parent | 8358ea9524509c02448fe52d5bea205c9c3f869e (diff) | |
download | libguestfs-6941420efeefc48100a545806271af2de92dda26.tar.gz libguestfs-6941420efeefc48100a545806271af2de92dda26.tar.xz libguestfs-6941420efeefc48100a545806271af2de92dda26.zip |
Fix parsing of paths with more than one element.
Diffstat (limited to 'src')
-rw-r--r-- | src/guestfs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/guestfs.c b/src/guestfs.c index 84da8d69..aa0aadbf 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -508,7 +508,7 @@ int guestfs_launch (guestfs_h *g) { static const char *dir_template = "/tmp/libguestfsXXXXXX"; - int r, i, len; + int r, i, len, pmore; int wfd[2], rfd[2]; int tries; const char *kernel_name = "vmlinuz." REPO "." host_cpu; @@ -533,6 +533,7 @@ guestfs_launch (guestfs_h *g) pelem = path = safe_strdup (g, g->path); do { pend = strchrnul (pelem, ':'); + pmore = *pend == ':'; *pend = '\0'; len = pend - pelem; @@ -564,8 +565,8 @@ guestfs_launch (guestfs_h *g) kernel = initrd = NULL; } - pelem = pend; - } while (*pelem++ != '\0'); + pelem = pend + 1; + } while (pmore); free (path); |