From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] Bug in path.c
Date: Mon, 13 Sep 2004 23:28:17 +0200 [thread overview]
Message-ID: <414610F1.7040402@bellard.org> (raw)
In-Reply-To: <200409111817.43335.paul@codesourcery.com>
applied.
Fabrice.
Paul Brook wrote:
> The path mangling code does the wrong thing when the prefix doesn't exist.
> For example path("/.") still returns "/usr/gnemul/qemu-arm", even if the
> latter doesn't exist (commonly the case when using a chroot).
>
> Patch below fixes this by setting base to NULL if the prefix contains no
> files.
>
> Paul
>
> Index: path.c
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/linux-user/path.c,v
> retrieving revision 1.1
> diff -u -p -r1.1 path.c
> --- path.c 11 Apr 2003 00:15:13 -0000 1.1
> +++ path.c 11 Sep 2004 17:12:14 -0000
> @@ -101,7 +101,11 @@ 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. */
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
>
prev parent reply other threads:[~2004-09-13 21:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-11 17:17 [Qemu-devel] [patch] Bug in path.c Paul Brook
2004-09-13 21:28 ` Fabrice Bellard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=414610F1.7040402@bellard.org \
--to=fabrice@bellard.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).