summaryrefslogtreecommitdiff
path: root/bin/csh
AgeCommit message (Collapse)Author
2017-12-18No need to declare variable name as static in dounsetenv(). Also, drop aanton
redundant call to free() since name is always freed upon return. From Michael W. Bombardieri, with some tweaks by myself.
2017-12-16Passing NULL to free() is fine; from Michael W. Bombardieri.anton
2017-12-12Document change in the default shell prompts.Theo Buehler
Discussed with and ok jmc
2017-12-12Include hostname in shell prompts by defaultTheo Buehler
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
2017-11-16In revision 1.35 of file.c, tenex() was modified to respect the inputline_sizeanton
argument but I forgot to adapt one conditional. Still no functional change since tenex() only has one call site where `inputline_size == sizeof(buf)`.
2017-11-16Zap a redundant cast.anton
2017-08-30Zap redundant assignment; ok jca@anton
2017-08-30Respect inputline_size argument. No functional change since tenex() only has oneanton
call site where `inputline_size == sizeof(buf)`.
2017-08-30Fix pasting of long (>BUFSIZ) lines in csh with filec enabled. NUL-terminatinganton
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).
2017-07-26Align variables and put logical operators at EOL. No binary change.anton
2017-07-26Postpone printing of prompt if filec is enabled in csh. Any I/O should beanton
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@
2017-07-22Use monotonic clock for the time command in csh and ksh.anton
From Scott Cheloha ok tb@
2017-07-18Restore tty when aborting loop.anton
ok deraadt@
2017-07-10remove misc. depend and yacc nits that no longer matter.Marc Espie
okay millert@
2017-06-29Switch TIOCSTAT to _IO(). Two decades ago it was mistakenly defined toTheo de Raadt
take an argument. Discussed with millert and tedu.
2017-06-27Tweak previous: align declarations and rename local variable.anton
2017-06-27in recently commited TIOCSTI replacement code, do not assumeTheo de Raadt
little-endian or unsigned char :-) ok anton
2017-06-22Make sure to abort loops when pressing ^C in csh.anton
Regression found by deraadt@
2017-06-21Minor style(9) corrections and whitespace cleanup to csh.anton
ok deraadt@ tb@
2017-06-21Replace usage of TIOCSTI in csh using a more common IO-loop where ICANON isanton
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@
2017-06-20Don't try to close every single file descriptor up to _SC_OPEN_MAX in csh.anton
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@
2017-06-17Move win variable.anton
ok deraadt@ tb@
2017-06-16mark files as BUILDFIRST, or write explicit dependencies, so that mostMarc Espie
programs will build even without a make depend first. okay tb@ millert@
2017-06-10missing blank before full stop, found with mandoc -TlintIngo Schwarze
2017-01-23Call isatty() before tcgetattr() in the lex. This is a little redundant,Theo de Raadt
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.
2016-10-07suppose we should fix csh while we're at it.Ted Unangst
2016-08-14Don't reinvent rlim_t; when printing it use %llu and cast toPhilip Guenther
unsigned long long ok natano@ tedu@
2016-08-14Don't call sysconf() in a loop conditional when the loop won't affect itPhilip Guenther
ok natano@ tedu@
2016-04-16Change last non-/gnu/ fcntl(x, F_GETFL, 0) strays to fcntl(x, F_GETFL).Kenneth R Westerback
No functional change. ok millert@
2016-03-20Use fcntl(fd, F_SETFL, flags) to clear O_NONBLOCK instead ofTodd C. Miller
ioctl(fd, FIONBIO, ...). OK krw@
2016-03-19Turn off the close-on-exec bit with fcntl() instead of ioctl().Kenneth R Westerback
Remove some now useless "#include <ioctl.h>" lines. Inspired by & ok millert@
2016-03-18Replace ioctl(fd, FIOCLEX) with fcntl(fd, F_SETFD, FD_CLOEXEC)Todd C. Miller
No functional change. "I like the idea" from guenther@
2015-12-26Replace handrolled xfree() function by directly using free(3)mestre
OK mmcc@
2015-12-22Remove a needless allocation cast. No binary change.mmcc
2015-11-11exit() after perror() for pledge failure. Perhaps this got introducedTheo de Raadt
as a test idiom, either when pledge was young or during the transition to strings.... dunno
2015-10-28unifdef _PATH_*Christian Weisgerber
2015-10-26miscellaneous cruft:Christian Weisgerber
* remove lint * unifdef S_IFLNK, S_ISFIFO, S_ISLNK, S_ISSOCK, O_APPEND * remove 0, NOTUSED, notdef -- untouched since original import * remove IIASA
2015-10-26remove the profiling and debugging ifdefs; ok zhuk@Christian Weisgerber
2015-10-26document the -p and -l file enquiries and explicitly do not document -sChristian Weisgerber
with/ok schwarze@
2015-10-26Remove the #define Strfoo() s_strfoo() redirection and move everythingChristian Weisgerber
directly to Strfoo(). Purely mechanical. ok deraadt@
2015-10-26Clean up cruft made visible by the NLS unifdefing:Christian Weisgerber
* remove setlocale() calls * remove write-only variable AsciiOnly * remove now unused string constants STRLANG, STRLC_CTYPE * remove hardcoded support for ISO8859-1 ok millert@
2015-10-26unifdef BUILTIN (unused), NLS (always set), SHORT_STRINGS (always set)Christian Weisgerber
and remove a few unused defines; no binary changes; ok tedu@ zhuk@
2015-10-22setlocale() before pledge()... until we learn moreTheo de Raadt
2015-10-18With TIOCSTI supported in pledge "tty proc", csh is good enough to runTheo de Raadt
with pledge "stdio rpath wpath cpath fattr getpw proc exec tty". (Note that ksh "emacs mode" is also a abus^Wconsumer of TIOCSTI, but we had let that slide for a week since noone uses it...)
2015-09-29Score a hat trick in code cleanup: #ifdef pdp11, /* confuse lint */,Philip Guenther
and recursive formatting of integers. Just use snprintf() and a hammer. ok beck@ deraadt@ miod@
2015-09-27lint is dead: delete the trivial uses of /* VARARGS[0-9]+ */Philip Guenther
(others require more care)
2015-06-17stray char jumped inTheo de Raadt
2015-06-17delete completely bogus (floating? was there an old variable declTheo de Raadt
in the past?) comment about FILEC noted by Peter Brottveit Bock
2015-06-17remove -DFILEC; code does not compile for the -UFILEC case, and anyways,Theo de Raadt
who wants csh without FILEC?? from Peter Brottveit Bock, but redone using unifdef
2015-06-03better description of internal copyn() functionTheo de Raadt