bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popd with garbage parameter removes entry from dirs but doesn't cd.


From: John McKown
Subject: Re: popd with garbage parameter removes entry from dirs but doesn't cd.
Date: Tue, 7 Mar 2017 10:11:33 -0600

On Tue, Mar 7, 2017 at 8:28 AM, <gazelle@xmission.com> wrote:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-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 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall
uname output: Linux shell 3.13.0-111-generic #158-Ubuntu SMP Wed Feb 22 16:12:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 11
Release Status: release

Description:
        popd with garbage parameter removes entry from dirs but doesn't cd.
        Example: popd lsdfjlskfj

Repeat-By:
        cd /some/directory
        pushd /tmp
        dirs
        popd skdfhksjdfhkjsdf
        pwd;dirs

Fix:
        I assume it should generate an error message for the garbage parameter
        and not change the contents of the directory stack.

​It appears to be fixed on or before release 4.4.​43

[transcript]

[tsh009@it-johnmckown-linux ~]$ pushd /tmp
/tmp ~
[tsh009@it-johnmckown-linux tmp]$ dirs
/tmp ~
[tsh009@it-johnmckown-linux tmp]$ popd bubba;echo $?;dirs
bash: popd: bubba: invalid argument
popd: usage: popd [-n] [+N | -N]
2
/tmp ~
[tsh009@it-johnmckown-linux tmp]$ bash --version
GNU bash, version 4.3.43(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[tsh009@it-johnmckown-linux tmp]$ 


[/transcript]




--
"Irrigation of the land with seawater desalinated by fusion power is ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

reply via email to

[Prev in Thread] Current Thread [Next in Thread]