projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editing and aliases. remove ATTY
[unix-history]
/
usr
/
src
/
bin
/
sh
/
cd.c
diff --git
a/usr/src/bin/sh/cd.c
b/usr/src/bin/sh/cd.c
index
a9bba57
..
63c9884
100644
(file)
--- a/
usr/src/bin/sh/cd.c
+++ b/
usr/src/bin/sh/cd.c
@@
-9,7
+9,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char sccsid[] = "@(#)cd.c 5.
1
(Berkeley) %G%";
+static char sccsid[] = "@(#)cd.c 5.
3
(Berkeley) %G%";
#endif /* not lint */
/*
#endif /* not lint */
/*
@@
-46,11
+46,6
@@
STATIC char *getcomponent();
char *curdir; /* current working directory */
STATIC char *cdcomppath;
char *curdir; /* current working directory */
STATIC char *cdcomppath;
-#if UDIR
-extern int didudir; /* set if /u/logname expanded */
-#endif
-
-
int
cdcmd(argc, argv) char **argv; {
char *dest;
int
cdcmd(argc, argv) char **argv; {
char *dest;
@@
-59,7
+54,8
@@
cdcmd(argc, argv) char **argv; {
struct stat statb;
char *padvance();
struct stat statb;
char *padvance();
- if ((dest = argv[1]) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
+ nextopt(nullstr);
+ if ((dest = *argptr) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
error("HOME not set");
if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL)
path = nullstr;
error("HOME not set");
if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL)
path = nullstr;
@@
-88,10
+84,6
@@
STATIC int
docd(dest, print)
char *dest;
{
docd(dest, print)
char *dest;
{
-#if UDIR
- if (didudir)
- print = 1;
-#endif
INTOFF;
if (chdir(dest) < 0) {
INTON;
INTOFF;
if (chdir(dest) < 0) {
INTON;
@@
-121,10
+113,6
@@
docd(dest, print)
int i;
TRACE(("docd(\"%s\", %d) called\n", dest, print));
int i;
TRACE(("docd(\"%s\", %d) called\n", dest, print));
-#if UDIR
- if (didudir)
- print = 1;
-#endif
top:
cdcomppath = dest;
top:
cdcomppath = dest;