Re: extra slash in current path
richard -rw- weinberger <[email protected]> Thu, 23 Jun 2011 16:25:06 +0200
| Newsgroups | org.kernel.vger.linux-c-programming,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jun 23, 2011 at 4:11 PM, yuyichao-mit <[email protected]> wrote: > On Thu, Jun 23, 2011 at 9:54 AM, richard -rw- weinberger > <[email protected]> wrote: >> On Thu, Jun 23, 2011 at 3:32 PM, yuyichao-mit <[email protected]> wrote: >>> On Thu, Jun 23, 2011 at 9:31 AM, Lars Täuber <[email protected]> wrote: >>>> Hi, >>>> >>>> Am Thu, 23 Jun 2011 09:14:18 -0400 >>>> yuyichao-mit <[email protected]> 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