Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Delete worthless comments. | tjr | 2002-10-30 | 1 | -5/+1 |
| | |||||
* | Avoid accidentally making "-h" a synonym for "fc". | tjr | 2002-10-18 | 1 | -1/+1 |
| | | | | Obtained from: NetBSD | ||||
* | Do not strip CTL* escapes from redirection filenames in argstr(); they | tjr | 2002-10-08 | 1 | -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" compound | tjr | 2002-10-06 | 1 | -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 of | tjr | 2002-10-02 | 1 | -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 include | tjr | 2002-10-01 | 1 | -1/+9 |
| | | | | in the previous commit. | ||||
* | Replace a home-grown printf() clone with a fwopen() wrapper around | tjr | 2002-10-01 | 1 | -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. | mux | 2002-10-01 | 1 | -2/+0 |
| | | | | Tested on: alpha, i386, sparc64 | ||||
* | Restore "not found" error message when searching for (or executing) | tjr | 2002-10-01 | 1 | -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. | mux | 2002-10-01 | 1 | -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 string | tjr | 2002-10-01 | 1 | -0/+2 |
| | | | | errors with %qd formats. | ||||
* | Use the %t format modifier to print differences between | mux | 2002-10-01 | 2 | -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=2 | tjr | 2002-10-01 | 1 | -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() | tjr | 2002-10-01 | 1 | -12/+0 |
| | | | | function in libc. | ||||
* | Remove bits and pieces of support for atty, which was made obsolete by | tjr | 2002-10-01 | 4 | -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 the | tjr | 2002-09-30 | 1 | -6/+6 |
| | | | | error message. Stops ulimit giving error messages like "ulimit: ulimit: xyz". | ||||
* | Allow a left parenthesis before patterns in case blocks. POSIX requires | tjr | 2002-09-30 | 1 | -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 versions | tjr | 2002-09-30 | 1 | -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. | tjr | 2002-09-29 | 2 | -34/+0 |
| | |||||
* | Convert the remaining callers of errmsg() to use strerror(), and remove | tjr | 2002-09-29 | 4 | -111/+13 |
| | | | | errmsg() and its table of error messages. | ||||
* | Correct a usage of fnctl that could not be right and results in a | nectar | 2002-09-11 | 1 | -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(). | keramida | 2002-08-29 | 1 | -0/+1 |
| | | | | Reviewed by: tjr | ||||
* | Replace various spellings with FALLTHROUGH which is lint()able | charnier | 2002-08-25 | 2 | -2/+2 |
| | |||||
* | There is a built-in command called "builtin"; spell its name correctly | tjr | 2002-08-24 | 1 | -1/+1 |
| | | | | after rev. 1.77 called it "built-in". | ||||
* | Don't show the process ID of background jobs that have terminated, | tjr | 2002-08-24 | 1 | -1/+1 |
| | | | | for consistency with ksh. | ||||
* | s/filesystem/file system/ as discussed on -developers | trhodes | 2002-08-21 | 2 | -3/+3 |
| | |||||
* | Fix a few typos, among them s/builtin/built-in/ (except for the ref | schweikh | 2002-08-21 | 1 | -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 of | tjr | 2002-08-18 | 1 | -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 are | tjr | 2002-08-17 | 1 | -7/+2 |
| | | | | | | suspended. This is a followup to rev. 1.51. MFC after: 1 week | ||||
* | Allow redirections by themselves between "&&" and "||" operators. | tjr | 2002-08-11 | 1 | -3/+2 |
| | | | | | | | For example, >/dev/null && echo foo Pointed out by: FUJISHIMA Satsuki MFC after: 1 week | ||||
* | mdoc(7) police: tidying. | ru | 2002-08-09 | 1 | -36/+9 |
| | |||||
* | Add a -P/-o physical option which behaves similarly to bash/ksh's options | tjr | 2002-07-25 | 3 | -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 unknown | tjr | 2002-07-25 | 5 | -2/+6 |
| | | | | options. | ||||
* | Use PATH_MAX instead of a local guess at it, which happened to be incorrect. | tjr | 2002-07-25 | 1 | -4/+3 |
| | | | | Suggested by: fanf | ||||
* | pwdcmd()'s argc and argv arguments are no longer unused, remove __unused. | tjr | 2002-07-25 | 1 | -1/+1 |
| | | | | Pointed out by: fanf | ||||
* | Avoid calling el_resize() from a signal handler, even though libedit | tjr | 2002-07-24 | 3 | -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 update | tjr | 2002-07-23 | 1 | -0/+15 |
| | | | | libedit's idea of the window size. | ||||
* | Call el_source() to read the contents of .editrc when line editing is enabled. | tjr | 2002-07-23 | 1 | -0/+1 |
| | | | | | Obtained from: NetBSD MFC after: 2 weeks | ||||
* | Add a `bind' builtin command, which is simply a wrapper around libedit's | tjr | 2002-07-23 | 4 | -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. | tjr | 2002-07-22 | 1 | -0/+1 |
| | | | | | PR: 40386 MFC after: 2 weeks | ||||
* | Implement the P1003.2 `command' builtin command, which is used to suppress | tjr | 2002-07-21 | 4 | -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 for | tjr | 2002-07-20 | 1 | -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, | tjr | 2002-07-19 | 7 | -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. | tjr | 2002-07-18 | 1 | -1/+1 |
| | |||||
* | Avoid using ints or shorts to store process id's, use pid_t instead. | tjr | 2002-07-18 | 2 | -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 terminated | tjr | 2002-07-18 | 2 | -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 descriptor | tjr | 2002-07-11 | 1 | -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; | tjr | 2002-07-11 | 1 | -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. | tjr | 2002-07-11 | 1 | -1/+2 |
| | |||||
* | Close file descriptors when [n]>&- and [n]<&- redirections are used. | tjr | 2002-07-09 | 1 | -1/+2 |
| | | | | | | | This was broken by rev. 1.16. PR: 40334 MFC after: 1 week |