summaryrefslogtreecommitdiffstats
path: root/bin/csh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add some references, most of these were removed when we stopped buildingjsg2021-03-081-2/+7
| | | | | | and installing USD/SMM/PSD docs. jmc@ agrees with the direction, ok millert@ on an earlier diff
* I observed "csh i < file-containing-^T" to hit tenex(), which proceeds toderaadt2020-10-061-8/+15
| | | | | | | | perform tty(4) ioctl operations against a non-tty. That is a pledge violation, you can only do a subset of tty(4) ioctl against a fd which references a tty device. Sidestep this problem if the input descriptor is not a tty ok anton millert
* Fix multiple variable definitions to avoid errors with -fno-common.mortimer2020-08-306-88/+174
| | | | ok millert@
* Clarify that csh's -f flag is not just about .cshrc.millert2020-07-081-6/+4
| | | | | We don't need to be too specific about this in su(1), leave the details for csh(1). OK jca@
* typo fix.nayden2019-11-291-2/+2
| | | | ok deraadt@
* Remove several .Xrs to section 2 and 3 that help little.schwarze2019-07-291-11/+6
| | | | | | Instead, link to the explanation of octal permission masks in chmod(2) directly from the description of "umask", and to ksh(1) from SEE ALSO. Fixing an oddity pointed out by guenther@; OK jmc@ millert@.
* Replace cross-references to sigvec(3) with sigaction(2).millert2019-07-261-3/+3
| | | | OK guenther@
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-031-2/+2
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-287-29/+29
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* mkstemp() returns -1 on failurederaadt2019-06-281-2/+2
|
* In manpages, don't escape apostrophes as \'; it's rarely what you want.bentley2019-06-021-23/+29
| | | | | Most of these are correct just as '. A few benefit from Ql or \(aq. But if in doubt, just use '.
* remove mention of sbrk.daniel2018-11-101-5/+3
| | | | ok tb@
* Fix memory leak in setDolp() where dp is NULL. Based on a diff frommiko2018-10-261-7/+3
| | | | netbsd, with help from martijn@ and millert@.
* Fix some minor issues found by coverity.martijn2018-10-246-17/+15
| | | | OK millert@ and miko@
* If getcwd() fails in dinit(), the stat buffer 'swd' is usedmillert2018-09-191-30/+30
| | | | | | | | uninitialized by the else clause. Since it is used in both clauses we should perform the stat before the if(). However, fixing this causes 'cp' to be unitialized in some case so initialize cp to NULL and move the "cp == NULL" check out of the first if() clause now that it can be true in either case. OK miko@ deraadt@
* Fix last commit, I made one of the changes to the wrong line.millert2018-09-191-3/+3
| | | | Noticed by martijn@
* Compare against NULL, not '\0' for pointers. Quiets a warning onmillert2018-09-191-3/+3
| | | | newer gcc.
* Restore the xmalloc(), xcalloc(), xreallocarray() and xstrdup() changes.millert2018-09-186-35/+30
| | | | OK deraadt@
* backout last week of csh diffs. They are disasterously broken, on i386deraadt2018-09-1813-60/+74
| | | | it becomes entirely unusable.
* remove macros for xmalloc(), xcalloc() & xreallocarray() and just name themiko2018-09-183-13/+9
| | | | | | functions that. ok millert@ martijn@
* Replace any() with strchr(3).martijn2018-09-179-49/+40
| | | | OK millert@ and miko@
* strsave() is hard-fail strdup() so simplify and rename to xstrdup().miko2018-09-154-15/+14
| | | | | | with help from martijn@. ok millert@ martijn@
* blkfree() takes no action for NULL pointer so callers can avoid checking.miko2018-09-086-29/+24
| | | | ok jca@
* No need to declare variable name as static in dounsetenv(). Also, drop aanton2017-12-181-5/+2
| | | | | | redundant call to free() since name is always freed upon return. From Michael W. Bombardieri, with some tweaks by myself.
* Passing NULL to free() is fine; from Michael W. Bombardieri.anton2017-12-164-18/+11
|
* Document change in the default shell prompts.tb2017-12-121-3/+3
| | | | Discussed with and ok jmc
* Include hostname in shell prompts by defaulttb2017-12-122-6/+15
| | | | | | | | | | | | | | | With tmux, ssh and vmd, we tend to open shells on many different hosts simultaneously and the default prompts '$ ' and '# ' for {,k}sh as well as '% ' and '# ' for csh become dangerous: it's very easy to issue a command on the wrong host. This can easily be avoided by displaying the hostname in the prompt. Everything beyond "hostname{$,#,%} " is going to be a matter of taste, so we left it at that. If you use an FQDN, only the first part (the output of 'hostname -s') will be printed. requested by and ok deraadt; mostly positive feedback many ok anton, brynet, bcallah and others
* In revision 1.35 of file.c, tenex() was modified to respect the inputline_sizeanton2017-11-161-2/+2
| | | | | argument but I forgot to adapt one conditional. Still no functional change since tenex() only has one call site where `inputline_size == sizeof(buf)`.
* Zap a redundant cast.anton2017-11-161-3/+2
|
* Zap redundant assignment; ok jca@anton2017-08-301-2/+1
|
* Respect inputline_size argument. No functional change since tenex() only has oneanton2017-08-301-1/+3
| | | | call site where `inputline_size == sizeof(buf)`.
* Fix pasting of long (>BUFSIZ) lines in csh with filec enabled. NUL-terminatinganton2017-08-304-9/+22
| | | | | | | | | the input buffer instructs csh that the buffer contains a complete command. This is wrong and should only happen when buffer is not full, otherwise more data has to be read in order form a complete command. While here, do not print the prompt again when the input exceeds the input buffer and while inserting a line continuation (backslash).
* Align variables and put logical operators at EOL. No binary change.anton2017-07-261-12/+12
|
* Postpone printing of prompt if filec is enabled in csh. Any I/O should beanton2017-07-263-5/+7
| | | | | | | performed first when canonical mode has been disabled on the tty just like ksh does. Discovered by the regress tests. Joint work with bluhm@, ok deraadt@
* Use monotonic clock for the time command in csh and ksh.anton2017-07-225-21/+21
| | | | | From Scott Cheloha ok tb@
* Restore tty when aborting loop.anton2017-07-181-2/+4
| | | | ok deraadt@
* remove misc. depend and yacc nits that no longer matter.espie2017-07-101-2/+1
| | | | okay millert@
* Switch TIOCSTAT to _IO(). Two decades ago it was mistakenly defined toderaadt2017-06-291-4/+2
| | | | take an argument. Discussed with millert and tedu.
* Tweak previous: align declarations and rename local variable.anton2017-06-271-6/+6
|
* in recently commited TIOCSTI replacement code, do not assumederaadt2017-06-271-7/+9
| | | | | little-endian or unsigned char :-) ok anton
* Make sure to abort loops when pressing ^C in csh.anton2017-06-221-1/+6
| | | | Regression found by deraadt@
* Minor style(9) corrections and whitespace cleanup to csh.anton2017-06-211-10/+9
| | | | ok deraadt@ tb@
* Replace usage of TIOCSTI in csh using a more common IO-loop where ICANON isanton2017-06-211-175/+344
| | | | | | | disabled and a single char of input is read at a time. This requires the line editing capabilities provided when ICANON is enabled to be implemented. With help and feedback from deraadt@
* Don't try to close every single file descriptor up to _SC_OPEN_MAX in csh.anton2017-06-201-4/+34
| | | | | | | Instead, close the fds that reside in between the gaps of used fds and once the largest used fd is reached call closefrom(). ok deraadt@
* Move win variable.anton2017-06-171-3/+2
| | | | ok deraadt@ tb@
* mark files as BUILDFIRST, or write explicit dependencies, so that mostespie2017-06-161-1/+2
| | | | | programs will build even without a make depend first. okay tb@ millert@
* missing blank before full stop, found with mandoc -Tlintschwarze2017-06-101-11/+11
|
* Call isatty() before tcgetattr() in the lex. This is a little redundant,deraadt2017-01-231-2/+2
| | | | | | but avoids doing pledge "tty" operations against flat files. The shell's tty will be kind of special in the near future. isatty is also a lot less kernel code to run through the loop.
* suppose we should fix csh while we're at it.tedu2016-10-071-2/+3
|
* Don't reinvent rlim_t; when printing it use %llu and cast toguenther2016-08-141-16/+14
| | | | | | unsigned long long ok natano@ tedu@