🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Andy Fyfe Fri, 16 Jun 1989 12:51
cd in bash 0.99
#125
Author: Andy Fyfe
Date: Fri, 16 Jun 1989 12:51
10 lines
696 bytes
It's permitted to put multiple /'s between components in a path name
(and something I tend to do since file completion adds then to the end
of directories and I'm not yet used to that).  Cd, with "..", however,
get's confused by this.
	$ cd /usr/local//src
	$ pwd
	/usr/local/src
	$ cd ../..
	$ pwd
	/usr/local
Re: cd in bash 0.99
#130
Author: Chet Ramey
Date: Fri, 16 Jun 1989 20:02
57 lines
1970 bytes
In article <8906161251.AA04266@csvax.caltech.edu> andy@CSVAX.CALTECH.EDU (Andy Fyfe) writes:
>It's permitted to put multiple /'s between components in a path name
>Cd, with "..", however, get's confused by this.
>	$ cd /usr/local//src
>	$ pwd
>	/usr/local/src
>	$ cd ../..
>	$ pwd
>	/usr/local

Here's a quick look at what happens after I fix it; a one-line diff for
general.c follows (note that I have aliased pwd to "echo $PWD"; this
makes no difference).

cwns5$ echo $SHLVL
2
cwns5$ cd /usr/homes/chet/src/Shells/bash////Rt-AOS/
cwns5$ pwd
/usr/homes/chet/src/Shells/bash////Rt-AOS
cwns5$ cd ../..
cwns5$ pwd
/usr/homes/chet/src/Shells/bash//
cwns5$ cd Rt-AOS/
cwns5$ ./bash
cwns5$ echo $SHLVL
3
cwns5$ cd /usr/homes/chet/src/Shells/bash////Rt-AOS/
cwns5$ pwd
/usr/homes/chet/src/Shells/bash////Rt-AOS
cwns5$ cd ../..
cwns5$ pwd
/usr/homes/chet/src/Shells
cwns5$ 

Here's the fix (your line numbers may vary; I've made other changes):

*** bash-0.99/general.c	Wed May 24 21:16:07 1989
--- src-0.99/general.c	Fri Jun 16 15:22:59 1989
***************
*** 293,297
    while (n--)
      {
!       if (*p == '/')
  	p--;
  

--- 293,297 -----
    while (n--)
      {
!       while (*p == '/')	/* skip multiple occurrences of '/' */
  	p--;
  

Chet Ramey     Network Services Group, CWRU    chet@cwjcc.INS.CWRU.Edu

"The flagon with the dragon has the potion with the poison;
	the vessel with the pestle holds the brew that is true!"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads