diff options
author | mp <mp@FreeBSD.org> | 2004-07-11 02:17:56 +0000 |
---|---|---|
committer | mp <mp@FreeBSD.org> | 2004-07-11 02:17:56 +0000 |
commit | bbd1addf8f9452690ad13ce5b875ee4cc9633958 (patch) | |
tree | 730792f0cc19f3bb4fb663fe727589381f5901be /contrib/tcsh/sh.dir.c | |
parent | f2c2aa29b7d05c53575ab7ce4dc5870fd33a1310 (diff) | |
download | FreeBSD-src-bbd1addf8f9452690ad13ce5b875ee4cc9633958.zip FreeBSD-src-bbd1addf8f9452690ad13ce5b875ee4cc9633958.tar.gz |
Import of tcsh-6.13.00
Diffstat (limited to 'contrib/tcsh/sh.dir.c')
-rw-r--r-- | contrib/tcsh/sh.dir.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/contrib/tcsh/sh.dir.c b/contrib/tcsh/sh.dir.c index 4271be2..13bac43 100644 --- a/contrib/tcsh/sh.dir.c +++ b/contrib/tcsh/sh.dir.c @@ -1,4 +1,4 @@ -/* $Header: /src/pub/tcsh/sh.dir.c,v 3.60 2002/07/08 21:03:04 christos Exp $ */ +/* $Header: /src/pub/tcsh/sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $ */ /* * sh.dir.c: Directory manipulation functions */ @@ -32,7 +32,7 @@ */ #include "sh.h" -RCSID("$Id: sh.dir.c,v 3.60 2002/07/08 21:03:04 christos Exp $") +RCSID("$Id: sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $") /* * C Shell - directory management @@ -264,7 +264,7 @@ printdirs(dflag) } if (user) xprintf("~%S", user); - xprintf("%S%c", s, (dflag & DIR_VERT) ? '\n' : ' '); + xprintf("\045S%c", s, (dflag & DIR_VERT) ? '\n' : ' '); } while ((dp = dp->di_prev) != dcwd); if (!(dflag & DIR_VERT)) xputchar('\n'); @@ -276,7 +276,7 @@ dtildepr(dir) { Char* user; if ((user = getusername(&dir)) != NULL) - xprintf("~%S%S", user, dir); + xprintf("~\045S%S", user, dir); else xprintf("%S", dir); } @@ -529,8 +529,13 @@ dgoto(cp) else dp = cp; -#ifdef WINNT_NATIVE +#if defined(WINNT_NATIVE) cp = SAVE(getcwd(NULL, 0)); +#elif defined(__CYGWIN__) + if (ABSOLUTEP(cp) && cp[1] == ':') /* Only DOS paths are treated that way */ + cp = SAVE(getcwd(NULL, 0)); + else + cp = dcanon(cp, dp); #else /* !WINNT_NATIVE */ cp = dcanon(cp, dp); #endif /* WINNT_NATIVE */ @@ -928,7 +933,7 @@ dcanon(cp, p) #ifdef S_IFLNK /* if we have symlinks */ if (sp != cp && /* symlinks != SYM_IGNORE && */ (cc = readlink(short2str(cp), tlink, - sizeof tlink)) >= 0) { + sizeof(tlink) - 1)) >= 0) { tlink[cc] = '\0'; (void) Strncpy(link, str2short(tlink), sizeof(link) / sizeof(Char)); @@ -1019,7 +1024,7 @@ dcanon(cp, p) #ifdef S_IFLNK /* if we have symlinks */ if (sp != cp && symlinks == SYM_CHASE && (cc = readlink(short2str(cp), tlink, - sizeof tlink)) >= 0) { + sizeof(tlink) - 1)) >= 0) { tlink[cc] = '\0'; (void) Strncpy(link, str2short(tlink), sizeof(link) / sizeof(Char)); |