From owner-dev-commits-src-all@freebsd.org Sun Mar 14 16:30:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 476775AB92A for ; Sun, 14 Mar 2021 16:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dz4ll1XRCz4RxW; Sun, 14 Mar 2021 16:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 273A420A96; Sun, 14 Mar 2021 16:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12EGUBQd060805; Sun, 14 Mar 2021 16:30:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12EGUBXc060761; Sun, 14 Mar 2021 16:30:11 GMT (envelope-from git) Date: Sun, 14 Mar 2021 16:30:11 GMT Message-Id: <202103141630.12EGUBXc060761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dmitry Chagin Subject: git: 1b174d6cdff5 - vendor/tcsh - Import 6.22.03-ceccc7f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/vendor/tcsh X-Git-Reftype: branch X-Git-Commit: 1b174d6cdff5276d6dad729c6fe9352d9ee5da7d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2021 16:30:11 -0000 The branch vendor/tcsh has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1b174d6cdff5276d6dad729c6fe9352d9ee5da7d commit 1b174d6cdff5276d6dad729c6fe9352d9ee5da7d Author: Dmitry Chagin AuthorDate: 2021-03-14 16:28:29 +0000 Commit: Dmitry Chagin CommitDate: 2021-03-14 16:28:29 +0000 Import 6.22.03-ceccc7f --- FAQ | 339 ++--- Fixes | 23 + Imakefile | 14 +- Makefile.ADMIN | 24 + Makefile.in | 11 +- Makefile.std | 2 +- Makefile.vms | 2 +- README.md | 9 +- aclocal.m4 | 1025 ++++++++++++-- config/linux | 7 + configure | 3803 +++++++++++++++++++++++++++++++--------------------- configure.ac | 5 +- dot.login | 12 + dot.tcshrc | 110 ++ ed.chared.c | 18 +- ed.inputl.c | 2 +- ed.screen.c | 2 +- ed.xmap.c | 2 +- host.defs | 2 +- patchlevel.h | 6 +- sh.c | 17 +- sh.dir.c | 41 +- sh.dol.c | 132 +- sh.exp.c | 2 +- sh.func.c | 5 +- sh.glob.c | 11 +- sh.h | 6 +- sh.hist.c | 10 +- sh.lex.c | 47 +- sh.misc.c | 21 +- sh.set.c | 14 +- tc.alloc.c | 10 + tc.disc.c | 4 + tc.os.c | 2 +- tc.prompt.c | 2 +- tcsh.man | 21 +- tcsh.man.new | 64 +- tests/lexical.at | 107 ++ tests/subst.at | 28 +- tests/variables.at | 26 +- tw.parse.c | 4 +- 41 files changed, 3900 insertions(+), 2092 deletions(-) diff --git a/FAQ b/FAQ index 92aadc726683..93773c52433a 100644 --- a/FAQ +++ b/FAQ @@ -1,237 +1,190 @@ + * Home + * FAQ + * Y2K + __________________________________________________________________ - [Home] FAQ +FAQ - Home | RecentChanges | Preferences - _________________________________________________________________ + For the people who do not read the manual! - This is for people who do not read the manual! + Why is the meta key broken in tcsh-5.20 and up? - So far people who don't read manuals don't read this either... I may - call it README.*PLEASE* in the future, but then the same people won't - be able to get ftp it... :-) - _________________________________________________________________ - - 1. Where can I find tcsh sources? - - See http://www.tcsh.org/MostRecentRelease for download locations. - _________________________________________________________________ - - 2. Why is the meta key broken in tcsh-5.20 and up? - - On some machines the tty is not set up to pass 8 bit characters by - default. Tcsh 5.19 used to try to determine if pass8 should be set by + On some machines the tty is not set up to pass 8 bit characters by + default. Tcsh 5.19 used to try to determine if pass8 should be set by looking at the terminal's meta key. Unfortunately there is no good way - of determining if the terminal can really pass 8 characters or not. - Consider if you are logged in through a modem line with 7 bits and - parity and your terminal has a meta key. Then tcsh 5.19 would set + of determining if the terminal can really pass 8 characters or not. + Consider if you are logged in through a modem line with 7 bits and + parity and your terminal has a meta key. Then tcsh 5.19 would set wrongly set pass8. - If you did like the previous behavior you can add in /etc/csh.login, - or in .login: - + If you did like the previous behavior you can add in /etc/csh.login, or + in .login: if ( $?tcsh && $?prompt ) then if ( "`echotc meta`" == "yes" ) then stty pass8 endif endif - If you don't have pass8, maybe one of these would work.. - + If you don't have pass8, maybe one of these would work: stty -parity -evenp -oddp cs8 -istrip (rs6000) stty -parenb -istrip cs8 - Finally, tcsh will bind all printable meta characters to the self - insert command. If you don't want that to happen (i.e. use the + Finally, tcsh will bind all printable meta characters to the self + insert command. If you don't want that to happen (i.e. use the printable meta characters for commands) setenv NOREBIND. - _________________________________________________________________ - 3. I ran 'dbxtool &' and 'shelltool &' from tcsh, and they end up in - cbreak and no echo mode? - - These programs are broken. Background jobs should not try to look at - the tty. What happens is that dbxtool looks in stderr to inherit the - tty setups, but tcsh sets up the tty in cbreak and -echo modes, so - that it can do line editing. This cannot be fixed because tcsh cannot - give away the tty. Pick one of the following as a workaround: + I ran dbxtool & and shelltool & from tcsh, and they end up in cbreak and no + echo mode? + These programs are broken. Background jobs should not try to look at + the tty. What happens is that dbxtool looks in stderr to inherit the + tty setups, but tcsh sets up the tty in cbreak and -echo modes, so that + it can do line editing. This cannot be fixed because tcsh cannot give + away the tty. Pick one of the following as a workaround: dbxtool < /dev/null >& /dev/null & /usr/etc/setsid dbxtool & - If that does not work, for dbxtool at least you can add "sh stty sane" - in your .dbxinit - _________________________________________________________________ + If that does not work, for dbxtool at least you can add sh stty sane in + your .dbxinit file. - 4. I tried to compile tcsh and it cannot find ? + I tried to compile tcsh and it cannot find ? - Your system does not support NLS. Undefine NLS in config_f.h and it + Your system does not support NLS. Undefine NLS in config_f.h and it should work fine. - _________________________________________________________________ - - 5. Where can I get csh sources? - - Csh sources are now available with the 4.4BSD networking - distributions. You don't need csh sources to compile tcsh-6.0x. - _________________________________________________________________ - - 6. I just made tcsh my login shell, and I cannot ftp any more? - - Newer versions of the ftp daemon check for the validity of the user's - shell before they allow logins. The list of valid login shells is - either hardcoded or it is usually in a file called /etc/shells. If it - is hard-coded, then you are out of luck and your best bet is to get a - newer version of ftpd. Otherwise add tcsh to the list of shells. [For - AIX this file is called /etc/security/login.cfg.] Remember that the - full path is required. If there is no /etc/shells, and you are - creating one, remember to add /bin/csh, /bin/sh, and any other valid - shells for your system, so that other people can ftp too :-) - _________________________________________________________________ - - 7. I am using SunView or OpenWindows and editing is screwed up. In - particular my arrow keys and backspace don't work right. What am I - doing wrong? - - Well, cmdtool tries to do its own command line editing and the effect - you get is one of using an editor inside an editor. Both try to - interpret the arrow key sequences and cmdtool wins since it gets them - first. The solutions are in my order of preference: - 1. Don't use suntools - 2. Use shelltool instead of cmdtool. - 3. Unset edit in tcsh. - _________________________________________________________________ + Where can I get csh sources? + + Csh sources are now available with the 4.4BSD networking distributions. + You don't need csh sources to compile tcsh-6.0x. + + I just made tcsh my login shell, and I cannot ftp any more? + + Newer versions of the ftp daemon check for the validity of the user's + shell before they allow logins. The list of valid login shells is + either hardcoded or it is usually in a file called /etc/shells. If it + is hard-coded, then you are out of luck and your best bet is to get a + newer version of ftpd. Otherwise add tcsh to the list of shells. (For + AIX this file is called /etc/security/login.cfg.) Remember that the + full path is required. If there is no /etc/shells, and you are creating + one, remember to add /bin/csh, /bin/sh, and any other valid shells for + your system, so that other people can ftp too. - 8. On a SPARCstation running Solaris 2.x and OpenWindows 3.1, inside a - cmdtool, the short-cut key sequence to clear log (i.e. Meta-e or - Diamond-e) doesn't work: it just echos 'e'; or + I am using SunView or OpenWindows and editing is screwed up. In particular my + arrow keys and backspace don't work right. What am I doing wrong? + + Well, cmdtool tries to do its own command line editing and the effect + you get is one of using an editor inside an editor. Both try to + interpret the arrow key sequences and cmdtool wins since it gets them + first. The solutions are in my order of preference: + * Don't use suntools + * Use shelltool instead of cmdtool. + * Unset edit in tcsh. + + On a SPARCstation running Solaris 2.x and OpenWindows 3.1, inside a cmdtool, + the short-cut key sequence to clear log (i.e. Meta-e or Diamond-e) doesn't + work: it just echos ‘e’; or Unset edit in tcsh. - _________________________________________________________________ - 9. On a SPARCstation running Solaris 2.x and OpenWindows 3.1, maketool - (within SPARCworks) doesn't work: it just does a `cd' to the working - directory then stops. + On a SPARCstation running Solaris 2.x and OpenWindows 3.1, maketool (within + SPARCworks) doesn't work: it just does a `cd’ to the working directory then + stops. - Unset edit in tcsh. Using shelltool instead of cmdtool does not fix + Unset edit in tcsh. Using shelltool instead of cmdtool does not fix this. - _________________________________________________________________ - 10. I rlogin to another machine, and then no matter what I tell 'stty' - I cannot get it to pass 8 bit characters? + I rlogin to another machine, and then no matter what I tell stty I cannot get + it to pass 8 bit characters? - Maybe you need to use 'rlogin -8' to tell rlogin to pass 8 bit + Maybe you need to use rlogin -8 to tell rlogin to pass 8 bit characters. - _________________________________________________________________ - 11. Where do I get the public domain directory library? + Where do I get the public domain directory library? - Anonymous ftp to prep.ai.mit.edu:/pub/gnu/dirent.tar.Z - _________________________________________________________________ + Anonymous ftp to ftp://prep.ai.mit.edu/pub/gnu/dirent.tar.Z - 12. I compiled tcsh using gcc, and when I start up it says: tcsh: - Warning no access to tty (Invalid Argument). Thus no job control in - this shell + I compiled tcsh using gcc, and when I start up it says: tcsh: Warning no + access to tty (Invalid Argument). Thus no job control in this shell - Your file is not ansi compliant. You have one of 3 + Your file is not ansi compliant. You have one of 3 choices: + * Run fixincludes from the gcc distribution. + * Add -traditional to the gcc flags. + * Compile with cc. - 1. Run fixincludes from the gcc distribution. - 2. Add -traditional to the gcc flags. - 3. Compile with cc. - _________________________________________________________________ - - 13. I compiled tcsh with the SunOS unbundled compiler and now things - get echo'ed twice. + I compiled tcsh with the SunOS unbundled compiler and now things get echoed + twice. It is a bug in the unbundled optimizer. Lower the optimization level. - _________________________________________________________________ - 14. How can I use the arrow keys with hpterm? + How can I use the arrow keys with hpterm? Hp terminals use the arrow keys internally. You can tell hpterm not to do that, by sending it the termcap sequence smkx. Since this has to be - done all the time, the easiest thing is to put it as an alias for + done all the time, the easiest thing is to put it as an alias for precmd, or inside the prompt: - if ($term == "hp") then set prompt="%{`echotc smkx`%}$prompt" endif - Note that by doing that you cannot use pgup and pgdn to scroll... Also - if you are using termcap, replace "smkx" with "ks"... - _________________________________________________________________ + Note that by doing that you cannot use pgup and pgdn to scroll… Also if + you are using termcap, replace smkx with ks. - 15. On POSIX machines ^C and ^Z will do not work when tcsh is a login - shell? + On POSIX machines ^C and ^Z do not work when tcsh is a login shell? Make sure that the interrupt character is set to ^C and suspend is set - to ^Z; 'stty -a' will show you the current stty settings; 'stty intr - ^C susp ^Z' will set them to ^C and ^Z respectively. - _________________________________________________________________ + to ^Z; stty -a will show you the current stty settings; stty intr ^C + susp ^Z will set them to ^C and ^Z respectively. - 16. I am trying to compile tcsh and I am getting compile errors that - look like: + I am trying to compile tcsh and I am getting compile errors that look like: - >sh.c:???: `STR???' undeclared, outside of functions [gcc] - >"sh.c", line ???: STR??? undefined [cc] + sh.c:???: `STR???' undeclared, outside of functions [gcc] + "sh.c", line ???: STR??? undefined [cc] - You interrupted make, while it was making the automatically generated - headers. Type 'make clean; make' - _________________________________________________________________ + You interrupted make, while it was making the automatically generated + headers. Type make clean; make - 17. On the cray, sometimes the CR/LF mapping gets screwed up. + On the cray, sometimes the CR/LF mapping gets screwed up. - You are probably logged in to the cray via telnet. Cray's telnetd - implements line mode selection the telnet client you are using does - not implement telnet line mode. This cause the Cray's telnetd to try - to use KLUDGELINEMODE. You can turn off telnet line mode from the cray - side by doing a "stty -extproc", or you can get the Cray AIC to build - a telnetd without KLUDGELINEMODE, or you can compile a new telnet - client (from the BSD net2 tape), or at least on the suns use: 'mode - character'. - _________________________________________________________________ + You are probably logged in to the cray via telnet. Cray's telnetd + implements line mode selection the telnet client you are using does not + implement telnet line mode. This cause the Cray's telnetd to try to use + KLUDGELINEMODE. You can turn off telnet line mode from the cray side by + doing a stty -extproc, or you can get the Cray AIC to build a telnetd + without KLUDGELINEMODE, or you can compile a new telnet client (from + the BSD net2 tape), or at least on the suns use: mode character. - 18. On AU/X, I made tcsh my startup shell, but the mac desktop is not - starting up (no X11 or Finder), and I only get console emulation. + On AU/X, I made tcsh my startup shell, but the mac desktop is not starting up + (no X11 or Finder), and I only get console emulation. - This is another manifestation of item 5. Just add the pathname to tcsh - in /etc/shells and everything should work fine. - _________________________________________________________________ + Add the pathname to tcsh in /etc/shells and everything should work + fine. - 19. On machines that use YP (NIS) tilde expansion might end up in - /dev/null + On machines that use YP (NIS) tilde expansion might end up in /dev/null - If this happens complain to your vendor, to get a new version of NIS. + If this happens complain to your vendor, to get a new version of NIS. You can fix that in tcsh by defining YPBUGS in config.h - _________________________________________________________________ - 20. Script on SGI 4.0.5 does not give us a tty, so we cannot have job - control. + Script on SGI 4.0.5 does not give us a tty, so we cannot have job control. Their csh does not have job control either. Try: - % script % cat > /dev/tty - _________________________________________________________________ - 21. I start tcsh and it takes a couple of minutes to get the prompt. + I start tcsh and it takes a couple of minutes to get the prompt. - You have defined REMOTEHOST and your DNS is not responding. Either + You have defined REMOTEHOST and your DNS is not responding. Either undefine REMOTEHOST and recompile or fix your DNS. - _________________________________________________________________ - - 22. If you need help generating your .cshrc file, check out: - http://www.imada.sdu.dk/~blackie/dotfile/ + If you need help generating your .cshrc file, check out: - or - http://www.dotfiles.com - _________________________________________________________________ + * https://github.com/tcsh-org/tcsh/blob/master/dot.tcshrc + * https://github.com/tcsh-org/tcsh/blob/master/dot.login - 23. On POSIX systems the kernel will send hup signals to all the - processes in the foreground process group if 'stty hupcl' is set. + On POSIX systems the kernel will send hup signals to all the processes in the + foreground process group if ‘stty hupcl’ is set. For example - ./tcsh echo $$ 591 @@ -240,65 +193,51 @@ Will kill everything, since hup will be sent to all tcsh processes. To avoid that you can set stty -hupcl, but it is not recommended. - _________________________________________________________________ - 24. When I rsh the meta key stops working on the remote machine. + When I rsh the meta key stops working on the remote machine. - Try using rsh -8; this option is undocumented on some systems, but it - works. If that does not work, get and use ssh/sshd. You'll be better + Try using rsh -8; this option is undocumented on some systems, but it + works. If that does not work, get and use ssh/sshd. You'll be better off from a security point of view anyway. - _________________________________________________________________ - 25. Tcsh compiled under hp/ux-10.x does not pass resource limits - correctly when ran on hp/ux-11.x systems. + Tcsh compiled under hp/ux-10.x does not pass resource limits correctly when + ran on hp/ux-11.x systems. - This is a problem with lack of ABI compatibility between the two + This is a problem with lack of ABI compatibility between the two systems. The only solution is to recompile. - _________________________________________________________________ - 26. Refreshing in command line editing can appear broken on some OS's + Refreshing in command line editing can appear broken on some OS's - This is because the termcap/terminfo description lies about the - ability of the terminal to use tabs. At least on Compaq/DEC Alpha - OSF/1 3.x and 4.x systems, stty -tabs will cause problems. - _________________________________________________________________ + This is because the termcap/terminfo description lies about the ability + of the terminal to use tabs. At least on Compaq/DEC Alpha OSF/1 3.x and + 4.x systems, stty -tabs will cause problems. - 27. Where can I learn the merits of tcsh vs. bash vs. csh vs. sh etc? + Where can I learn the merits of tcsh vs. bash vs. csh vs. sh etc? - You can read the manual page section titled [NEW FEATURES] listing + You can read the manual page section titled [NEW FEATURES] listing features that tcsh adds to csh. - You can read Tom Christiansen's [Csh Programming Considered Harmful], - a document advocating that csh (and by extension, tcsh) should not be + You can read Tom Christiansen's Csh Programming Considered Harmful, a + document advocating that csh (and by extension, tcsh) should not be used for writing shell scripts. - XXX: Need to find something about [bash], but bash is sh-compatible - and has many of the same interactive features of tcsh (command - completion does not appear to be as flexible, though). - - [Curtains up: introducing the Z shell] has a pretty good rundown on - zsh. Aside from the arguments about csh being evil, tcsh appears to - compare well with zsh [zsh]. Zsh is sh and ksh compatible, with many - of the interactive features of tcsh. - _________________________________________________________________ - - 28. Why does FreeBSD's tcsh do history browsing differently than I - expect? + XXX: Need to find something about bash, but bash is sh-compatible and + has many of the same interactive features of tcsh (command completion + does not appear to be as flexible, though). - On FreeBSD, by default, the up arrow is set to - "history-search-backward", rather than the default "up-history". As a - result, if you type (part of) a word and press up arrow, you'll see - previous commands that match the prefix. Pretty useful, actually, - although it takes some getting used to. You can use bindkey to see - your settings, and to rebind up & down differently if desired. - _________________________________________________________________ + Curtains up: introducing the Z shell has a pretty good rundown on zsh. + Aside from the arguments about csh being evil, tcsh appears to compare + well with zsh. Zsh is sh and ksh compatible, with many of the + interactive features of tcsh. - Everything else is a bug :-( + Why does FreeBSD's tcsh do history browsing differently than I expect? - Christos - _________________________________________________________________ + On FreeBSD, by default, the up arrow is set to history-search-backward, + rather than the default up-history. As a result, if you type (part of) + a word and press up arrow, you'll see previous commands that match the + prefix. Pretty useful, actually, although it takes some getting used + to. You can use bindkey to see your settings, and to rebind up & down + differently if desired. + __________________________________________________________________ - Home | RecentChanges | Preferences - Edit text of this page | View other revisions - Last edited April 29, 2004 15:02 (diff) - Search: ____________________ + Page content last updated on 2019-12-31 diff --git a/Fixes b/Fixes index db401f23fad0..e539c8241a86 100644 --- a/Fixes +++ b/Fixes @@ -1,3 +1,25 @@ + 14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle) + 13. Fix $x:q:h and $x:q:t return the whole string for strings not containing / + 12. V6.22.03 - 20201118 + 11. Fix $x:q:h and $x:q:t to not crash (alzwded) with strings containing / + 10. Block SIGHUP while writing history/directory stack (Brett Frankenberger) + 9. Fixed reversed test that broke history merging (Brett Frankenberger) + 8. Prevent recursive entry for writing history (Brett Frankenberger) + 7. alxwded@github, keep track of the :g and :a modifiers per modifier they + affect. + 6. alzwded@github, fix infinite loop with :gas variable modifier + 5. PR/88: Add a Q: modifier that preserves empty arguments leaving :q + alone. + 4. V6.22.02 - 20191204 + 3. Fix version in configure.ac + 2. V6.22.01 - 20191201 + 1. undo PR/88: Preserve empty arguments in :q, since it breaks + $ set x="" + $ alias test "echo "\""$x:q"\"" is working." + $ alias test + echo " + + 6. V6.22.00 - 20191128 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is not a tty. 4. Avoid infinite loops during history loads when merging, print a better @@ -6,6 +28,7 @@ 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) 1. PR/81: Fix range matching issue where we were comparing with the range character instead of the start of range. [l-z]* would match foo + 12. V6.21.00 - 20190508 11. Abort history loading on words and lines too long https://bugzilla.redhat.com/show_bug.cgi?id=1598502 diff --git a/Imakefile b/Imakefile index be2bebe17ca9..bd1b43b1a24e 100644 --- a/Imakefile +++ b/Imakefile @@ -492,14 +492,15 @@ SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \ sh.char.c sh.exp.c sh.file.c sh.func.c \ sh.glob.c sh.hist.c sh.init.c sh.lex.c \ sh.misc.c sh.parse.c sh.print.c sh.proc.c \ - sh.sem.c sh.set.c sh.time.c glob.c \ + sh.sem.c sh.set.c sh.time.c dotlock.c dotlock.h glob.c \ sh.char.h sh.dir.h sh.proc.h sh.h \ sh.decls.h glob.h ${SYSSRCS} SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS} + sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} dotlock.${SUF} glob.${SUF} \ + ${SYSOBJS} TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ tw.comp.c tw.color.c @@ -512,9 +513,10 @@ EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \ ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF} TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ - tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \ - tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ - tc.who.c tc.h + tc.func.c tc.nls.c tc.nls.h tc.os.c tc.os.h tc.printf.c tc.prompt.c \ + tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} \ + tc.printf.${SUF} tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h \ + tc.vers.c tc.wait.h tc.who.c tc.h TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \ tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \ tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ @@ -524,7 +526,7 @@ MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ - Makefile.in configure.ac Makefile.win32 aclocal.m4 + Makefile.in configure.ac Makefile.win32 aclocal.m4 dot.login dot.tcshrc CONFSRCS=config/[a-z]* diff --git a/Makefile.ADMIN b/Makefile.ADMIN new file mode 100644 index 000000000000..5ad3bb8fb3c5 --- /dev/null +++ b/Makefile.ADMIN @@ -0,0 +1,24 @@ +# +# Makefile.ADMIN +# +# Maintenance tasks +# +# You can refetch files from the website, then run "git diff" to +# sanity check any changes before committing. +# + +LYNX= lynx -dump -nolist +TRIM= expand | sed -e 's/^ *$$//' | cat -s +WEB= https://www.tcsh.org + +PAGES= FAQ + +all: ${PAGES} + +.for i in ${PAGES} +$i: force + ${LYNX} ${WEB}/${i:tl}/ | ${TRIM} > ${.TARGET} +.endfor + +.DUMMY: force +force: diff --git a/Makefile.in b/Makefile.in index 210b7de72dfe..c6b5f2554cc0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,7 @@ # things; Paul Placeway, CIS Dept., Ohio State University # SHELL=/bin/sh +ENVCMD=/usr/bin/env VERSION=@PACKAGE_VERSION@ BUILD=tcsh$(EXEEXT) VPATH=@srcdir@ @@ -410,7 +411,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ gethost.c tcsh.man2html configure.ac configure config.h.in \ - tests/testsuite.at aclocal.m4 + tests/testsuite.at aclocal.m4 dot.login dot.tcshrc TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ tests/mb-utf8.at tests/noexec.at tests/parenthesis.at tests/syntax.at \ @@ -634,6 +635,8 @@ veryclean: clean ${RM} -f Makefile config.h config_p.h ${RM} -f config.status config.cache config.log tcsh.ps ${RM} -f missing + ${RM} -f testsuite.log + ${RM} -rf testsuite.dir ${RM} -rf autom4te.cache ${RM} -f *~ #* @@ -735,8 +738,10 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.ac cd $(srcdir) && autoheader @echo timestamp > $(srcdir)/stamp-h.in -check: atconfig $(srcdir)/tests/testsuite - $(SHELL) $(srcdir)/tests/testsuite +check test: atconfig $(srcdir)/tests/testsuite + $(ENVCMD) - \ + USER="$(USER)" \ + $(SHELL) $(srcdir)/tests/testsuite # # Dependencies diff --git a/Makefile.std b/Makefile.std index 3466d4ceac86..8c479fa1f213 100644 --- a/Makefile.std +++ b/Makefile.std @@ -320,7 +320,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ gethost.c tcsh.man2html configure.ac configure config.h.in \ - aclocal.m4 + aclocal.m4 dot.login dot.tcshrc VHSRCS=${PVSRCS} ${AVSRCS} diff --git a/Makefile.vms b/Makefile.vms index bc241147e253..2e3f4adbfed4 100644 --- a/Makefile.vms +++ b/Makefile.vms @@ -297,7 +297,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ - gethost.c tcsh.man2html configure.ac aclocal.m4 + gethost.c tcsh.man2html configure.ac aclocal.m4 dot.login dot.tcshrc VHSRCS=${PVSRCS} ${AVSRCS} diff --git a/README.md b/README.md index 58a30738daa6..df6671b0316e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The Tcsh source code is available on GitHub as a read-only repo mirror at: -> http://github.com/tcsh-org/tcsh +> https://github.com/tcsh-org/tcsh Instructions for compiling Tcsh can be found in [BUILDING]. @@ -20,7 +20,10 @@ the tcsh mailing list: > https://mailman.astron.com/mailman/listinfo/tcsh [![Build Status][status]][travis] +[![Coverity Scan][badge]][coverity] [BUILDING]: BUILDING -[status]: https://travis-ci.org/tcsh-org/tcsh.svg?branch=master -[travis]: https://travis-ci.org/tcsh-org/tcsh +[badge]: https://scan.coverity.com/projects/20307/badge.svg +[coverity]: https://scan.coverity.com/projects/tcsh-org-tcsh +[status]: https://travis-ci.com/tcsh-org/tcsh.svg?branch=master +[travis]: https://travis-ci.com/tcsh-org/tcsh diff --git a/aclocal.m4 b/aclocal.m4 index 7a946ee1d832..b0ff2e853c42 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,8 +12,654 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -# iconv.m4 serial 19 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. +# host-cpu-c-abi.m4 serial 11 +dnl Copyright (C) 2002-2019 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible and Sam Steingold. + +dnl Sets the HOST_CPU variable to the canonical name of the CPU. +dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its +dnl C language ABI (application binary interface). +dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in +dnl config.h. +dnl +dnl This canonical name can be used to select a particular assembly language +dnl source file that will interoperate with C code on the given host. +dnl +dnl For example: +dnl * 'i386' and 'sparc' are different canonical names, because code for i386 +dnl will not run on SPARC CPUs and vice versa. They have different +dnl instruction sets. +dnl * 'sparc' and 'sparc64' are different canonical names, because code for +dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code +dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit +dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit +dnl mode, but not both. +dnl * 'mips' and 'mipsn32' are different canonical names, because they use +dnl different argument passing and return conventions for C functions, and +dnl although the instruction set of 'mips' is a large subset of the +dnl instruction set of 'mipsn32'. +dnl * 'mipsn32' and 'mips64' are different canonical names, because they use +dnl different sizes for the C types like 'int' and 'void *', and although +dnl the instruction sets of 'mipsn32' and 'mips64' are the same. +dnl * The same canonical name is used for different endiannesses. You can +dnl determine the endianness through preprocessor symbols: +dnl - 'arm': test __ARMEL__. +dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. +dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. +dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 +dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because +dnl - Instructions that do not exist on all of these CPUs (cmpxchg, +dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your +dnl assembly language source files use such instructions, you will +dnl need to make the distinction. +dnl - Speed of execution of the common instruction set is reasonable across +dnl the entire family of CPUs. If you have assembly language source files +dnl that are optimized for particular CPU types (like GNU gmp has), you +dnl will need to make the distinction. +dnl See . +AC_DEFUN([gl_HOST_CPU_C_ABI], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_C_ASM]) + AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], + [case "$host_cpu" in + +changequote(,)dnl + i[4567]86 ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=i386 + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=x86_64-x32], + [gl_cv_host_cpu_c_abi=x86_64])], + [gl_cv_host_cpu_c_abi=i386]) + ;; + +changequote(,)dnl + alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=alpha + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __aarch64__ + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=arm64-ilp32], + [gl_cv_host_cpu_c_abi=arm64])], + [# Don't distinguish little-endian and big-endian arm, since they + # don't require different machine code for simple operations and + # since the user can distinguish them through the preprocessor + # defines __ARMEL__ vs. __ARMEB__. + # But distinguish arm which passes floating-point arguments and + # return values in integer registers (r0, r1, ...) - this is + # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which + # passes them in float registers (s0, s1, ...) and double registers + # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer + # sets the preprocessor defines __ARM_PCS (for the first case) and + # __ARM_PCS_VFP (for the second case), but older GCC does not. + echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c + # Look for a reference to the register d0 in the .s file. + AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 + if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then + gl_cv_host_cpu_c_abi=armhf + else + gl_cv_host_cpu_c_abi=arm + fi + rm -f conftest* + ]) + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __LP64__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=hppa64], + [gl_cv_host_cpu_c_abi=hppa]) + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=ia64-ilp32], + [gl_cv_host_cpu_c_abi=ia64]) + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mips64], + [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIN32. + # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIO32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (_MIPS_SIM == _ABIN32) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mipsn32], + [gl_cv_host_cpu_c_abi=mips])]) + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + ]])], + [# On powerpc64, there are two ABIs on Linux: The AIX compatible + # one and the ELFv2 one. The latter defines _CALL_ELF=2. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _CALL_ELF && _CALL_ELF == 2 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=powerpc64-elfv2], + [gl_cv_host_cpu_c_abi=powerpc64]) + ], + [gl_cv_host_cpu_c_abi=powerpc]) + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi=powerpc + ;; + + riscv32 | riscv64 ) + # There are 2 architectures (with variants): rv32* and rv64*. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if __riscv_xlen == 64 + int ok; + #else + error fail + #endif + ]])], + [cpu=riscv64], + [cpu=riscv32]) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ + int ok; + #else *** 6540 LINES SKIPPED ***