| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If getcwd() failed earlier on but later succeeded in the pwd builtin,
there was no INTOFF protection between calling savestr() and storing its
result.
It is quite rare for getcwd() to fail, and rarer for it to succeed later in
the same directory.
Found via code inspection for changing ckmalloc() and similar to assert
INTOFF protection instead of applying it directly (which protects against
corrupting malloc's internal state but allows memory leaks or double frees).
MFC after: 1 week
Notes:
svn path=/head/; revision=356251
|
| |
|
|
| |
Notes:
svn path=/head/; revision=336320
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If CDPATH is used non-trivially or the operand is "-", cd writes the
directory actually switched to. (We currently do this only in interactive
shells, but POSIX requires this in non-interactive shells as well.)
As mentioned in Austin group bug #1045, cd shall not return an error while
leaving the current directory changed. Therefore, ignore any write error.
Notes:
svn path=/head/; revision=320340
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96
Notes:
svn path=/head/; revision=314436
|
| |
|
|
| |
Notes:
svn path=/head/; revision=294667
|
| |
|
|
|
|
|
|
|
|
|
| |
Per POSIX, 'cd -' should use the OLDPWD shell variable, not internal state.
This variable is normally exported.
Also, if OLDPWD is not set, fail 'cd -' instead of changing to the current
directory.
Notes:
svn path=/head/; revision=294649
|
| |
|
|
| |
Notes:
svn path=/head/; revision=278820
|
| |
|
|
| |
Notes:
svn path=/head/; revision=278818
|
| |
|
|
| |
Notes:
svn path=/head/; revision=258776
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reduces code duplication and code size.
/usr/bin/printf is not affected.
Side effect: different error messages when certain builtins are passed
invalid options.
Notes:
svn path=/head/; revision=240541
|
| |
|
|
|
|
|
|
|
|
|
| |
The errno message display added in r222292 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.
PR: bin/164070
MFC after: 10 days
Notes:
svn path=/head/; revision=230095
|
| |
|
|
|
|
|
|
|
| |
Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.
Notes:
svn path=/head/; revision=223060
|
| |
|
|
|
|
|
|
|
|
| |
CDPATH should be ignored not only for pathnames starting with '/' but also
for pathnames whose first component is '.' or '..'.
The man page already describes this behaviour.
Notes:
svn path=/head/; revision=222381
|
| |
|
|
| |
Notes:
svn path=/head/; revision=222292
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reflects failure to determine the pathname of the new directory in the
exit status (1). Normally, cd returns successfully if it did chdir() and the
call was successful.
In POSIX, -e only has meaning with -P; because our -L is not entirely
compliant and may fall back to -P mode, -e has some effect with -L as well.
Notes:
svn path=/head/; revision=222154
|
| |
|
|
|
|
|
|
|
| |
This is like error() but without raising an exception.
It is particularly useful as a replacement for the warnx macro in
bltin/bltin.h.
Notes:
svn path=/head/; revision=216622
|
| |
|
|
|
|
|
|
|
|
|
| |
* Prefer one CHECKSTRSPACE with multiple USTPUTC to multiple STPUTC.
* Add STPUTS macro (based on function) and use it instead of loops that add
nul-terminated strings to the stack string.
No functional change is intended, but code size is about 1K less on i386.
Notes:
svn path=/head/; revision=215783
|
| |
|
|
|
|
|
|
|
| |
If getcwd fails, do not treat this as an error, but print a warning and
unset PWD. This is similar to the behaviour when starting the shell in a
directory whose name cannot be determined.
Notes:
svn path=/head/; revision=215727
|
| |
|
|
|
|
|
| |
and its usage.
Notes:
svn path=/head/; revision=213811
|
| |
|
|
|
|
|
|
|
| |
breakpoints with in a debugger. And use naked "static" for variables.
Noticed by: bde
Notes:
svn path=/head/; revision=213760
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unset PWD if it is incorrect and no value for it can be determined.
This preserves the logical current directory across shell invocations.
Example (assuming /home is a symlink):
$ cd
$ pwd
/home/foo
$ sh
$ pwd
/home/foo
Formerly the second pwd would show the physical path (symlinks resolved).
Notes:
svn path=/head/; revision=206759
|
| |
|
|
|
|
|
|
|
|
| |
- const
- initializations to silence -Wuninitialized (it was safe anyway)
- remove nested extern declarations
- rename "index" locals to "idx"
Notes:
svn path=/head/; revision=201053
|
| |
|
|
|
|
|
|
| |
Most of this is adding const keywords, but setvar() in var.c had to be
changed somewhat more.
Notes:
svn path=/head/; revision=200956
|
| |
|
|
|
|
|
|
|
|
| |
continues to be limited by PATH_MAX (1024).
Obtained from: NetBSD
PR: 104456
Notes:
svn path=/head/; revision=199631
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
computes the new path and the second one, updatepwd(), updates the variables
PWD, OLDPWD and the path used for the pwd builtin according to the new
directory. For a logical directory change, chdir() is now called between
those two functions, no longer causing wrong values to be stored in PWD etc. if
it fails.
PR: 64990, 101316, 120571
Notes:
svn path=/head/; revision=176521
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
.//dir as /dir. Rather strip it only for the purpose of checking if the
directory path should be printed.
PR: 88813
Submitted by: Josh Elsasser
Patch from: NetBSD (cd.c rev 1.38)
MFC after: 2 weeks
Notes:
svn path=/head/; revision=159551
|
| |
|
|
|
|
|
| |
OK'ed by: imp, core
Notes:
svn path=/head/; revision=127958
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Removed dead declarations
- Made objects that should have been declared as static, static.
The changes use STATIC instead of static, following the existing
convention in the rest of the code.
Approved by: schweikh (mentor)
MFC after: 2 weeks
Notes:
svn path=/head/; revision=117261
|
| |
|
|
|
|
|
|
|
|
| |
by the same name. This option makes the cd and pwd builtins behave physically
(as opposed to logically) by default.
Submitted by: fanf
Notes:
svn path=/head/; revision=100664
|
| |
|
|
|
|
|
| |
options.
Notes:
svn path=/head/; revision=100663
|
| |
|
|
|
|
|
| |
Suggested by: fanf
Notes:
svn path=/head/; revision=100661
|
| |
|
|
|
|
|
| |
Pointed out by: fanf
Notes:
svn path=/head/; revision=100660
|
| |
|
|
|
|
|
| |
don't support system that implement getcwd(3) with a pipe to /bin/pwd.
Notes:
svn path=/head/; revision=100351
|
| |
|
|
| |
Notes:
svn path=/head/; revision=99110
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=97092
|
| |
|
|
|
|
|
| |
current directory no longer exists incorrectly and breaks `make cleandir'.
Notes:
svn path=/head/; revision=97091
|
| |
|
|
|
|
|
| |
handling of .. is now the default.
Notes:
svn path=/head/; revision=96980
|
| |
|
|
|
|
|
| |
on a line by itself.
Notes:
svn path=/head/; revision=96948
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
{
...
Notes:
svn path=/head/; revision=90111
|
| |
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=86176
|
| |
|
|
|
|
|
| |
Fix a warning.
Notes:
svn path=/head/; revision=53891
|
| |
|
|
| |
Notes:
svn path=/head/; revision=50471
|
| |
|
|
|
|
|
|
| |
PR: 2541
Obtained from: NetBSD
Notes:
svn path=/head/; revision=38886
|
| |
|
|
| |
Notes:
svn path=/head/; revision=36150
|
| |
|
|
| |
Notes:
svn path=/head/; revision=25905
|
| |
|
|
|
|
|
| |
Obtained from: NetBSD
Notes:
svn path=/head/; revision=25222
|
| |
|
|
| |
Notes:
svn path=/head/; revision=22988
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=21673
|
| |
|
|
|
|
|
| |
PR#2331: strange output of sh's pwd on symlinked directories.
Notes:
svn path=/head/; revision=21301
|
| |
|
|
| |
Notes:
svn path=/head/; revision=20887
|