diff options
Diffstat (limited to 'contrib/tcsh/sh.dir.c')
-rw-r--r-- | contrib/tcsh/sh.dir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/tcsh/sh.dir.c b/contrib/tcsh/sh.dir.c index 3fd8d70..9f72951 100644 --- a/contrib/tcsh/sh.dir.c +++ b/contrib/tcsh/sh.dir.c @@ -1,4 +1,4 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.79 2006/09/25 18:17:26 christos Exp $ */ +/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.80 2007/05/08 21:05:34 christos Exp $ */ /* * sh.dir.c: Directory manipulation functions */ @@ -33,7 +33,7 @@ #include "sh.h" #include "ed.h" -RCSID("$tcsh: sh.dir.c,v 3.79 2006/09/25 18:17:26 christos Exp $") +RCSID("$tcsh: sh.dir.c,v 3.80 2007/05/08 21:05:34 christos Exp $") /* * C Shell - directory management @@ -42,7 +42,7 @@ RCSID("$tcsh: sh.dir.c,v 3.79 2006/09/25 18:17:26 christos Exp $") static Char *agetcwd (void); static void dstart (const char *); static struct directory *dfind (Char *); -static Char *dfollow (Char *); +static Char *dfollow (Char *, int); static void printdirs (int); static Char *dgoto (Char *); static void dnewcwd (struct directory *, int); @@ -523,7 +523,7 @@ dochngd(Char **v, struct command *c) return; } else - if ((cp = dfollow(cp)) == NULL) + if ((cp = dfollow(cp, dflag & DIR_OLD)) == NULL) return; dp = xcalloc(sizeof(struct directory), 1); dp->di_name = cp; @@ -588,13 +588,13 @@ dgoto(Char *cp) * dfollow - change to arg directory; fall back on cdpath if not valid */ static Char * -dfollow(Char *cp) +dfollow(Char *cp, int old) { Char *dp; struct varent *c; int serrno; - cp = globone(cp, G_ERROR); + cp = old ? Strsave(cp) : globone(cp, G_ERROR); cleanup_push(cp, xfree); #ifdef apollo if (Strchr(cp, '`')) { @@ -712,7 +712,7 @@ dopushd(Char **v, struct command *c) stderror(ERR_NAME | ERR_NOHOMEDIR); if (chdir(short2str(cp)) < 0) stderror(ERR_NAME | ERR_CANTCHANGE); - if ((cp = dfollow(cp)) == NULL) + if ((cp = dfollow(cp, dflag & DIR_OLD)) == NULL) return; dp = xcalloc(sizeof(struct directory), 1); dp->di_name = cp; @@ -758,7 +758,7 @@ dopushd(Char **v, struct command *c) else { Char *ccp; - if ((ccp = dfollow(cp)) == NULL) + if ((ccp = dfollow(cp, dflag & DIR_OLD)) == NULL) return; dp = xcalloc(sizeof(struct directory), 1); dp->di_name = ccp; |