summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/sh.dir.c
diff options
context:
space:
mode:
authormp <mp@FreeBSD.org>2009-07-11 05:35:08 +0000
committermp <mp@FreeBSD.org>2009-07-11 05:35:08 +0000
commite5921a6fae9164c5f8ad6bb718db42f3f7a9e455 (patch)
treeb22c970391cc429da340ec007eb76294ea034b89 /contrib/tcsh/sh.dir.c
parent9b2f8ecbb332eb8e16c52d1731de9082d102e68b (diff)
parent50eaa69b9f8628c1a960d67f9226b2178e1af1cb (diff)
downloadFreeBSD-src-e5921a6fae9164c5f8ad6bb718db42f3f7a9e455.zip
FreeBSD-src-e5921a6fae9164c5f8ad6bb718db42f3f7a9e455.tar.gz
Update to tcsh 6.17.00.
Approved by: re (kensmith)
Diffstat (limited to 'contrib/tcsh/sh.dir.c')
-rw-r--r--contrib/tcsh/sh.dir.c16
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;
OpenPOWER on IntegriCloud