linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: richard -rw- weinberger <richard.weinberger@gmail.com>
To: yuyichao-mit <yuyichao@mit.edu>
Cc: "Lars Täuber" <taeuber@bbaw.de>,
	linux-kernel@vger.kernel.org,
	linux-c-programming@vger.kernel.org
Subject: Re: extra slash in current path
Date: Thu, 23 Jun 2011 16:25:06 +0200	[thread overview]
Message-ID: <BANLkTinci016e1U67ubn=bq3=Zsi3q99Aw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin9bQ4hzs-odYU-Gxy-f-T+HLLAdQ@mail.gmail.com>

On Thu, Jun 23, 2011 at 4:11 PM, yuyichao-mit <yuyichao@mit.edu> wrote:
> On Thu, Jun 23, 2011 at 9:54 AM, richard -rw- weinberger
> <richard.weinberger@gmail.com> wrote:
>> On Thu, Jun 23, 2011 at 3:32 PM, yuyichao-mit <yuyichao@mit.edu> wrote:
>>> On Thu, Jun 23, 2011 at 9:31 AM, Lars Täuber <taeuber@bbaw.de> wrote:
>>>> Hi,
>>>>
>>>> Am Thu, 23 Jun 2011 09:14:18 -0400
>>>> yuyichao-mit <yuyichao@mit.edu> schrieb:
>>>>> The problem is like this:
>>>>>
>>>>> $ cd /
>>>>> $ pwd
>>>>> /
>>>>>
>>>>> $ cd /
>>>>> $ pwd
>>>>> //
>>>>
>>>> didn't you mean?:
>>>> $ cd //
>>>> $ pwd
>>>> //
>>>
>>> yes, exactly.
>>>
>>> Sorry for the typo (copy-paste~~~)
>>>
>>
>> Is this really a kernel issue?
>> rw@raccoon:~> cd //
>> rw@raccoon://> pwd
>> //
>> rw@raccoon://> ls -l /proc/self/cwd
>> lrwxrwxrwx 1 rw users 0 23. Jun 15:53 /proc/self/cwd -> /
>
> well, that's true, but this is indeed the retrun value of get_current_dir_name.
>
> #include <unistd.h>
> #include <stdio.h>
>
> int main()
> {
>        char *cwd = get_current_dir_name();
>        printf("%s\n", cwd);
>        return 0;
> }
>
> $ cd //
> $ pwd
> //
> $ main
> //
>
> so is this a glibc stuff??

I guess glibc does some caching.

> (that's y I also send to linux-c-programming.)

Ah, ok.

-- 
Thanks,
//richard

  reply	other threads:[~2011-06-23 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-23 13:14 extra slash in current path yuyichao-mit
2011-06-23 13:17 ` Alessandro Suardi
     [not found]   ` <BANLkTik3iMqZJiEY1+DYS2T9=+q2x2=5pQ@mail.gmail.com>
2011-06-23 13:26     ` yuyichao-mit
     [not found] ` <20110623153116.404f2a63.taeuber@bbaw.de>
     [not found]   ` <BANLkTinOb-4Xm_W2fmzivk6jBJwjeHYKVA@mail.gmail.com>
     [not found]     ` <BANLkTimXH8K91cZ69oPRu=wbYt9JgBadfA@mail.gmail.com>
2011-06-23 14:11       ` yuyichao-mit
2011-06-23 14:25         ` richard -rw- weinberger [this message]
2011-06-23 14:27         ` Nick Bowler
2011-06-23 14:31         ` Michael Tokarev
2011-06-23 14:53           ` yuyichao-mit
     [not found]           ` <20110623165206.d88dcbb3.taeuber@bbaw.de>
     [not found]             ` <BANLkTimdzyT6w2LoKtTjhHTKF5d6zWXFGw@mail.gmail.com>
2011-06-23 15:02               ` 俞颐超

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='BANLkTinci016e1U67ubn=bq3=Zsi3q99Aw@mail.gmail.com' \
    --to=richard.weinberger@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=taeuber@bbaw.de \
    --cc=yuyichao@mit.edu \
    /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).