summaryrefslogtreecommitdiffstats
path: root/bin/sh
Commit message (Collapse)AuthorAgeFilesLines
* Delete worthless comments.tjr2002-10-301-5/+1
|
* Avoid accidentally making "-h" a synonym for "fc".tjr2002-10-181-1/+1
| | | | Obtained from: NetBSD
* Do not strip CTL* escapes from redirection filenames in argstr(); theytjr2002-10-081-1/+1
| | | | | | | | are later stripped with rmescapes() in expandarg(). If the filename has already been unescaped, doing it again in rmescapes() can walk off the end of the string, leading to memory corruption and eventually SIGSEGV. Noticed by: kris
* Disallow empty condition parts of "if", "while" and "until" compoundtjr2002-10-061-3/+6
| | | | | | commands. Commands like "if then ... fi" and "while do ... done" are no longer accepted. Bodies of compound commands are still allowed to be empty, because even though POSIX does not allow them, most shells do.
* Use %d in a printf() format string and cast the argument to int instead oftjr2002-10-021-1/+1
| | | | | using %td when we know that the number is between 0 and 9; mksyntax is a build tool and needs to work on -stable.
* Back out experimental changes to fmtstr() that I didn't mean to includetjr2002-10-011-1/+9
| | | | in the previous commit.
* Replace a home-grown printf() clone with a fwopen() wrapper aroundtjr2002-10-011-190/+23
| | | | | libc's vfprintf() that writes to a `struct output' instead of a file. Inspired by NetBSD's similar changes (they used asprintf() instead).
* It is now safe to remove WARNS=0 and WFORMAT=0.mux2002-10-011-2/+0
| | | | Tested on: alpha, i386, sparc64
* Restore "not found" error message when searching for (or executing)tjr2002-10-011-2/+8
| | | | | | a program fails because the file or a path component does not exist. Suggested by: bde
* - Don't use quad_t when we really mean rlim_t.mux2002-10-011-5/+6
| | | | | | | | - Cast rlim_t to intmax_t when printing it. This should fix the last format errors in sh(1). Tested on: i386, sparc64
* Add back WARNS=0 and WFORMAT=0; gcc is finding nonexistent format stringtjr2002-10-011-0/+2
| | | | errors with %qd formats.
* Use the %t format modifier to print differences betweenmux2002-10-012-2/+2
| | | | | | | | | | | pointers. This fixes two format warnings on 64 bits archs which are fatal now that WFORMAT=0 has been removed. It doesn't fully fix the sh(1) build on 64 bits platforms though, there is still some quad_t issues that need to be fixed. Tested on: i386, sparc64
* Remove WARNS=0 and WFORMAT=0. The shell compiles cleanly at WARNS=2tjr2002-10-011-2/+0
| | | | | on at least i386. If there are warnings on other archs, I'd rather hear about them than pretend they didn't exist.
* Remove some kind of profiling support that required the 4.2BSD monitor()tjr2002-10-011-12/+0
| | | | function in libc.
* Remove bits and pieces of support for atty, which was made obsolete bytjr2002-10-014-41/+1
| | | | | | adding history and vi/emacs-style line editing to the shell itself. Atty was a user-mode terminal emulator (like screen and window) that did line editing and history.
* Callers of error() don't need to supply a program name prefix in thetjr2002-09-301-6/+6
| | | | error message. Stops ulimit giving error messages like "ulimit: ulimit: xyz".
* Allow a left parenthesis before patterns in case blocks. POSIX requirestjr2002-09-301-0/+2
| | | | us to accept this, but I've never seen a script that uses it.
* Allow empty case/esac statements; POSIX requires this, and recent versionstjr2002-09-301-2/+2
| | | | | | | of autoconf are generating scripts that use this feature. PR: 43275 35879 Submitted by: Dan Nelson <dnelson@allantgroup.com>
* Remove dead code which supported systems without O_APPEND, O_CREAT or SIGTSTP.tjr2002-09-292-34/+0
|
* Convert the remaining callers of errmsg() to use strerror(), and removetjr2002-09-294-111/+13
| | | | errmsg() and its table of error messages.
* Correct a usage of fnctl that could not be right and results in anectar2002-09-111-1/+1
| | | | no-op. I assume it was meant that the close-on-exec flag be set here.
* Add <stdlib.h> to get a prototype for exit().keramida2002-08-291-0/+1
| | | | Reviewed by: tjr
* Replace various spellings with FALLTHROUGH which is lint()ablecharnier2002-08-252-2/+2
|
* There is a built-in command called "builtin"; spell its name correctlytjr2002-08-241-1/+1
| | | | after rev. 1.77 called it "built-in".
* Don't show the process ID of background jobs that have terminated,tjr2002-08-241-1/+1
| | | | for consistency with ksh.
* s/filesystem/file system/ as discussed on -developerstrhodes2002-08-212-3/+3
|
* Fix a few typos, among them s/builtin/built-in/ (except for the refschweikh2002-08-211-36/+36
| | | | | | | to the builtin(1) man page.) This is for consistency with the spelling both proposed by ispell as well as IEEE Std 1003.1-2001. MFC after: 3 days
* Avoid accessing the current job's process table in the child part oftjr2002-08-181-3/+5
| | | | | | forkshell() after it has been freed. This caused mysterious behaviour when anything but the first command in a pipeline tried to access the terminal when the `junk' malloc() option was enabled (which is the default).
* Show job control ID, command text, etc. when foreground processes aretjr2002-08-171-7/+2
| | | | | | suspended. This is a followup to rev. 1.51. MFC after: 1 week
* Allow redirections by themselves between "&&" and "||" operators.tjr2002-08-111-3/+2
| | | | | | | For example, >/dev/null && echo foo Pointed out by: FUJISHIMA Satsuki MFC after: 1 week
* mdoc(7) police: tidying.ru2002-08-091-36/+9
|
* Add a -P/-o physical option which behaves similarly to bash/ksh's optionstjr2002-07-253-4/+17
| | | | | | | 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-255-2/+6
| | | | 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
* Avoid calling el_resize() from a signal handler, even though libedittjr2002-07-243-2/+11
| | | | | | | itself does that if you set EL_SIGNAL. Instead, set a flag and check it before calling el_gets(). This is safer, but slower to respond to changes. Pointed out by: mp
* Catch SIGWINCH in interactive shells and call el_resize() to updatetjr2002-07-231-0/+15
| | | | libedit's idea of the window size.
* Call el_source() to read the contents of .editrc when line editing is enabled.tjr2002-07-231-0/+1
| | | | | Obtained from: NetBSD MFC after: 2 weeks
* Add a `bind' builtin command, which is simply a wrapper around libedit'stjr2002-07-234-0/+24
| | | | | | | builtin command of the same name. This allows the key bindings for the shell's line editor to be changed. MFC after: 2 weeks
* Don't allow "||" or "&&" to be the first tokens of a command.tjr2002-07-221-0/+1
| | | | | PR: 40386 MFC after: 2 weeks
* Implement the P1003.2 `command' builtin command, which is used to suppresstjr2002-07-214-4/+78
| | | | | | shell function and alias lookup. The -p option has been implemented, the UPE -v and -V options have not. The old `command' command has been renamed to `builtin'.
* Document that only one of the -n and -e options may be specified fortjr2002-07-201-1/+11
| | | | | | | sh(1)'s echo(1) builtin command. PR: 32935, 40747 MFC after: 1 week
* Remove broken and incomplete support for old releases of System V,tjr2002-07-197-236/+1
| | | | don't support system that implement getcwd(3) with a pipe to /bin/pwd.
* Don't assume file descriptors fit in a short, use an int instead.tjr2002-07-181-1/+1
|
* Avoid using ints or shorts to store process id's, use pid_t instead.tjr2002-07-182-22/+23
| | | | | | The pgrp member of struct job was declared as a short and could not store every possible process group ID value, the rest of them were benign because pid_t happens to be an int.
* Make the message that is printed when the foreground process is terminatedtjr2002-07-182-2/+24
| | | | by a signal the same as pdksh/bash/sh before rev. 1.34.
* Don't assume the shell's controlling terminal is attached to file descriptortjr2002-07-111-8/+27
| | | | | | | | 2. Instead, open /dev/tty. This problem stopped commands in subshells from being executed correctly if standard error was redirected. PR: 36671 Obtained from: NetBSD (but simplified)
* Remove support for the "old" tty driver by unifdef -UOLD_TTY_DRIVER;tjr2002-07-111-40/+0
| | | | | many other parts of the shell are no longer compatible with this, and it makes jobs.c quite cluttered with #ifdef's.
* When growing the job table, don't relocate the jobmru pointer if it's NULL.tjr2002-07-111-1/+2
|
* Close file descriptors when [n]>&- and [n]<&- redirections are used.tjr2002-07-091-1/+2
| | | | | | | This was broken by rev. 1.16. PR: 40334 MFC after: 1 week
OpenPOWER on IntegriCloud