Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11847

Re: wrong prompt and cd to root

From Eric Blake <eblake@redhat.com>
Newsgroups gnu.bash.bug
Subject Re: wrong prompt and cd to root
Date 2015-11-07 11:16 -0700
Organization Red Hat, Inc.
Message-ID <mailman.1906.1446920224.7904.bug-bash@gnu.org> (permalink)
References <CAKaJLsfZCJR1Ypm=feg+6O1BMqVHOSbmZ46GtthvLveMTWaWYg@mail.gmail.com>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 11/06/2015 07:14 PM, Seyyed Razi Alavizadeh wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
> -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
> -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat
> -Werror=format-security -Wall
> uname output: Linux Razi-MM061 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8
> 14:46:51 UTC 2015 i686 i686 i686 GNU/Linux
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 4.3
> Patch Level: 42
> Release Status: release
> 
> Description:
> wrong prompt and cd to root
> 
> Repeat-By:
> command "cd //" works and show prompt as "//$"

That's the correct behavior.

> Expected that "cd //" doesn't work or at least after CDing to root dir
> Terminal shows prompt as "/$"

POSIX requires that paths of // be preserved literally, because it has
implementation-defined semantics.  If you are using a Linux kernel, //
is implementation-defined as a synonym for /, but on other platforms,
such as Cygwin, // is a distinct location (the root of
//machine/share/path notation) from /.  Bash preserves the spelling of
// on all platforms, rather than trying to figure out whether // is a
synonym for /.  So there is no bug here.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: wrong prompt and cd to root Eric Blake <eblake@redhat.com> - 2015-11-07 11:16 -0700

csiph-web