summaryrefslogtreecommitdiffstats
path: root/bin/sh/cd.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a -P/-o physical option which behaves similarly to bash/ksh's optionstjr2002-07-251-2/+2
| | | | | | | by the same name. This option makes the cd and pwd builtins behave physically (as opposed to logically) by default. Submitted by: fanf
* Set opterr to zero to avoid duplicate warnings from getopt(3) for unknowntjr2002-07-251-2/+2
| | | | options.
* Use PATH_MAX instead of a local guess at it, which happened to be incorrect.tjr2002-07-251-4/+3
| | | | Suggested by: fanf
* pwdcmd()'s argc and argv arguments are no longer unused, remove __unused.tjr2002-07-251-1/+1
| | | | Pointed out by: fanf
* Remove broken and incomplete support for old releases of System V,tjr2002-07-191-55/+0
| | | | don't support system that implement getcwd(3) with a pipe to /bin/pwd.
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* Bring back the cd -L and -P options from revision 1.24, but try harder nottjr2002-05-221-33/+105
| | | | | | to fail when the logical current directory no longer exists. Allow changes to absolute paths when logical cwd is invalid, fall back to physical cd if logical cd fails.
* Temporarily back out revision 1.24; it seems to handle the case where thetjr2002-05-221-78/+22
| | | | current directory no longer exists incorrectly and breaks `make cleandir'.
* Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'tjr2002-05-201-22/+78
| | | | handling of .. is now the default.
* Remove a small, annoying, nit I ran in to editing this file, a lone tabjmallett2002-05-191-1/+1
| | | | on a line by itself.
* o __P has been reovedimp2002-02-021-16/+9
| | | | | | | | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ...
* Don't call setvar() with the VTEXTFIXED flag. A copy is created bytegge2001-11-071-4/+4
| | | | | | | | setvar() and passed to setvareq(). When the VTEXTFIXED flag is set, that copy is never freed, causing a memory leak. PR: 31533 Submitted by: maxim@macomnet.ru
* Include strerror(errno) in error messages after failed system calls.cracauer1999-11-291-1/+1
| | | | Fix a warning.
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Don't blindly eliminate `..' and the previous pathname component.tegge1998-09-061-17/+156
| | | | | PR: 2541 Obtained from: NetBSD
* Add rcsid. Spelling.charnier1998-05-181-3/+5
|
* Use the __unused attribute where warranted.steve1997-05-191-5/+5
|
* Nuke register keyword usage and #if -> #ifdef.steve1997-04-281-2/+2
| | | | Obtained from: NetBSD
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Make sh(1) think and be in the same place at the same time. This closessteve1997-01-041-15/+11
| | | | PR#2331: strange output of sh's pwd on symlinked directories.
* Oops, it needs little more caulk to get it right.steve1996-12-231-2/+2
|
* Apply a little dab of bit caulk to keep those beggarssteve1996-12-231-6/+2
| | | | | | from leaking out. Noticed by: bde
* Don't use _POSIX_PATH_MAX to limit the size of the path, insteadsteve1996-12-231-3/+3
| | | | | | use 'getcwd(NULL, 0)' just as pwd(1) does. Suggested by: bde
* Make sh(1) a little braver in the face of adversity. sh(1)steve1996-12-211-163/+16
| | | | | | | now handles the getpwd() init problem the same way as bash and ksh do. Also while I was in here, I cleaned up the format a little, removed some unnnecessary #if SYMLINKS cruft, and changed the pwd builtin to use getcwd(3) as Joerg suggested.
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-141-16/+20
| | | | Obtained from: NetBSD, me
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-27/+31
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* A fix for the "cd -" coredump on a brand new /bin/sh. The problem waspeter1995-11-141-2/+5
| | | | | | noticed on a NetBSD bugs mailing list but this is entirely my own work. Inspired by: Scott Reynolds <scottr@plexus.com>, for NetBSD
* Obtained from: partly from 1.1.5bde1994-12-261-2/+4
| | | | | Convert "" to "." for "cd" and "cd ''". chdir("") is required to fail on POSIX systems.
* Get this braindead, mongoloid shell look in /stand for pwd if it can'tjkh1994-11-061-3/+8
| | | | | | | | | | find it in /bin. This is something of a kludge, I know, but consider my limited alternatives: I can't make this an execvp() without making people scream that I introduced a failure point or slowed down pwd, and I can't make it an optional macro since crunch doesn't let you pass arbitrary command-line args to the build of one of its crunch-ees. This is the simplest, if not the nicest looking, solution I could come up with.
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+372
OpenPOWER on IntegriCloud