From: "andrey mirtchovski" <mirtchovski@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>
Subject: Re: [9fans] @{cd ...} breaks completion with ctrl-f/ins; help needed
Date: Tue, 28 Oct 2008 11:16:52 -0600 [thread overview]
Message-ID: <14ec7b180810281016n740bc1c3s69f17430c9a0d854@mail.gmail.com> (raw)
In-Reply-To: <a560a5d00810280927x47c33d0dpa65d2debdbc58f02@mail.gmail.com>
the bug is within rio, which keeps track of changed directories but
doesn't know that some of them are changed on a stack for a child
process. the actual code is in xfid.c:^xfidwrite, the Qwdir case. what
is happening is that it catches the 'cd /lib' correctly and sets
w->dir accordingly, however the subsequent 'cd .' is interpreted as a
local unrooted path (doesn't start with '/') and the dot is appended
to the current w->dir. cleanname() subsequently just remove the dot,
leaving the old w->dir to be supplied to 'complete'.
two solutions:
- use getpw() instead of w->dir for unrooted arguments to cd (the
return value of getpw() is correct after the subshell command
completes)
- use 'cd `{pwd}' instead of 'cd .'... this will give a rooted
argument to 'cd' and rio will reset the whole w->dir
andrey
On Tue, Oct 28, 2008 at 10:27 AM, Rudolf Sykora <rudolf.sykora@gmail.com> wrote:
>> cd .
>>
>> is sufficient
>>
>> -rob
>
> As I wrote in my initial mail, 'cd .' does not help.
> Ruda
>
>
next prev parent reply other threads:[~2008-10-28 17:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 9:42 Rudolf Sykora
2008-10-28 10:04 ` Steve Simon
2008-10-28 15:14 ` Rudolf Sykora
2008-10-28 15:30 ` Rob Pike
2008-10-28 16:27 ` Rudolf Sykora
2008-10-28 17:16 ` andrey mirtchovski [this message]
2008-10-28 17:26 ` andrey mirtchovski
2008-10-28 17:21 ` Russ Cox
2008-10-28 21:17 ` Lyndon Nerenberg
2008-10-28 21:41 ` Rudolf Sykora
2008-10-28 22:24 ` Lyndon Nerenberg
2008-10-28 10:54 ` matt
2008-10-28 15:15 ` Rudolf Sykora
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=14ec7b180810281016n740bc1c3s69f17430c9a0d854@mail.gmail.com \
--to=mirtchovski@gmail.com \
--cc=9fans@9fans.net \
/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).