Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759499Ab1FWOZJ (ORCPT ); Thu, 23 Jun 2011 10:25:09 -0400 Received: from mail-vx0-f174.google.com ([209.85.220.174]:56494 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755367Ab1FWOZH convert rfc822-to-8bit (ORCPT ); Thu, 23 Jun 2011 10:25:07 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sImfPCOR7XZFXibtBG/SRTrA9IQE8av2vFrjEP2oatia3Ei+Y7OX9eprxvpNfsROlN QQ70EjLVtirvuaiDT8pGD3ynkj6wLuvUhwFWTQ24UxXrKo9AIT24yb80LSLC0WDRM2tf Ybp3+i3EaVAKojYr65qbQPLp6/gXJdlaxGMLc= MIME-Version: 1.0 In-Reply-To: References: <20110623153116.404f2a63.taeuber@bbaw.de> Date: Thu, 23 Jun 2011 16:25:06 +0200 Message-ID: Subject: Re: extra slash in current path From: richard -rw- weinberger To: yuyichao-mit Cc: =?ISO-8859-1?Q?Lars_T=E4uber?= , linux-kernel@vger.kernel.org, linux-c-programming@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1525 Lines: 70 On Thu, Jun 23, 2011 at 4:11 PM, yuyichao-mit wrote: > On Thu, Jun 23, 2011 at 9:54 AM, richard -rw- weinberger > wrote: >> On Thu, Jun 23, 2011 at 3:32 PM, yuyichao-mit wrote: >>> On Thu, Jun 23, 2011 at 9:31 AM, Lars T?uber wrote: >>>> Hi, >>>> >>>> Am Thu, 23 Jun 2011 09:14:18 -0400 >>>> yuyichao-mit 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 > #include > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/