This commit was generated by cvs2svn to compensate for changes in r131962,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Mark Peek 2004-07-11 02:17:56 +00:00
commit ed620727e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131963
67 changed files with 5010 additions and 1524 deletions

View File

@ -11,7 +11,12 @@
be able to get ftp it... :-)
_________________________________________________________________
1. Why is the meta key broken in tcsh-5.20 and up?
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
@ -40,7 +45,7 @@
printable meta characters for commands) setenv NOREBIND.
_________________________________________________________________
2. I ran 'dbxtool &' and 'shelltool &' from tcsh, and they end up in
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
@ -56,19 +61,19 @@
in your .dbxinit
_________________________________________________________________
3. I tried to compile tcsh and it cannot find <locale.h>?
4. I tried to compile tcsh and it cannot find <locale.h>?
Your system does not support NLS. Undefine NLS in config_f.h and it
should work fine.
_________________________________________________________________
4. Where can I get csh sources?
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.
_________________________________________________________________
5. I just made tcsh my login shell, and I cannot ftp any more?
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
@ -81,7 +86,7 @@
shells for your system, so that other people can ftp too :-)
_________________________________________________________________
6. I am using SunView? or OpenWindows? and editing is screwed up. In
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?
@ -93,32 +98,36 @@
1. Don't use suntools
2. Use shelltool instead of cmdtool.
3. Unset edit in tcsh.
6b. 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'
6c. 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.
The workaround for 6b and 6c is doing "unset edit." Using shelltool
instead of cmdtool doesn't fix 6c.
_________________________________________________________________
7. I rlogin to another machine, and then no matter what I tell 'stty'
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
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.
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?
Maybe you need to use 'rlogin -8' to tell rlogin to pass 8 bit
characters.
_________________________________________________________________
8. Where do I get the public domain directory library?
11. Where do I get the public domain directory library?
Anonymous ftp to prep.ai.mit.edu:/pub/gnu/dirent.tar.Z
_________________________________________________________________
9. I compiled tcsh using gcc, and when I start up it says: tcsh:
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
@ -130,13 +139,13 @@
3. Compile with cc.
_________________________________________________________________
10. I compiled tcsh with the SunOS? unbundled compiler and now things
13. I compiled tcsh with the SunOS unbundled compiler and now things
get echo'ed twice.
It is a bug in the unbundled optimizer. Lower the optimization level.
_________________________________________________________________
11. How can I use the arrow keys with hpterm?
14. 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
@ -151,7 +160,7 @@
if you are using termcap, replace "smkx" with "ks"...
_________________________________________________________________
12. On POSIX machines ^C and ^Z will do not work when tcsh is a login
15. On POSIX machines ^C and ^Z will do not work when tcsh is a login
shell?
Make sure that the interrupt character is set to ^C and suspend is set
@ -159,7 +168,7 @@
^C susp ^Z' will set them to ^C and ^Z respectively.
_________________________________________________________________
13. I am trying to compile tcsh and I am getting compile errors that
16. I am trying to compile tcsh and I am getting compile errors that
look like:
>sh.c:???: `STR???' undeclared, outside of functions [gcc]
@ -169,7 +178,7 @@
headers. Type 'make clean; make'
_________________________________________________________________
14. On the cray, sometimes the CR/LF mapping gets screwed up.
17. 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
@ -181,21 +190,21 @@
character'.
_________________________________________________________________
15. On AU/X, I made tcsh my startup shell, but the mac desktop is not
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.
This is another manifestation of item 5. Just add the pathname to tcsh
in /etc/shells and everything should work fine.
_________________________________________________________________
16. On machines that use YP (NIS) tilde expansion might end up in
19. 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.
You can fix that in tcsh by defining YPBUGS in config.h
_________________________________________________________________
17. Script on SGI 4.0.5 does not give us a tty, so we cannot have job
20. 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:
@ -204,18 +213,21 @@
% cat > /dev/tty
_________________________________________________________________
18. I start tcsh and it takes a couple of minutes to get the prompt.
21. 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
undefine REMOTEHOST and recompile or fix your DNS.
_________________________________________________________________
19. If you need help generating your .cshrc file, check out:
22. If you need help generating your .cshrc file, check out:
http://www.imada.ou.dk/~blackie/dotfile/
http://www.imada.sdu.dk/~blackie/dotfile/
or
http://www.dotfiles.com
_________________________________________________________________
20. On POSIX systems the kernel will send hup signals to all the
23. 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
@ -230,27 +242,57 @@
avoid that you can set stty -hupcl, but it is not recommended.
_________________________________________________________________
21. When I rsh the meta key stops working on the remote machine.
24. 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
off from a security point of view anyway.
_________________________________________________________________
22. Tcsh compiled under hp/ux-10.x does not pass resource limits
25. 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
systems. The only solution is to recompile.
_________________________________________________________________
23. Refreshing in command line editing can appear broken on some OS's
26. 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.
_________________________________________________________________
27. 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
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
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?
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.
_________________________________________________________________
Everything else is a bug :-(
Christos
@ -258,5 +300,5 @@
Home | RecentChanges | Preferences
Edit text of this page | View other revisions
Last edited April 27, 2001 13:43 (diff)
Last edited April 29, 2004 15:02 (diff)
Search: ____________________

View File

@ -1,3 +1,46 @@
36. V6.13.00 - 20040519
35. V6.12.03 - 20040322
34. turn on kanji and dspmbyte by default; add check for utf8 locales,
and turn parsing of that automatically based on $LANG.
33. Fix compilation issue under Windows/NT and charset incorrect patch
(Yoshiyuki Sakakibara)
32. completion additions (Tom Warzeka)
31. compilation fix (Martin Kraemer)
30. V6.12.02 - 20040221
29. Glob completion listing addition (Tom Warzeka)
28. BS2000 bs2cmd builtin. (Martin Kraemer)
27. Fix interrupt resetting code when /etc startup scripts have syntax errors
(Mark A. Grondona)
26. Clarification of kill-ring commands (Per Hedeland)
25. Debian completion additions (Martin Godisch)
24. Japanese character set fixes (Juehiro-san) from debian
23. NLS charset fixes; disabled since they only work with gnu gencat
(Martin Godisch)
22. Fix HPUX >= 11 resource (Jack Cummings)
21. Handle breaksw that jumps out of loops.
20. Revert #16. It causes worse problems.
19. Avoid using execl() because the last NULL does not always promoted to
a pointer because the function is variadic (Harti Brandt)
18. revert ignoreeof to the 6.11.00 behavior and document it (Martin Godisch)
17. do a case insensitive comparison for the multibyte vars (Martin Godisch)
16. don't sigsuspend() for an already exited job
15. glob all arguments in source (Martin Godisch)
14. various debian fixes (Martin Godisch)
13. setenv syntax check revert (Satoshi I. Nozawa)
12. EAGAIN typo (dan harkless)
11. filec compilation issue on hpux (beebe)
10. win32 compilation fixes for O_LARGEFILE (amol)
9. Don't go into an infinite loop when tcgetpgrp() returns an error.
8. Cygwin fixes (Corinna Vinschen)
7. NLS catclose() bug avoidance (KAJIMOTO Masato)
6. V6.12.01 - 20030208
5. Misc NT cleanup. No more GPL code (amol)
4. use strtol() to detect errors in builtin kill (Peter Jeremy)
3. Recognize linux systems on mips* (Maciej W. Rozycki)
2. Enable complete=igncase on unix (Stephen Krauth)
1. Eliminate maxitems (Todd Miller)
58. V6.12.00 - 20020732
57. misc cleanups.
56. V6.11.05 - 20020712
55. We should have socklen_t in the INET6 case, but we leave int otherwise.

View File

@ -1,5 +1,5 @@
XCOMM
XCOMM $Id: Imakefile,v 1.81 2002/07/23 16:18:31 christos Exp $
XCOMM $Id: Imakefile,v 1.83 2003/02/08 20:03:25 christos Exp $
XCOMM
XCOMM Imakefile for tcsh 6.12
XCOMM Marc Horowitz, MIT SIPB
@ -482,16 +482,18 @@ LDLIBS = MyLibs
SUF = o
VERSION = 6.12
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 sh.char.h sh.dir.h sh.proc.h sh.h \
sh.decls.h glob.c glob.h ${SYSSRCS}
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.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.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.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}
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
tw.comp.c tw.color.c

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 3.19 2002/07/23 16:13:21 christos Exp $
# $Id: Makefile.in,v 3.20 2003/03/12 19:14:50 christos Exp $
# Makefile.in 4.3 6/11/83
#
# C Shell with process control; VM/UNIX VAX Makefile
@ -9,7 +9,7 @@
#
SHELL=/bin/sh
VERSION=6.12
BUILD=tcsh
BUILD=tcsh$(EXEEXT)
VPATH=@srcdir@
srcdir=@srcdir@
@ -136,7 +136,7 @@ CFLAGS = @CFLAGS@ # This is set by autoconf.
#DFLAGS=
#DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
## The following is set by autoconf.
DFLAGS = -D_PATH_TCSHELL='"${DESTBIN}/tcsh"' @DFLAGS@ @CPPFLAGS@
DFLAGS = -D_PATH_TCSHELL='"${bindir}/tcsh"' @DFLAGS@ @CPPFLAGS@
################################################################
@ -284,6 +284,7 @@ DESTMAN=${DESTDIR}${mandir}/man${MANSECT}
# DESTMAN=${DESTDIR}/catman/man${MANSECT} # A/UX
# DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
# DESTMAN=/usr/catman/1l # Amiga unix (SysVR4)
EXEEXT=@EXEEXT@
FTPAREA=/usr/spool/ftp
ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
@ -340,9 +341,9 @@ OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
all: ${BUILD}
tcsh:$(P) ${OBJS}
rm -f tcsh core
${CC} -o tcsh ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
tcsh$(EXEEXT):$(P) ${OBJS}
rm -f tcsh$(EXEEXT) core
${CC} -o tcsh$(EXEEXT) ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
tcsh.sbin:$(P) ${OBJS}
rm -f tcsh.sbin core
@ -350,11 +351,11 @@ tcsh.sbin:$(P) ${OBJS}
# Purify
pure:$(P) ${OBJS}
rm -f tcsh core
purify `echo ${CC} | sed -e s,-B/bin/,,` -o tcsh ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
rm -f tcsh$(EXEEXT) core
purify `echo ${CC} | sed -e s,-B/bin/,,` -o tcsh$(EXEEXT) ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
# OS/2
tcsh.exe: tcsh
emxbind tcsh
#tcsh.exe: tcsh
# emxbind tcsh
gethost: gethost.c sh.err.h tc.const.h sh.h
rm -f gethost
@ -474,12 +475,12 @@ vgrind:
install-strip: install
install: tcsh
install: tcsh$(EXEEXT)
-mkdir -p ${DESTBIN}
-mv -f ${DESTBIN}/tcsh ${DESTBIN}/tcsh.old
cp tcsh ${DESTBIN}/tcsh
-strip ${DESTBIN}/tcsh
chmod 555 ${DESTBIN}/tcsh
-mv -f ${DESTBIN}/tcsh$(EXEEXT) ${DESTBIN}/tcsh.old
cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
-strip ${DESTBIN}/tcsh$(EXEEXT)
chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
install.man: tcsh.man
-mkdir -p ${DESTMAN}
@ -487,6 +488,19 @@ install.man: tcsh.man
cp $(srcdir)/tcsh.man ${DESTMAN}/tcsh.${MANSECT}
chmod 444 ${DESTMAN}/tcsh.${MANSECT}
install.cygwin: install install.man
-mkdir -p ${DESTDIR}${prefix}/doc/tcsh
cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/doc/tcsh
cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/doc/tcsh
cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/doc/tcsh
perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man
cp -rp tcsh.html ${DESTDIR}${prefix}/doc/tcsh
-mkdir -p ${DESTDIR}/etc/profile.d
-mkdir -p ${DESTDIR}/etc/postinstall
cp -p ${srcdir}/cygwin/etc/csh.* ${DESTDIR}/etc
cp -p ${srcdir}/cygwin/etc/profile.d/*.tcsh ${DESTDIR}/etc/profile.d
cp -p ${srcdir}/cygwin/etc/postinstall/tcsh.sh ${DESTDIR}/etc/postinstall
# Amiga Unix
#install.man: tcsh.man
# compress tcsh.man
@ -500,7 +514,7 @@ install.man: tcsh.man
# chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
clean:
${RM} -f a.out strings x.c xs.c tcsh tcsh.a _MAKE_LOG core gethost
${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG core gethost
${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
${RM} -f tcsh.*.m tcsh.*.cat

View File

@ -96,8 +96,8 @@ To install tcsh:
12) PLEASE send any bug reports (and fixes), code for new features,
comments, questions, etc. (even flames) to:
The tcsh mailing list
tcsh@mx.gw.com
The tcsh bugs mailing list
tcsh-bugs@mx.gw.com
Various:

View File

@ -4,15 +4,128 @@
Home | RecentChanges | Preferences
_________________________________________________________________
Surprised by this behavior...is this a bug?
(Goal: e.g. distinguish between completely numeric args/names and
those containing non-numerics)
% touch 1023 pex103 pex103a 104a z101 16a02 1999 2001 2001_A_Space_Odyssey
% ls -1 *[^0-9]*
104a
16a02
2001_A_Space_Odyssey
pex103
pex103a
z101
# (great, looks good to me. Got everything containing a nonnumeric, no more, n
o less.)
% foreach p ( 1023 pex103 pex103a 104a z101 16a02 1999 2001 2001_A_Space_Odyss
ey )
foreach? if ( $p !~ *[^0-9]* ) echo $p
foreach? end
# (no output. Huh?)
% foreach p ( 1023 pex103 pex103a 104a z101 16a02 1999 2001 2001_A_Space_Odyss
ey )
foreach? if ( $p =~ *[^0-9]* ) echo $p
foreach? end
1023 (!)
pex103
pex103a
104a
z101
16a02
1999 (!)
2001 (!)
2001_A_Space_Odyssey
# (Huh?)
The [MAN page description] for =~ and !~ just refer to "(see [Filename
substitution])', but evidently there is a (unexplained) difference.
The actual filename globbing looks correct to me, but the pattern
matching operator behavior is unexpected, if I'm not missing
something.
tcsh 6.09.00
- bhooglan
_________________________________________________________________
I'm a long-time faithful user of tcsh, and one thing has always bugged
me -- the need to type "rehash" at a prompt when adding a new command.
My suggestions is to change tcsh so before printing "Command not
found.", it first searches its entire path and rebuilds its hash
table. Only after doing this, and if the command is still not in the
path, then print "Command not found.". I realize there are some
extreme cases in which this is suboptimal, but in most cases with
normal users this would be a big win, and simplify the manual and
perhaps even the code.
_________________________________________________________________
Wish "tcsh -l" would accept other flags. At least "-c".
Currently I can't get ssh to have the right environment unless it is a
login shell. The .ssh/environment doesn't work for me because I login
to different machines with different environments. One thing to do
would be to not have the different environment for login compared to
other shells, but what I would really like is something like...
ssh remote_application_server "tcsh -l -c application"
The "ssh -t" doesn't work for me and I don't know why.
Thanks Tim
Fix limit vmemoryuse in Linux
In Linux tcsh is unable to limit vmemoryuse. This is because
RLIMIT_VMEM isn't defined, instead Linux has RLIMIT_AS which means the
same. On Google groups I found patches suggested by Komazaki at
http://groups.google.com/groups?hl=sv&lr=&ie=UTF-8&oe=ISO-2022-JP&selm
=m3snmczvfc.wl%40thinkpad.osk.3web.ne.jp.osk.3web.ne.jp and Ogawa
Hirofumi suggests a patch at
http://groups.google.com/groups?hl=sv&lr=&ie=UTF-8&selm=87snmba4id.fsf
%40devron.myhome.or.jp None of these patches seems to have been
included in version 6.12 as 6.12 still has this problem.
/Henrik??
New idea: use last line (or n'th line) of output as input to new
command.
I often find myself typing something like:
>locate lshort
/usr/local/stow/share/texmf/doc/latex/general/lshort.dvi . . .
/usr/local/store/share/texmf/doc/latex/general/lshort.dvi
>xdvi /usr/local/store/share/texmf/doc/latex/general/lshort.dvi
Now the way I accomplish writing the last line, is by moving the mouse
over the last line, and the copy paste it. It would be very nice, if
the shell could keep the last n lines of output in a buffer. This way
one could avoid using the mouse by typing something like:
>xdvi <M-1>
which would insert the last line of output, similarly <M-2> could
insert the second last line of output. (the exact commands used is of
course configured via bindkey).
This could save me a couple of times to the mouse everyday -
di010070@diku.dk
The shell does not capture any output from commands it runs, so
this is really more a feature for the terminal (be it hardware
or software). --Kim
Fix memory leak related to aliasrun(). Precmd, Cwdcmd etc. leak
memory.
_________________________________________________________________
Fix migrate -site $$... Seems to hang... (aix370)
_________________________________________________________________
Fix history in loops.
_________________________________________________________________
New idea: sed operations on variables.
@ -21,45 +134,187 @@
variable editing to understand string operations. So I would like to
be able to use:
> set a="this is a STRING"
> echo $a:[3-]
is is a STRING
> echo $a:[#]
16
> echo $a:[6-7]
is
> echo $a:[-2]
ng
> echo $a:[-20]
Subscript out of bounds.
> echo $a:[2-20]
Subscript out of bounds.
> echo $a:[1-1]:u$a:[2-].
This is a string.
_________________________________________________________________
> set a="this is a STRING"
> echo $a:[3-]
is is a STRING
> echo $a:[#]
16
> echo $a:[6-7]
is
> echo $a:[-2]
ng
> echo $a:[-20]
Subscript out of bounds.
> echo $a:[2-20]
Subscript out of bounds.
> echo $a:[1-1]:u$a:[2-].
This is a string.
</blockquote>
Fix pipelines that contain builtins so that they behave correctly.
I tried to fix that (most of the code is in sh.sem.c, but it works
only for non POSIX machines cause otherwise the setpgid() I added
fails).
_________________________________________________________________
Fix the correct code... How to do that involves A.I....
_________________________________________________________________
Rewrite the whole thing. It has taken to much beating over the
years...
_________________________________________________________________
Add another hook like precmd to be executed after the prompt but
before the command.
_________________________________________________________________
Add instructions for using configure in the README file.
Make manual page references links in the HTML version of the manual.
It is possible to match the words with ([0-9]) after them. Links could
be using the manual page CGI at http://www.tac.eu.org/cgi-bin/man-cgi
for content.
Add OpenBSD?? to the Makefile, etc.
A Csh compatability mode would be nice: I know tcsh is supposed to be
fully csh compatible, but csh scripts containing such constructs as
'$<' , 'if ( -d $file ) cd $file' or any of a great number of other
valid csh commands, will produce syntax errors or the like with tcsh,
which is frustrating when writing/maintaining csh scripts which have
to run on systems with only tcsh and systems with only csh. If such a
thing exists, I couldn't find it after searching the man page for two
hours, and it should be better documented
Add hooks for command completion Either for a dynamically loaded
library, or a callback to another program that allows another pass to
complete the command. As a trivial example, the module could duplicate
the functionality of aliases. A tcsh_mud.so could define sigh, groan,
cheer, lol, etc to produce output if they weren't actually valid
commands.
Properly deal with : in filename substitution
Given something like
blah.foo:*.foo
expand it properly to something like
blah.foo:baz.foo:bob.foo:bar.foo
It already does this, if you have a file named like that... --Kim
Directory commands don't handle blanks in filenames. If I have an
environment variable such as:
% setenv TOMCAT '/c/Program? Files/Apache? Software Foundation/Tomcat? 5.0'
and then do the following, setenv complains that it has too many arguments.
% cd /tmp
% cd "$TOMCAT"
setenv: Too many arguments
% dirs
/c/Program? Files/Apache? Software Foundation/Tomcat? 5.0 /tmp
% pushd "$TOMCAT"
/c/Program? Files/Apache? Software Foundation/Tomcat? 5.0
setenv: Too many arguments.
% pushd /tmp
/tmp /c/Program? Files/Apache? Software Foundation/Tomcat? 5.0
% pushd
/c/Program? Files/Apache? Software Foundation/Tomcat? 5.0 /tmp
setenv: Too many arguments.
Wish tcsh would feature fc (fix command) as in bash !Wish tcsh would
featuer fc (fix command) as in bash !
i wish for read-only CVS access to the sources (as i am on the
bleeding egde)
Functions would be useful! As would being able to redirect stderr (or
other file descriptors) independently of stdout! -- Rohan Talip
Don't complete commands with non-executable files. For example if I
have a file called README in a directory in the PATH, and I type R TAB
tcsh will complete README as a command. But README does not have the x
bit set, so it's kind of pointless to have that completion.
--> Setting the shell variable "recognize_only_executables" will give
you this behavior. --Waz
If I have in my .tcshrc: complete {cd,pushd} p/1/d/ and I type
"complete cd" at the shell prompt nothing is printed. It would be nice
if {cd,pushd} p/1/d/ was printed.
--> I had programmed this feature a while ago but have not submitted
it because the implementation is not robust enough to keep TCSH from
crashing when special characters are part of the pattern. I'll get
back to it at some point! --Waz
It would be nice if "set autolist" would be on by default.
---
Unicode (UTF-8) doesn't seem to work. It's not even possible to "make
catalogs" in unicode environment. Also unicode support (and other
multibyte encodings) should depend on environment variables
(LC_CTYPE), not on "set dspmbyte". On unicode terminal translations
show empty characters instead of messages.
In addition to message catalogs, there are more problems:
ipi:~/test/tcsh/bin> ls
tcsh åäö
ipi:~/test/tcsh/bin> set dspmbyte utf8
ipi:~/test/tcsh/bin> ls ???
ls: No match.
Unicode is used more and more, and is default on many environments, so
this really should be fixed. --mpaananen
_________________________________________________________________
When I have a script called from complete I would like to have the the
existing text from the command line passed to that script so that it
can look at all existing words to detemine what it should output as
the completion list.
For example:
complete prog 'n/-x/`myscript`'
Then when I do this:
> prog -a A -b B -x <TAB>
The script would get 'prog -a A -b B -x ' which would allow the script
to base its -x completions on the options given for -a and -b (or if
they aren't present give nothing - or a message saying that they are
required). Setting a temporary environment variable before executing
the command would also work and would probably be safer.
Perhaps this info is already available as a special variable that can
be manually passed to the script: complete prog 'n/-x/`myscript
$cmd_line`'?
Update: I looked into this further by actually downloading the code
and looking through it. It doesn't seem that this information is
available anywhere, but I did manage to achieve what I wanted by
adding the following two lines around the call to tw_complete (line
278, tw.parse.c 6.12.00):
added> tsetenv(STRCURRCMDLINE, (Char *)&qline);
looking = tw_complete(cmd_start, &wordp, &pat, looking, &suf);
added> Unsetenv(STRCURRCMDLINE);
And I added a definition for STRCURRCMDLINE to be "CURRCMDLINE".
This provides the environment variable CURRCMDLINE to any
script/program running under complete. The only issue I see is picking
a sufficiently obscure environment variable that noone else is likely
to use, but have it readable enough to understand what it is for. It
also shouldn't overwrite an existing ENV variable if it is already in
use.
_________________________________________________________________
Home | RecentChanges | Preferences
Edit text of this page | View other revisions
Last edited April 28, 2001 2:04 (diff)
Last edited March 25, 2004 10:27 (diff)
Search: ____________________

View File

@ -1,7 +1,23 @@
#
# $Id: complete.tcsh,v 1.40 2002/07/07 15:37:20 christos Exp $
# $Id: complete.tcsh,v 1.43 2004/02/22 15:57:15 christos Exp $
# example file using the new completion code
#
# Debian GNU/Linux
# /usr/share/doc/tcsh/examples/complete.gz
#
# This file may be read from user's ~/.cshrc or ~/.tcsh file by
# decompressing it into the home directory as ~/.complete and
# then adding the line "source ~/.complete" and maybe defining
# some of the shell variables described below.
#
# Added two Debian-specific completions: dpkg and dpkg-deb (who
# wrote them?). Changed completions of several commands. The ones
# are evaluated if the `traditional_complete' shell variable is
# defined.
#
# Debian enhancements by Vadim Vygonets <vadik@cs.huji.ac.il>.
# Bugfixes and apt completions by Miklos Quartus <miklos.quartus@nokia.com>.
# Cleanup by Martin A. Godisch <martin@godisch.de>.
onintr -
if (! $?prompt) goto end
@ -78,7 +94,11 @@ if ($?_complete) then
complete unalias n/*/a/
complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi
complete dvips n/*/f:*.dvi/
if ($?traditional_complete) then
complete tex n/*/f:*.tex/ # Only files that match *.tex
else
complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi
endif
complete latex n/*/f:*.{tex,ltx}/
complete su c/--/"(login fast preserve-environment command shell \
help version)"/ c/-/"(f l m p c s -)"/ \
@ -158,7 +178,20 @@ if ($?_complete) then
complete -co* p/0/"(compress)"/ # make compress completion
# not ambiguous
if ($?traditional_complete) then
complete zcat n/*/f:*.Z/
else
# "zcat" may be linked to "compress" or "gzip"
if (-X zcat) then
zcat --version >& /dev/null
if ($status != 0) then
complete zcat n/*/f:*.Z/
else
complete zcat c/--/"(force help license quiet version)"/ \
c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
endif
endif
endif
complete finger c/*@/\$hosts/ n/*/u/@
complete ping p/1/\$hosts/
@ -189,7 +222,7 @@ if ($?_complete) then
p/2/f:*.a/ p/*/f:*.o/
# these should be merged with the MH completion hacks below - jgotts
complete {sprev,snext} \
complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
c@+@F:$HOME/Mail/@
# these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
@ -213,6 +246,7 @@ if ($?_complete) then
# these from E. Jay Berkenbilt <ejb@ERA.COM>
# = isn't always followed by a filename or a path anymore - jgotts
if ($?traditional_complete) then
complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
bindir,sbindir,libexecdir,datadir,\
sysconfdir,sharedstatedir,localstatedir,\
@ -223,6 +257,19 @@ if ($?_complete) then
sharedstatedir localstatedir libdir \
includedir oldincludedir infodir mandir \
srcdir)//'
else
complete ./configure \
'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
'c/--cachefile=*/x:<filename>/' \
'c/--{enable,disable,with}-*/x:<feature>//' \
'c/--*=/x:<directory>//' \
'c/--/(prefix= exec-prefix= bindir= \
sbindir= libexecdir= datadir= sysconfdir= \
sharedstatedir= localstatedir= infodir= \
mandir= srcdir= x-includes= x-libraries= cachefile= \
enable- disable- with- \
help no-create quiet silent version verbose )//'
endif
complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
pbmraw pgm pgmraw ppm ppmraw bit)/' \
@ -544,11 +591,23 @@ if ($?_complete) then
n@*@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@
complete ndc 'n/*/(status dumpdb reload stats trace notrace \
querylog start stop restart )/'
if ($?traditional_complete) then
complete nm 'c/--/(debug-syms defined-only demangle dynamic \
extern-only format= help line-numbers no-demangle \
no-sort numeric-sort portability print-armap \
print-file-name reverse-sort size-sort undefined-only \
version)/' 'p/*/f:^*.{h,C,c,cc}/'
else
complete nm 'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
'c/--target=/x:<bfdname>/' \
'c/--format=/(bsd sysv posix)/n/' \
'c/--/(debugsyms extern-only demangle dynamic print-armap \
print-file-name numeric-sort no-sort reverse-sort \
size-sort undefined-only portability target= radix= \
format= defined-only\ line-numbers no-demangle version \
help)//' \
'n/*/f:^*.{h,c,cc,s,S}/'
endif
complete nmap 'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
complete perldoc 'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
complete postfix 'n/*/(start stop reload abort flush check)/'
@ -639,11 +698,7 @@ if ($?_complete) then
endif
complete unsetenv n/*/e/
if (-r /var/spool/mail) then
set _maildir = /var/spool/mail
else
set _maildir = /usr/mail
endif
set _maildir = /var/mail
if (-r $HOME/.mailrc) then
complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
@ -664,6 +719,7 @@ if ($?_complete) then
endif
endif
if ($?traditional_complete) then
# use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
# use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
complete man \
@ -686,6 +742,24 @@ if ($?_complete) then
'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
#n@*@c@ # old way -- commands only
else
complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
endif
complete ps c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
@ -709,14 +783,43 @@ if ($?_complete) then
N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
complete tcsh c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
complete rpm c/--/"(query verify nodeps nofiles nomd5 noscripts \
nogpg nopgp install upgrade freshen erase allmatches \
notriggers repackage test rebuild recompile initdb \
rebuilddb addsign resign querytags showrc setperms \
setugids all file group package querybynumber qf \
triggeredby whatprovides whatrequires changelog \
configfiles docfiles dump filesbypkg info last list \
provides queryformat requires scripts state triggers \
triggerscripts allfiles badreloc excludepath checksig \
excludedocs force hash ignoresize ignorearch ignoreos \
includedocs justdb noorder oldpackage percent prefix \
relocate replace-files replacepkgs buildroot clean \
nobuild rmsource rmspec short-circuit sign target \
help version quiet rcfile pipe dbpath root specfile)"/\
c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc \
ti tl ts a f g p c d l R s h ? v vv -)"/ \
n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/ \
n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
n/--what{provides,requires}/x:'<capability>'/ n/--root/d/ \
n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/ \
n/--excludepath/x:'<oldpath>'/ n/--prefix/x:'<newpath>'/ \
n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/ \
n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
# these conform to the latest GNU versions available at press time ...
# updates by John Gotts <jgotts@engin.umich.edu>
if (-X emacs) then
# TW note: if your version of GNU Emacs supports the "--version" option,
# uncomment this line and comment the next to automatically
# detect the version, else replace "21.2" with your version.
# detect the version, else set "_emacs_ver" to your version.
#set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
set _emacs_ver=21.2
set _emacs_ver=21.3
set _emacs_dir=`which emacs | sed s%/bin/emacs%%`
complete emacs c/--/"(batch terminal display no-windows no-init-file \
user debug-init unibyte multibyte version help \
@ -729,7 +832,6 @@ if ($?_complete) then
unset _emacs_ver _emacs_dir
endif
# if your "zcat" is the GNU version, change "gzcat" below to just "zcat"
complete gzcat c/--/"(force help license quiet version)"/ \
c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
complete gzip c/--/"(stdout to-stdout decompress uncompress \
@ -763,6 +865,11 @@ if ($?_complete) then
complete ztouch n/*/f:*.{gz,Z,z,zip,taz,tgz}/
complete zforce n/*/f:^*.{gz,tgz}/
complete dcop 'p/1/`$:0`/ /' \
'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
c/--/"(extended-regexp fixed-regexp basic-regexp \
regexp file ignore-case word-regexp line-regexp \
@ -864,6 +971,7 @@ if ($?_complete) then
n/{-m,--mode}/x:'<mode>'/ n/*/d/
complete rmdir c/--/"(ignore-fail-on-non-empty parents verbose help \
version)"/ c/-/"(p -)"/ n/*/d/
complete env 'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
complete tar c/-[Acru]*/"(b B C f F g G h i l L M N o P \
R S T v V w W X z Z)"/ \
@ -890,9 +998,13 @@ if ($?_complete) then
block-compress help version)"/ \
c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
C@[/dev]@f@ \
C@/dev@f@ \
n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
n/{-[Adrtux]*f,--file}/f:*.{tar,taz,tgz}/ \
n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
n/{-[Adrtux]*f,--file}/f:*.tar/ \
N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
N/{-x*f,--file}/'`tar -tf $:-1`'/ \
n/--use-compress-program/c/ \
n/{-b,--block-size}/x:'<block_size>'/ \
@ -961,8 +1073,112 @@ if ($?_complete) then
complete dvilj 'p/*/f:*.dvi/'
endif
# From Alphonse Bendt
complete ant \
'n/-f/f:*.xml/' \
'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
if ($?P4CLIENT && -X perl) then
# This is from Greg Allen.
set p4cmds=(add branch branches commands change changes client clients \
counter counters delete depot depots describe diff diff2 \
edit filelog files fix fixes fstat group groups have help \
info integrate integrated job jobs jobspec label labels \
labelsync lock obliterate opened passwd print protect rename \
reopen resolve resolved revert review reviews set submit \
sync triggers unlock user users verify where)
complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
*)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
endif
if (! $?traditional_complete) then
uncomplete vi
uncomplete vim
complete {vi,vim,gvim,nvi,elvis} n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
complete {ispell,spell,spellword} 'n@-d@`ls /usr/lib/ispell/*.aff | sed -e "s/\.aff//" `@' 'n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/'
complete elm 'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
complete ncftp 'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
complete bibtex 'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
complete dvi2tty n/*/f:*.dvi/ # Only files that match *.dvi
uncomplete gv
uncomplete ghostview
complete {gv,ghostview} 'n/*/f:*.{ps,eps,epsi}/'
complete enscript \
'c/--/(columns= pages= header= no-header truncate-lines \
line-numbers setpagedevice= escapes font= \
header-font= fancy-header no-job-header \
highlight-bars indent= filter= borders page-prefeed \
no-page-prefeed lineprinter lines-per-page= mail \
media= copies= newline= output= missing-characters \
printer= quiet silent landscape portrait \
baselineskip= statusdict= title= tabsize= underlay= \
verbose version encoding pass-through download-font= \
filter-stdin= help highlight-bar-gray= list-media \
list-options non-printable-format= page-label-format= \
printer-options= ul-angle= ul-font= ul-gray= \
ul-position= ul-style= \
)/'
endif
complete dpkg 'c/--{admindir,instdir,root}=/d/' \
'c/--debug=/n/' \
'c/--{admindir,debug,instdir,root}/(=)//' \
'c/--/(admindir= debug= instdir= root= \
assert-support-predepends assert-working-epoch \
audit auto-deconfigure clear-avail \
compare-versions configure contents control \
extract force-bad-path field \
force-configure-any force-conflicts \
force-depends force-depends-version force-help \
force-hold force-non-root \
force-overwrite-diverted \
force-remove-essential force-remove-reinstreq \
forget-old-unavail fsys-tarfile get-selections \
help ignore-depends info install largemem \
license list listfiles merge-avail no-act \
pending predep-package print-architecture \
print-gnu-build-architecture \
print-installation-architecture print-avail \
purge record-avail recursive refuse-downgrade \
remove search set-selections selected-only \
skip-same-version smallmem status unpack \
update-avail version vextract \
)//' \
'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
'n/*/f:*.deb'/
complete dpkg-deb 'c/--{build}=/d/' \
'c/--/(build contents info field control extract \
vextract fsys-tarfile help version \
license)//' \
'n/*/f:*.deb/'
complete apt-get 'c/--/(build config-file diff-only download-only \
fix-broken fix-missing force-yes help ignore-hold no-download \
no-upgrade option print-uris purge reinstall quiet simulate \
show-upgraded target-release tar-only version yes )/' \
'c/-/(b c= d f h m o= q qq s t x y )/' \
'n/{source,build-dep}/x:<pkgname>/' \
'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
'n/{install}/`apt-cache pkgnames | sort`/' \
'C/*/(update upgrade dselect-upgrade source \
build-dep check clean autoclean install remove)/'
complete apt-cache \
'c/--/(all-versions config-file generate full help important \
names-only option pkg-cache quiet recurse src-cache version )/' \
'c/-/(c= h i o= p= q s= v)/' \
'n/{search}/x:<regex>/' \
'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
search depends pkgnames dotty policy )/'
unset noglob
unset _complete
unset traditional_complete
endif
end:

View File

@ -125,6 +125,13 @@
#define BSD_STYLE_COLORLS
#endif
#if defined(__NetBSD__)
#include <sys/param.h>
#if __NetBSD_Version__ >= 106030000 /* NetBSD 1.6C */
#define HAVEUTMPX
#endif
#endif
#if defined(__bsdi__)
/*
* _PATH_TCSHELL if you've change the installation location (vix)

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/config_f.h,v 3.25 2002/03/08 17:36:45 christos Exp $ */
/* $Header: /src/pub/tcsh/config_f.h,v 3.26 2004/03/21 16:48:14 christos Exp $ */
/*
* config_f.h -- configure various defines for tcsh
*
@ -113,14 +113,14 @@
* be used with SHORT_STRINGS
*
*/
#undef KANJI
#define KANJI
/*
* DSPMBYTE add variable "dspmbyte" and display multi-byte string at
* only output, when "dspmbyte" is set. Should be used with
* KANJI
*/
#undef DSPMBYTE
#define DSPMBYTE
/*
* MBYTEDEBUG when "dspmbyte" is changed, set multi-byte checktable to

4667
contrib/tcsh/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -335,4 +335,6 @@ fi
AC_SUBST(HESDEF)
AC_SUBST(HESLIB)
AC_EXEEXT
AC_OUTPUT(Makefile)

View File

@ -2,7 +2,7 @@
;;
;; Version: 1.2
;; Date: April 2, 1999
;; Maintainer: Dan Harkless <dan@wave.eng.uci.edu>
;; Maintainer: Dan Harkless <software@harkless.org>
;;
;; Description:
;; csh and tcsh script editing mode for Emacs.
@ -19,7 +19,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Author key:
;; DH - Dan Harkless <dan@wave.eng.uci.edu>
;; DH - Dan Harkless <software@harkless.org>
;; CM - Carlo Migliorini <migliorini@sodalia.it>
;; JR - Jack Repenning <jackr@sgi.com>
;; GE - Gary Ellison <Gary.F.Ellison@att.com>

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/ed.refresh.c,v 3.29 2002/03/08 17:36:45 christos Exp $ */
/* $Header: /src/pub/tcsh/ed.refresh.c,v 3.30 2003/02/08 20:03:25 christos Exp $ */
/*
* ed.refresh.c: Lower level screen refreshing functions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: ed.refresh.c,v 3.29 2002/03/08 17:36:45 christos Exp $")
RCSID("$Id: ed.refresh.c,v 3.30 2003/02/08 20:03:25 christos Exp $")
#include "ed.h"
/* #define DEBUG_UPDATE */
@ -52,7 +52,12 @@ static void update_line __P((Char *, Char *, int));
static void str_insert __P((Char *, int, int, Char *, int));
static void str_delete __P((Char *, int, int, int));
static void str_cp __P((Char *, Char *, int));
static void PutPlusOne __P((int));
#ifndef WINNT_NATIVE
static
#else
extern
#endif
void PutPlusOne __P((int));
static void cpy_pad_spaces __P((Char *, Char *, int));
#if defined(DSPMBYTE)
static Char *update_line_fix_mbyte_point __P((Char *, Char *, int));
@ -272,7 +277,11 @@ RefreshPromptpart(buf)
* virtual image. The routine to re-draw a line can be replaced
* easily in hopes of a smarter one being placed there.
*/
static int OldvcV = 0;
#ifndef WINNT_NATIVE
static
#endif
int OldvcV = 0;
void
Refresh()
{
@ -1197,6 +1206,7 @@ RefCursor()
flush();
}
#ifndef WINTT_NATIVE
static void
PutPlusOne(c)
int c;
@ -1219,6 +1229,7 @@ PutPlusOne(c)
}
}
}
#endif
void
RefPlusOne()

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/ed.screen.c,v 3.49 2002/03/08 17:36:45 christos Exp $ */
/* $Header: /src/pub/tcsh/ed.screen.c,v 3.50 2003/02/08 20:03:25 christos Exp $ */
/*
* ed.screen.c: Editor/termcap-curses interface
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: ed.screen.c,v 3.49 2002/03/08 17:36:45 christos Exp $")
RCSID("$Id: ed.screen.c,v 3.50 2003/02/08 20:03:25 christos Exp $")
#include "ed.h"
#include "tc.h"
@ -1112,7 +1112,6 @@ MoveToLine(where) /* move to line <where> (first line == 0) */
del = where - CursorV;
#ifndef WINNT_NATIVE
if (del > 0) {
while (del > 0) {
if ((T_Margin & MARGIN_AUTO) && Display[CursorV][0] != '\0') {
@ -1144,9 +1143,6 @@ MoveToLine(where) /* move to line <where> (first line == 0) */
(void) tputs(Str(T_up), 1, PUTPURE);
}
}
#else /* WINNT_NATIVE */
NT_MoveToLineOrChar(del, 1);
#endif /* !WINNT_NATIVE */
CursorV = where; /* now where is here */
}
@ -1154,11 +1150,9 @@ void
MoveToChar(where) /* move to character position (where) */
int where;
{ /* as efficiently as possible */
#ifndef WINNT_NATIVE
int del;
mc_again:
#endif /* WINNT_NATIVE */
if (where == CursorH)
return;
@ -1176,7 +1170,6 @@ mc_again:
return;
}
#ifndef WINNT_NATIVE
del = where - CursorH;
if ((del < -4 || del > 4) && GoodStr(T_ch))
@ -1228,9 +1221,6 @@ mc_again:
}
}
}
#else /* WINNT_NATIVE */
NT_MoveToLineOrChar(where, 0);
#endif /* !WINNT_NATIVE */
CursorH = where; /* now where is here */
}
@ -1259,18 +1249,8 @@ so_write(cp, n)
xprintf("so: litnum %d, litptr %x\r\n",
*cp & CHAR, litptr[*cp & CHAR]);
#endif /* DEBUG_LITERAL */
#if defined(WINNT_NATIVE) && !defined(COLOR_LS_F)
{
char buf[256], *ptr = &buf[0];
for (d = litptr[*cp++ & CHAR]; *d & LITERAL; d++)
*ptr++ = (*d & CHAR);
flush();
set_cons_attr(buf);
}
#else /* !WINNT_NATIVE || COLOR_LS_F */
for (d = litptr[*cp++ & CHAR]; *d & LITERAL; d++)
(void) putraw(*d & CHAR);
#endif /* WINNT_NATIVE && !COLOR_LS_F */
(void) putraw(*d);
}
@ -1447,11 +1427,7 @@ SoundBeep()
/* what termcap says we should use */
(void) tputs(Str(T_bl), 1, PUTPURE);
else
#ifndef WINNT_NATIVE
(void) putraw(CTL_ESC('\007')); /* an ASCII bell; ^G */
#else /* WINNT_NATIVE */
MessageBeep(MB_ICONQUESTION);
#endif /* !WINNT_NATIVE */
}
void
@ -1653,9 +1629,6 @@ ChangeSize(lins, cols)
Val(T_co) = (cols < 2) ? 80 : cols;
Val(T_li) = (lins < 1) ? 24 : lins;
#ifdef WINNT_NATIVE
nt_set_size(lins,cols);
#endif /* WINNT_NATIVE */
#ifdef KNOWsize
/*
* We want to affect the environment only when we have a valid

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/ed.term.c,v 1.28 2002/07/06 22:28:13 christos Exp $ */
/* $Header: /src/pub/tcsh/ed.term.c,v 1.29 2003/05/26 07:11:06 christos Exp $ */
/*
* ed.term.c: Low level terminal interface
*/
@ -33,7 +33,7 @@
#include "sh.h"
#ifndef WINNT_NATIVE
RCSID("$Id: ed.term.c,v 1.28 2002/07/06 22:28:13 christos Exp $")
RCSID("$Id: ed.term.c,v 1.29 2003/05/26 07:11:06 christos Exp $")
#include "ed.h"
@ -553,7 +553,7 @@ static struct tcshmodes {
#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
# define OKERROR(e) (((e) == EAGAIN) || ((e) == EWOULDBLOCK) || ((e) == EINTR))
#elif defined(EGAIN)
#elif defined(EAGAIN)
# define OKERROR(e) (((e) == EAGAIN) || ((e) == EINTR))
#elif defined(EWOULDBLOCK)
# define OKERROR(e) (((e) == EWOULDBLOCK) || ((e) == EINTR))

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/gethost.c,v 1.8 2002/03/08 17:36:46 christos Exp $ */
/* $Header: /src/pub/tcsh/gethost.c,v 1.9 2002/12/04 12:30:55 christos Exp $ */
/*
* gethost.c: Create version file from prototype
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: gethost.c,v 1.8 2002/03/08 17:36:46 christos Exp $")
RCSID("$Id: gethost.c,v 1.9 2002/12/04 12:30:55 christos Exp $")
#ifdef SCO
# define perror __perror
@ -159,7 +159,7 @@ main(argc, argv)
{
char line[INBUFSIZE];
char *pname;
char *fname = "stdin";
const char *fname = "stdin";
char *ptr, *tok;
char defs[INBUFSIZE];
char stmt[INBUFSIZE];

View File

@ -146,8 +146,8 @@ static void qprintf __P((Char *));
#endif
int
globcharcoll(c1, c2)
int c1, c2;
globcharcoll(c1, c2, cs)
int c1, c2, cs;
{
#if defined(NLS) && defined(LC_COLLATE) && !defined(NOSTRCOLL)
char s1[2], s2[2];
@ -158,8 +158,13 @@ globcharcoll(c1, c2)
* From kevin lyda <kevin@suberic.net>:
* strcoll does not guarantee case sorting, so we pre-process now:
*/
if (islower(c1) && isupper(c2))
return (1);
if (cs) {
c1 = islower(c1) ? c1 : tolower(c1);
c2 = islower(c2) ? c2 : tolower(c2);
} else {
if (islower(c1) && isupper(c2))
return (1);
}
s1[0] = c1;
s2[0] = c2;
s1[1] = s2[1] = '\0';
@ -701,8 +706,8 @@ match(name, pat, patend, m_not)
++pat;
while (((c = *pat++) & M_MASK) != M_END) {
if ((*pat & M_MASK) == M_RNG) {
if (globcharcoll(CHAR(c), CHAR(k)) <= 0 &&
globcharcoll(CHAR(k), CHAR(pat[1])) <= 0)
if (globcharcoll(CHAR(c), CHAR(k), 0) <= 0 &&
globcharcoll(CHAR(k), CHAR(pat[1]), 0) <= 0)
ok = 1;
pat += 2;
}

View File

@ -86,6 +86,6 @@ typedef struct {
int glob __P((const char *, int, int (*)(const char *, int), glob_t *));
void globfree __P((glob_t *));
int globcharcoll __P((int, int));
int globcharcoll __P((int, int, int));
#endif /* !_GLOB_H_ */

View File

@ -1,5 +1,5 @@
newcode :
/* $Header: /src/pub/tcsh/host.defs,v 1.35 2002/07/23 16:13:21 christos Exp $ */
/* $Header: /src/pub/tcsh/host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $ */
/*
* host.defs: Hosttype/Machtype etc.
*/
@ -33,12 +33,14 @@ newcode :
*/
#include "sh.h"
RCSID("$Id: host.defs,v 1.35 2002/07/23 16:13:21 christos Exp $")
RCSID("$Id: host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $")
endcode :
macro : M_mipsel : (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
macro : M_mipseb : (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
macro : M_mips64el : (defined(mips64) || defined(__mips64)) && (defined(MIPSEL) || defined(__MIPSEL))
macro : M_mips64eb : (defined(mips64) || defined(__mips64)) && (defined(MIPSEB) || defined(__MIPSEB))
macro : M_mipsel : (!defined(M_mips64el)) && (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
macro : M_mipseb : (!defined(M_mips64eb)) && (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
macro : M_i386 : (defined(i386) || defined(__i386__))
macro : M_i486 : (defined(i486) || defined(__i486__))
macro : M_i586 : (defined(i586) || defined(__i586__))
@ -450,6 +452,10 @@ hosttype: defined(__alpha) : "alpha"
hosttype: defined(PPC) : "powerpc"
machtype: defined(__alpha) : "alpha"
machtype: defined(PPC) : "powerpc"
machtype: defined(M_mipsel) : "mipsel"
machtype: defined(M_mipseb) : "mipseb"
machtype: defined(M_mips64el) : "mips64el"
machtype: defined(M_mips64eb) : "mips64eb"
enddef :

View File

@ -82,7 +82,7 @@
**********************************************************************
*/
#include "sh.h"
RCSID("$Id: ma.setp.c,v 1.12 1996/04/26 19:18:36 christos Exp $")
RCSID("$Id: ma.setp.c,v 1.13 2003/05/26 07:11:06 christos Exp $")
#ifdef MACH
@ -442,8 +442,8 @@ char *inpath, *path;
if (n >= 0)
insert(pe, n, path);
else
xprintf(CGETS(10, 4, "setpath: %s not found in %s\n",
inpath, pe->pname));
xprintf(CGETS(10, 4, "setpath: %s not found in %s\n"),
inpath, pe->pname);
}
}

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.4 2001/01/04 17:51:38 christos Exp $
$ $Id: set17,v 1.5 2003/02/08 20:03:26 christos Exp $
$ sh.proc.c
$set 17
1 BUG: waiting for background job!\n
@ -14,3 +14,4 @@ $set 17
11 (wd now:
12 %S: Already suspended\n
13 %S: Already stopped\n
14 %S: Badly formed number\n

View File

@ -1,7 +1,8 @@
SUBDIRS= C et finnish french german greek italian ja pl russian \
spanish ukrainian
#GENCAT= gencat -new
#GENCAT= gencat --new
#CHARSET= charset
GENCAT= gencat
catalogs:
@ -9,7 +10,7 @@ catalogs:
do \
echo "$$i"; \
cd $$i; \
cat set[0-9] set[0-9][0-9] > ../../tcsh.$$i.m; \
cat ${CHARSET} set[0-9] set[0-9][0-9] > ../../tcsh.$$i.m; \
cd ..; \
${GENCAT} ../tcsh.$$i.cat ../tcsh.$$i.m; \
done

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 2001/01/04 18:46:03 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:26 christos Exp $
$ sh.proc.c
$set 17
1 BUG: ootan taustatöö järel!\n
@ -14,3 +14,4 @@ $set 17
11 (töökataloog nüüd:
12 %S: Juba peatatud\n
13 %S: Juba seisatud\n
14 %S: Badly formed number\n

View File

@ -1,6 +1,6 @@
$ $Id: set14,v 1.1 2000/01/14 22:57:32 christos Exp $
$ $Id: set14,v 1.2 2003/05/26 07:11:07 christos Exp $
$ sh.file.c
$set 14
1 \nAuts!! Liian monta %s!!\n
3 nimeä käyttäjätietokannassa
2 nimeä käyttäjätietokannassa
3 tiedostoa

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 2000/01/14 22:57:32 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:27 christos Exp $
$ sh.proc.c
$set 17
1 VIKA: taustatyötä!\n
@ -14,3 +14,4 @@ $set 17
11 hakemisto nyt:
12 %S: On jo keskeytetty\n
13 %S: On jo pysäytetty\n
14 %S: Badly formed number\n

View File

@ -1,9 +1,9 @@
$ $Id: set11,v 1.1 1995/04/25 14:04:35 christos Exp $
$ $Id: set11,v 1.2 2003/05/26 07:11:07 christos Exp $
$ sh.c
$set 11
1 Attention: pas d'accès au tty (%s).\n
2 Ainsi pas de contrôle de job dans ce shell.\n
3 Vous avez%d messages courrier (mail).\n
3 Vous avez %d messages courrier (mail).\n
4 Vous avez %d messages courrier (mail) dans %s.\n
5 Vous avez du %scourrier.\n
6 nouveau

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.2 1996/10/19 17:52:38 christos Exp $
$ $Id: set17,v 1.3 2003/02/08 20:03:27 christos Exp $
$ sh.proc.c
$set 17
1 BUG: attente de travail en tâche de fond !\n
@ -14,3 +14,4 @@ $set 17
11 wd maintenant:
12 %S: Déjà suspendu\n
13 %S: Déjà arrêté\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.3 1996/10/19 17:52:51 christos Exp $
$ $Id: set17,v 1.4 2003/02/08 20:03:27 christos Exp $
$ sh.proc.c
$set 17
1 FEHLER: Warte auf Hintergrund-Job!\n
@ -14,3 +14,4 @@ $set 17
11 (Verz jetzt:
12 %S: Bereits angehalten\n
13 %S: Bereits angehalten\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 1996/04/26 19:24:22 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:27 christos Exp $
$ sh.proc.c
$set 17
1 BUG: wait γιά εργασία που τρέχει στο παρασκήνιο!\n
@ -14,3 +14,4 @@ $set 17
11 τωρινο wd:
12 %S: έχει ήδη αναβληθεί\n
13 %S: έχει ήδη σταματήσει\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 1998/09/03 22:03:20 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:27 christos Exp $
$ sh.proc.c
$set 17
1 BACO: sto aspettando un lavoro in background!\n
@ -14,3 +14,4 @@ $set 17
11 directory di lavoro corrente:
12 %S: già sospeso\n
13 %S: già fermato\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 1998/09/03 22:04:08 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:28 christos Exp $
$ sh.proc.c
$set 17
1 障害: バッググラウンドジョブを待っています\n
@ -13,3 +13,4 @@ $set 17
10 \040(wd:
12 %S: すでに中断しています\n
13 %S: すでに停止しています\n
14 %S: Badly formed number\n

View File

@ -14,3 +14,4 @@ $set 17
11 (KR jest:
12 %S: Już jest zawieszony\n
13 %S: Już jest zatrzymany\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.2 2002/03/08 17:46:50 christos Exp $
$ $Id: set17,v 1.3 2003/02/08 20:03:28 christos Exp $
$ sh.proc.c
$set 17
1 BUG: waiting for background job!\n
@ -14,3 +14,4 @@ $set 17
11 wd now:
12 %S: õÖÅ ÏÔÌÏÖÅÎÏ\n
13 %S: õÖÅ ÏÓÔÁÎÏ×ÌÅÎÏ\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set30,v 1.2 2002/03/08 17:46:50 christos Exp $
$ $Id: set30,v 1.3 2003/05/26 07:11:07 christos Exp $
$ tw.parse.c
$set 30
1 starting_a_command %d\n
@ -13,5 +13,4 @@ $set 30
10 ÎÅ ËÁÔÁÌÏÇ
11 ÎÅ ÎÁÊÄÅÎÏ
12 ÎÅÞÉÔÁÅÍÏ
12 ÎÅÞÉÔÁÅÍÏ
13 yY

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.1 1998/04/08 17:59:57 christos Exp $
$ $Id: set17,v 1.2 2003/02/08 20:03:28 christos Exp $
$ sh.proc.c
$set 17
1 BUG: ¡en espera de un trabajo en segundo plano!\n
@ -14,3 +14,4 @@ $set 17
11 dt actual:
12 %S: Ya ha sido suspendido\n
13 %S: Ya ha sido parado\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
$ $Id: set17,v 1.2 2002/07/01 20:50:22 christos Exp $
$ $Id: set17,v 1.3 2003/02/08 20:03:28 christos Exp $
$ sh.proc.c
$set 17
1 ПОМИЛКА: оч╕кування фоново╖ задач╕!\n
@ -14,3 +14,4 @@ $set 17
11 wd тепер:
12 %S: вже п╕дв╕шено\n
13 %S: вже призупинено\n
14 %S: Badly formed number\n

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/patchlevel.h,v 3.135 2002/07/23 16:13:22 christos Exp $ */
/* $Header: /src/pub/tcsh/patchlevel.h,v 3.139 2004/05/19 17:13:20 kim Exp $ */
/*
* patchlevel.h: Our life story.
*/
@ -7,8 +7,8 @@
#define ORIGIN "Astron"
#define REV 6
#define VERS 12
#define VERS 13
#define PATCHLEVEL 00
#define DATE "2002-07-23"
#define DATE "2004-05-19"
#endif /* _h_patchlevel */

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.c,v 3.105 2002/07/05 16:28:16 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.c,v 3.109 2004/02/21 20:34:24 christos Exp $ */
/*
* sh.c: Main shell routines
*/
@ -39,7 +39,7 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
RCSID("$Id: sh.c,v 3.105 2002/07/05 16:28:16 christos Exp $")
RCSID("$Id: sh.c,v 3.109 2004/02/21 20:34:24 christos Exp $")
#include "tc.h"
#include "ed.h"
@ -189,6 +189,8 @@ main(argc, argv)
register char *tcp, *ttyn;
register int f;
register char **tempv;
int osetintr;
signalfun_t oparintr;
#ifdef BSDSIGS
sigvec_t osv;
@ -211,7 +213,8 @@ main(argc, argv)
#ifdef MALLOC_TRACE
mal_setstatsfile(fdopen(dup2(open("/tmp/tcsh.trace",
O_WRONLY|O_CREAT, 0666), 25), "w"));
O_WRONLY|O_CREAT|O_LARGEFILE, 0666), 25),
"w"));
mal_trace(1);
#endif /* MALLOC_TRACE */
@ -238,13 +241,17 @@ main(argc, argv)
*/
{
do
if ((f = open(_PATH_DEVNULL, O_RDONLY)) == -1 &&
(f = open("/", O_RDONLY)) == -1)
if ((f = open(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE)) == -1 &&
(f = open("/", O_RDONLY|O_LARGEFILE)) == -1)
exit(1);
while (f < 3);
(void) close(f);
}
#ifdef O_TEXT
setmode(0, O_TEXT);
#endif
osinit(); /* Os dependent initialization */
@ -395,7 +402,7 @@ main(argc, argv)
if (loginsh && isatty(SHIN)) {
ttyn = (char *) ttyname(SHIN);
(void) close(SHIN);
SHIN = open(ttyn, O_RDWR);
SHIN = open(ttyn, O_RDWR|O_LARGEFILE);
shpgrp = getpid();
(void) ioctl (SHIN, TIOCSPGRP, (ioctl_t) &shpgrp);
(void) setpgid(0, shpgrp);
@ -969,12 +976,15 @@ main(argc, argv)
* read commands.
*/
if (nofile == 0 && argc > 0) {
nofile = open(tempv[0], O_RDONLY);
nofile = open(tempv[0], O_RDONLY|O_LARGEFILE);
if (nofile < 0) {
child = 1; /* So this ... */
/* ... doesn't return */
stderror(ERR_SYSTEM, tempv[0], strerror(errno));
}
#ifdef O_TEXT
setmode(nofile, O_TEXT);
#endif
if (ffile != NULL)
xfree((ptr_t) ffile);
dolzero = 1;
@ -1252,15 +1262,14 @@ main(argc, argv)
* Set an exit here in case of an interrupt or error reading the shell
* start-up scripts.
*/
osetintr = setintr;
oparintr = parintr;
reenter = setexit(); /* PWP */
exitset++;
haderr = 0; /* In case second time through */
if (!fast && reenter == 0) {
/* Will have varval(STRhome) here because set fast if don't */
{
int osetintr = setintr;
signalfun_t oparintr = parintr;
#ifdef BSDSIGS
sigmask_t omask = sigblock(sigmask(SIGINT));
#else
@ -1316,6 +1325,10 @@ main(argc, argv)
if (!fast && (loginsh || rdirs))
loaddirs(NULL);
}
/* Reset interrupt flag */
setintr = osetintr;
parintr = oparintr;
/* Initing AFTER .cshrc is the Right Way */
if (intty && !arginp) { /* PWP setup stuff */
ed_Init(); /* init the new line editor */
@ -1462,8 +1475,11 @@ srcfile(f, onlyown, flag, av)
{
register int unit;
if ((unit = open(f, O_RDONLY)) == -1)
if ((unit = open(f, O_RDONLY|O_LARGEFILE)) == -1)
return 0;
#ifdef O_TEXT
setmode(unit, O_TEXT);
#endif
unit = dmove(unit, -1);
(void) close_on_exec(unit, 1);
@ -2202,6 +2218,15 @@ dosource(t, c)
f = globone(*t++, G_ERROR);
(void) strcpy(buf, short2str(f));
xfree((ptr_t) f);
gflag = 0, tglob(t);
if (gflag) {
t = globall(t);
if (t == 0)
stderror(ERR_NAME | ERR_NOMATCH);
} else {
t = saveblk(t);
trim(t);
}
if ((!srcfile(buf, 0, hflg, t)) && (!hflg) && (!bequiet))
stderror(ERR_SYSTEM, buf, strerror(errno));
}

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.decls.h,v 3.38 2002/05/16 13:51:25 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.decls.h,v 3.39 2004/03/21 16:48:14 christos Exp $ */
/*
* sh.decls.h External declarations from sh*.c
*/
@ -179,6 +179,7 @@ extern void trim __P((Char **));
extern int sortscmp __P((Char **, Char **));
#endif
extern void nlsinit __P((void));
extern int t_pmatch __P((Char *, Char *, Char **, int));
/*
* sh.hist.c

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.dir.c,v 3.60 2002/07/08 21:03:04 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $ */
/*
* sh.dir.c: Directory manipulation functions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.dir.c,v 3.60 2002/07/08 21:03:04 christos Exp $")
RCSID("$Id: sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $")
/*
* C Shell - directory management
@ -264,7 +264,7 @@ printdirs(dflag)
}
if (user)
xprintf("~%S", user);
xprintf("%S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
xprintf("\045S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
} while ((dp = dp->di_prev) != dcwd);
if (!(dflag & DIR_VERT))
xputchar('\n');
@ -276,7 +276,7 @@ dtildepr(dir)
{
Char* user;
if ((user = getusername(&dir)) != NULL)
xprintf("~%S%S", user, dir);
xprintf("~\045S%S", user, dir);
else
xprintf("%S", dir);
}
@ -529,8 +529,13 @@ dgoto(cp)
else
dp = cp;
#ifdef WINNT_NATIVE
#if defined(WINNT_NATIVE)
cp = SAVE(getcwd(NULL, 0));
#elif defined(__CYGWIN__)
if (ABSOLUTEP(cp) && cp[1] == ':') /* Only DOS paths are treated that way */
cp = SAVE(getcwd(NULL, 0));
else
cp = dcanon(cp, dp);
#else /* !WINNT_NATIVE */
cp = dcanon(cp, dp);
#endif /* WINNT_NATIVE */
@ -928,7 +933,7 @@ dcanon(cp, p)
#ifdef S_IFLNK /* if we have symlinks */
if (sp != cp && /* symlinks != SYM_IGNORE && */
(cc = readlink(short2str(cp), tlink,
sizeof tlink)) >= 0) {
sizeof(tlink) - 1)) >= 0) {
tlink[cc] = '\0';
(void) Strncpy(link, str2short(tlink),
sizeof(link) / sizeof(Char));
@ -1019,7 +1024,7 @@ dcanon(cp, p)
#ifdef S_IFLNK /* if we have symlinks */
if (sp != cp && symlinks == SYM_CHASE &&
(cc = readlink(short2str(cp), tlink,
sizeof tlink)) >= 0) {
sizeof(tlink) - 1)) >= 0) {
tlink[cc] = '\0';
(void) Strncpy(link, str2short(tlink),
sizeof(link) / sizeof(Char));

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.dol.c,v 3.50 2002/06/25 19:02:11 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.dol.c,v 3.52 2003/03/12 19:14:51 christos Exp $ */
/*
* sh.dol.c: Variable substitutions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.dol.c,v 3.50 2002/06/25 19:02:11 christos Exp $")
RCSID("$Id: sh.dol.c,v 3.52 2003/03/12 19:14:51 christos Exp $")
/*
* C shell
@ -1037,7 +1037,7 @@ again:
#ifndef O_EXCL
# define O_EXCL 0
#endif
if (open(tmp, O_RDWR|O_CREAT|O_EXCL|O_TEMPORARY, 0600) == -1) {
if (open(tmp, O_RDWR|O_CREAT|O_EXCL|O_TEMPORARY|O_LARGEFILE, 0600) == -1) {
int oerrno = errno;
#ifndef WINNT_NATIVE
if (errno == EEXIST) {
@ -1066,6 +1066,12 @@ again:
#ifdef WINNT_NATIVE
__dup_stdin = 1;
#endif /* WINNT_NATIVE */
#ifdef O_TEXT
setmode(1, O_TEXT);
#endif
#ifdef O_BINARY
setmode(0, O_BINARY);
#endif
for (;;) {
/*
* Read up a line

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.exec.c,v 3.56 2002/06/25 19:02:11 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.exec.c,v 3.58 2003/03/12 19:14:51 christos Exp $ */
/*
* sh.exec.c: Search, find, and execute a command!
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.exec.c,v 3.56 2002/06/25 19:02:11 christos Exp $")
RCSID("$Id: sh.exec.c,v 3.58 2003/03/12 19:14:51 christos Exp $")
#include "tc.h"
#include "tw.h"
@ -438,8 +438,11 @@ texec(sf, st)
* From: casper@fwi.uva.nl (Casper H.S. Dik) If we could not execute
* it, don't feed it to the shell if it looks like a binary!
*/
if ((fd = open(f, O_RDONLY)) != -1) {
if ((fd = open(f, O_RDONLY|O_LARGEFILE)) != -1) {
int nread;
#ifdef O_TEXT
setmode(fd, O_TEXT);
#endif
if ((nread = read(fd, (char *) pref, 2)) == 2) {
if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t')) {
(void) close(fd);
@ -763,10 +766,15 @@ dohash(vv, c)
*/
{
size_t ext = strlen(dp->d_name) - 4;
if ((ext > 0) && (strcmp(&dp->d_name[ext], ".exe") == 0 ||
strcmp(&dp->d_name[ext], ".bat") == 0 ||
strcmp(&dp->d_name[ext], ".com") == 0))
dp->d_name[ext] = '\0';
if ((ext > 0) && (strcasecmp(&dp->d_name[ext], ".exe") == 0 ||
strcasecmp(&dp->d_name[ext], ".bat") == 0 ||
strcasecmp(&dp->d_name[ext], ".com") == 0))
{
dp->d_name[ext] = '\0';
#if defined(__CYGWIN__)
strlwr(dp->d_name);
#endif /* __CYGWIN__ */
}
}
#endif /* _UWIN || __CYGWIN__ */
# ifdef FASTHASH

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.file.c,v 3.22 2002/07/01 20:53:00 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $ */
/*
* sh.file.c: File completion for csh. This file is not used in tcsh.
*/
@ -33,7 +33,7 @@
#include "sh.h"
#include "ed.h"
RCSID("$Id: sh.file.c,v 3.22 2002/07/01 20:53:00 christos Exp $")
RCSID("$Id: sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $")
#if defined(FILEC) && defined(TIOCSTI)
@ -72,7 +72,7 @@ static void beep __P((void));
static void print_recognized_stuff __P((Char *));
static void extract_dir_and_name __P((Char *, Char *, Char *));
static Char *getitem __P((DIR *, int));
static void free_items __P((Char **));
static void free_items __P((Char **, size_t));
static int tsearch __P((Char *, COMMAND, int));
static int compare __P((const ptr_t, const ptr_t));
static int recognize __P((Char *, Char *, int, int));
@ -544,30 +544,29 @@ getitem(dir_fd, looking_for_lognames)
}
static void
free_items(items)
free_items(items, numitems)
Char **items;
size_t numitems;
{
int i;
size_t i;
for (i = 0; items[i]; i++)
for (i = 0; i < numitems; i++)
xfree((ptr_t) items[i]);
xfree((ptr_t) items);
}
#ifdef BSDSIGS
# define FREE_ITEMS(items) { \
# define FREE_ITEMS(items, numitems) { \
sigmask_t omask;\
\
omask = sigblock(sigmask(SIGINT));\
free_items(items);\
items = NULL;\
free_items(items, numitems);\
(void) sigsetmask(omask);\
}
#else
# define FREE_ITEMS(items) { \
# define FREE_ITEMS(items, numitems) { \
(void) sighold(SIGINT);\
free_items(items);\
items = NULL;\
free_items(items, numitems);\
(void) sigrelse(SIGINT);\
}
#endif /* BSDSIGS */
@ -581,18 +580,14 @@ tsearch(word, command, max_word_length)
int max_word_length;
COMMAND command;
{
static Char **items = NULL;
DIR *dir_fd;
int numitems = 0, ignoring = TRUE, nignored = 0;
int name_length, looking_for_lognames;
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
Char *item;
#define MAXITEMS 1024
if (items != NULL)
FREE_ITEMS(items);
Char **items = NULL;
size_t maxitems = 0;
looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
if (looking_for_lognames) {
@ -622,25 +617,14 @@ again: /* search for matches */
!looking_for_lognames)
continue;
if (command == LIST) {
if (numitems >= MAXITEMS) {
xprintf(CGETS(14, 1, "\nYikes!! Too many %s!!\n"),
looking_for_lognames ?
CGETS(14, 2, "names in password file") :
CGETS(14, 3, "files"));
break;
if (numitems >= maxitems) {
maxitems += 1024;
if (items == NULL)
items = (Char **) xmalloc(sizeof(*items) * maxitems);
else
items = (Char **) xrealloc((ptr_t) items,
sizeof(*items) * maxitems);
}
/*
* From Beto Appleton (beto@aixwiz.austin.ibm.com)
* typing "./control-d" will cause the csh to core-dump.
* the problem can be reproduce as following:
* 1. set ignoreeof
* 2. set filec
* 3. create a directory with 1050 files
* 4. typing "./control-d" will cause the csh to core-dump
* Solution: Add + 1 to MAXITEMS
*/
if (items == NULL)
items = (Char **) xcalloc(sizeof(items[0]), MAXITEMS + 1);
items[numitems] = (Char *) xmalloc((size_t) (Strlen(item) + 1) *
sizeof(Char));
copyn(items[numitems], item, MAXNAMLEN);
@ -690,7 +674,7 @@ again: /* search for matches */
print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems);
if (items != NULL)
FREE_ITEMS(items);
FREE_ITEMS(items, numitems);
}
return (0);
}

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.func.c,v 3.103 2002/07/09 12:56:55 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.func.c,v 3.111 2004/05/13 15:23:39 christos Exp $ */
/*
* sh.func.c: csh builtin functions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.func.c,v 3.103 2002/07/09 12:56:55 christos Exp $")
RCSID("$Id: sh.func.c,v 3.111 2004/05/13 15:23:39 christos Exp $")
#include "ed.h"
#include "tw.h"
@ -63,6 +63,7 @@ static int getword __P((Char *));
static void toend __P((void));
static void xecho __P((int, Char **));
static bool islocale_var __P((Char *));
static void wpfree __P((struct whyle *));
struct biltins *
isbfunc(t)
@ -342,15 +343,18 @@ dologin(v, c)
Char **v;
struct command *c;
{
USE(c);
#ifdef WINNT_NATIVE
USE(c);
USE(v);
#else /* !WINNT_NATIVE */
char **p = short2blk(v);
USE(c);
islogin();
rechist(NULL, adrof(STRsavehist) != NULL);
(void) signal(SIGTERM, parterm);
(void) execl(_PATH_BIN_LOGIN, "login", short2str(v[1]), NULL);
(void) execl(_PATH_USRBIN_LOGIN, "login", short2str(v[1]), NULL);
(void) execv(_PATH_BIN_LOGIN, p);
(void) execv(_PATH_USRBIN_LOGIN, p);
blkfree((Char **) p);
untty();
xexit(1);
#endif /* !WINNT_NATIVE */
@ -829,6 +833,8 @@ search(type, level, goal)
Char wordbuf[BUFSIZE];
register Char *aword = wordbuf;
register Char *cp;
struct whyle *wp;
int wlevel = 0;
Stype = (Char) type;
Sgoal = goal;
@ -866,13 +872,24 @@ search(type, level, goal)
case TC_FOREACH:
case TC_WHILE:
wlevel++;
if (type == TC_BREAK)
level++;
break;
case TC_END:
if (type == TC_BRKSW) {
if (wlevel == 0) {
wp = whyles;
if (wp) {
whyles = wp->w_next;
wpfree(wp);
}
}
}
if (type == TC_BREAK)
level--;
wlevel--;
break;
case TC_SWITCH:
@ -1029,6 +1046,17 @@ toend()
wfree();
}
static void
wpfree(wp)
struct whyle *wp;
{
if (wp->w_fe0)
blkfree(wp->w_fe0);
if (wp->w_fename)
xfree((ptr_t) wp->w_fename);
xfree((ptr_t) wp);
}
void
wfree()
{
@ -1078,11 +1106,7 @@ wfree()
}
}
if (wp->w_fe0)
blkfree(wp->w_fe0);
if (wp->w_fename)
xfree((ptr_t) wp->w_fename);
xfree((ptr_t) wp);
wpfree(wp);
}
}
@ -1245,8 +1269,8 @@ islocale_var(var)
Char *var;
{
static Char *locale_vars[] = {
STRLANG, STRLC_CTYPE, STRLC_NUMERIC, STRLC_TIME,
STRLC_COLLATE, STRLC_MESSAGES, STRLC_MONETARY, 0
STRLANG, STRLC_ALL, STRLC_CTYPE, STRLC_NUMERIC,
STRLC_TIME, STRLC_COLLATE, STRLC_MESSAGES, STRLC_MONETARY, 0
};
register Char **v;
@ -1312,15 +1336,11 @@ dosetenv(v, c)
vp = *v++;
lp = vp;
if (!letter(*lp))
stderror(ERR_NAME | ERR_VARBEGIN);
for (; alnum(*lp); lp++)
continue;
if (*lp != '\0')
stderror(ERR_NAME | ERR_SYNTAX);
for (; *lp != '\0' ; lp++) {
if (*lp == '=')
stderror(ERR_NAME | ERR_SYNTAX);
}
if ((lp = *v++) == 0)
lp = STRNULL;
@ -1732,7 +1752,7 @@ doumask(v, c)
# define toset(a) ((a) + 1)
# endif /* aiws */
# else /* BSDLIMIT */
# if (defined(BSD4_4) || defined(__linux__)) && !defined(__386BSD__)
# if (defined(BSD4_4) || defined(__linux__) || (HPUXVERSION >= 1100)) && !defined(__386BSD__)
typedef rlim_t RLIM_TYPE;
# else
# if defined(SOLARIS2) || (defined(sgi) && SYSVREL > 3)
@ -1747,7 +1767,7 @@ doumask(v, c)
# endif /* BSD4_4 && !__386BSD__ */
# endif /* BSDLIMIT */
# if (HPUXVERSION > 700) && defined(BSDLIMIT)
# if (HPUXVERSION > 700) && (HPUXVERSION < 1100) && defined(BSDLIMIT)
/* Yes hpux8.0 has limits but <sys/resource.h> does not make them public */
/* Yes, we could have defined _KERNEL, and -I/etc/conf/h, but is that better? */
# ifndef RLIMIT_CPU
@ -1768,7 +1788,7 @@ doumask(v, c)
# ifndef SIGRTMIN
# define FILESIZE512
# endif /* SIGRTMIN */
# endif /* (HPUXVERSION > 700) && BSDLIMIT */
# endif /* (HPUXVERSION > 700) && (HPUXVERSION < 1100) && BSDLIMIT */
# if SYSVREL > 3 && defined(BSDLIMIT) && !defined(_SX)
/* In order to use rusage, we included "/usr/ucbinclude/sys/resource.h" in */
@ -2064,7 +2084,7 @@ plim(lp, hard)
RLIM_TYPE limit;
int div = lp->limdiv;
xprintf("%s \t", lp->limname);
xprintf("%-13.13s", lp->limname);
# ifndef BSDLIMIT
limit = ulimit(lp->limconst, 0);
@ -2224,6 +2244,8 @@ dosuspend(v, c)
if (tpgrp != -1) {
retry:
ctpgrp = tcgetpgrp(FSHTTY);
if (ctpgrp == -1)
stderror(ERR_SYSTEM, "tcgetpgrp", strerror(errno));
if (ctpgrp != opgrp) {
old = signal(SIGTTIN, SIG_DFL);
(void) kill(0, SIGTTIN);

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.glob.c,v 3.54 2002/07/04 19:28:29 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.glob.c,v 3.55 2004/03/21 16:48:14 christos Exp $ */
/*
* sh.glob.c: Regular expression expansion
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.glob.c,v 3.54 2002/07/04 19:28:29 christos Exp $")
RCSID("$Id: sh.glob.c,v 3.55 2004/03/21 16:48:14 christos Exp $")
#include "tc.h"
#include "tw.h"
@ -79,7 +79,6 @@ static Char **libglob __P((Char **));
static Char **globexpand __P((Char **));
static int globbrace __P((Char *, Char *, Char ***));
static void expbrace __P((Char ***, Char ***, int));
static int pmatch __P((Char *, Char *, Char **));
static void pword __P((int));
static void psave __P((int));
static void backeval __P((Char *, bool));
@ -988,12 +987,12 @@ Gnmatch(string, pattern, endstr)
if (endstr == NULL)
/* Exact matches only */
for (p = blk; *p; p++)
gres |= pmatch(string, *p, &tstring) == 2 ? 1 : 0;
gres |= t_pmatch(string, *p, &tstring, 0) == 2 ? 1 : 0;
else {
/* partial matches */
int minc = 0x7fffffff;
for (p = blk; *p; p++)
if (pmatch(string, *p, &tstring) != 0) {
if (t_pmatch(string, *p, &tstring, 0) != 0) {
int t = (int) (tstring - string);
gres |= 1;
if (minc == -1 || minc > t)
@ -1006,17 +1005,18 @@ Gnmatch(string, pattern, endstr)
return(gres == gpol);
}
/* pmatch():
/* t_pmatch():
* Return 2 on exact match,
* Return 1 on substring match.
* Return 0 on no match.
* *estr will point to the end of the longest exact or substring match.
*/
static int
pmatch(string, pattern, estr)
register Char *string, *pattern, **estr;
int
t_pmatch(string, pattern, estr, cs)
Char *string, *pattern, **estr;
int cs;
{
register Char stringc, patternc;
Char stringc, patternc;
int match, negate_range;
Char rangec, *oestr, *pestr;
@ -1045,7 +1045,7 @@ pmatch(string, pattern, estr)
pestr = NULL;
do {
switch(pmatch(string, pattern, estr)) {
switch(t_pmatch(string, pattern, estr, cs)) {
case 0:
break;
case 1:
@ -1079,8 +1079,8 @@ pmatch(string, pattern, estr)
if (match)
continue;
if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') {
match = (globcharcoll(stringc, *pattern & TRIM) <= 0 &&
globcharcoll(*(pattern-2) & TRIM, stringc) <= 0);
match = (globcharcoll(stringc, *pattern & TRIM, cs) <= 0 &&
globcharcoll(*(pattern-2) & TRIM, stringc, cs) <= 0);
pattern++;
}
else

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.h,v 3.108 2002/07/23 16:13:22 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.h,v 3.114 2004/02/21 20:34:25 christos Exp $ */
/*
* sh.h: Catch it all globals and includes file!
*/
@ -109,9 +109,13 @@ typedef int sigret_t;
/*
* Return true if the path is absolute
*/
#if defined(WINNT_NATIVE) || defined(__CYGWIN__)
#if defined(WINNT_NATIVE)
# define ABSOLUTEP(p) ((p)[0] == '/' || \
(Isalpha((p)[0]) && (p)[1] == ':'))
#elif defined(__CYGWIN__)
# define ABSOLUTEP(p) ((p)[0] == '/' || \
(Isalpha((p)[0]) && (p)[1] == ':' && \
((p)[2] == '\0' || (p)[2] == '/')))
#else /* !WINNT_NATIVE && !__CYGWIN__ */
# define ABSOLUTEP(p) (*(p) == '/')
#endif /* WINNT_NATIVE || __CYGWIN__ */
@ -335,6 +339,9 @@ typedef int sigret_t;
#if !defined(O_RDONLY) || !defined(O_NDELAY)
# include <fcntl.h>
#endif
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
#include <errno.h>
@ -420,7 +427,7 @@ typedef int sigret_t;
# define __P(a) a
# else
# define __P(a) ()
# if !__STDC__
# if !defined(__STDC__)
# define const
# ifndef apollo
# define volatile /* Apollo 'c' extensions need this */
@ -611,10 +618,6 @@ EXTERN int onelflg IZERO; /* 2 -> need line for -t, 1 -> exit on read */
extern Char *ffile; /* Name of shell file for $0 */
extern bool dolzero; /* if $?0 should return true... */
#if defined(FILEC) && defined(TIOCSTI)
extern bool filec;
#endif /* FILEC && TIOCSTI */
extern char *seterr; /* Error message from scanner/parser */
#if !defined(BSD4_4) && !defined(__linux__)
extern int errno; /* Error from C library routines */
@ -1030,6 +1033,10 @@ EXTERN int gflag; /* After tglob -> is globbing needed? */
#define MAXVARLEN 30 /* Maximum number of char in a variable name */
#ifdef __CYGWIN__
# undef MAXPATHLEN
#endif /* __CYGWIN__ */
#ifndef MAXPATHLEN
# define MAXPATHLEN 2048
#endif /* MAXPATHLEN */
@ -1116,6 +1123,7 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
#define Strlen(a) strlen(a)
#define Strcmp(a, b) strcmp(a, b)
#define Strncmp(a, b, c) strncmp(a, b, c)
#define Strcasecmp(a, b) strcasecmp(a, b)
#define Strspl(a, b) strspl(a, b)
#define Strsave(a) strsave(a)
@ -1136,6 +1144,7 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
#define Strlen(a) s_strlen(a)
#define Strcmp(a, b) s_strcmp(a, b)
#define Strncmp(a, b, c) s_strncmp(a, b, c)
#define Strcasecmp(a, b) s_strcasecmp(a, b)
#define Strspl(a, b) s_strspl(a, b)
#define Strsave(a) s_strsave(a)
@ -1247,6 +1256,10 @@ EXTERN nl_catd catd;
# define CSAVS(b, c, d) strsave(CGETS(b, c, d))
#endif /* WINNT_NATIVE */
#if defined(FILEC)
extern bool filec;
#endif /* FILEC */
/*
* Since on some machines characters are unsigned, and the signed
* keyword is not universally implemented, we treat all characters

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.init.c,v 3.49 2002/03/08 17:36:46 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.init.c,v 3.51 2004/02/21 20:34:25 christos Exp $ */
/*
* sh.init.c: Function and signal tables
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.init.c,v 3.49 2002/03/08 17:36:46 christos Exp $")
RCSID("$Id: sh.init.c,v 3.51 2004/02/21 20:34:25 christos Exp $")
#include "ed.h"
#include "tw.h"
@ -61,6 +61,9 @@ struct biltins bfunc[] = {
{ "bindkey", dobindkey, 0, 8 },
{ "break", dobreak, 0, 0 },
{ "breaksw", doswbrk, 0, 0 },
#ifdef _OSD_POSIX
{ "bs2cmd", dobs2cmd, 1, INF },
#endif /* OBSOLETE */
{ "builtins", dobuiltins, 0, 0 },
#ifdef KAI
{ "bye", goodbye, 0, 0 },
@ -118,7 +121,7 @@ struct biltins bfunc[] = {
{ "migrate", domigrate, 1, INF },
#endif /* TCF */
#ifdef NEWGRP
{ "newgrp", donewgrp, 1, 2 },
{ "newgrp", donewgrp, 0, 2 },
#endif /* NEWGRP */
{ "nice", donice, 0, INF },
{ "nohup", donohup, 0, INF },

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.lex.c,v 3.56 2002/07/08 20:57:32 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.lex.c,v 3.57 2003/08/04 16:19:13 christos Exp $ */
/*
* sh.lex.c: Lexical analysis into tokens
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.lex.c,v 3.56 2002/07/08 20:57:32 christos Exp $")
RCSID("$Id: sh.lex.c,v 3.57 2003/08/04 16:19:13 christos Exp $")
#include "ed.h"
/* #define DEBUG_INP */
@ -1476,8 +1476,7 @@ readc(wanteof)
{
int c;
static int sincereal; /* Number of real EOFs we've seen */
Char *ptr; /* For STRignoreeof */
int numeof = 0; /* Value of STRignoreeof */
extern int numeof;
#ifdef DEBUG_INP
xprintf("readc\n");
@ -1487,20 +1486,6 @@ readc(wanteof)
return (c);
}
/* Compute the value of EOFs */
if ((ptr = varval(STRignoreeof)) != STRNULL) {
while (*ptr) {
if (!Isdigit(*ptr)) {
numeof = 0;
break;
}
numeof = numeof * 10 + *ptr++ - '0';
}
if (numeof != 0)
numeof++;
}
if (numeof < 0) numeof = 26; /* Sanity check */
top:
aret = TCSH_F_SEEK;
if (alvecp) {

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.misc.c,v 3.24 2002/03/08 17:36:46 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.misc.c,v 3.26 2003/03/12 19:14:51 christos Exp $ */
/*
* sh.misc.c: Miscelaneous functions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.misc.c,v 3.24 2002/03/08 17:36:46 christos Exp $")
RCSID("$Id: sh.misc.c,v 3.26 2003/03/12 19:14:51 christos Exp $")
static int renum __P((int, int));
static Char **blkend __P((Char **));
@ -258,6 +258,11 @@ closem()
{
register int f;
#ifdef NLS_BUGS
#ifdef NLS_CATALOGS
(void)catclose(catd);
#endif /* NLS_CATALOGS */
#endif /* NLS_BUGS */
#ifdef YPBUGS
/* suggested by Justin Bur; thanks to Karl Kleinpaste */
fix_yp_bugs();
@ -273,9 +278,14 @@ closem()
(void) close(f);
#ifdef NISPLUS
if(f < 3)
(void) open(_PATH_DEVNULL, O_RDONLY);
(void) open(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE);
#endif /* NISPLUS */
}
#ifdef NLS_BUGS
#ifdef NLS_CATALOGS
nlsinit();
#endif /* NLS_CATALOGS */
#endif /* NLS_BUGS */
}
#ifndef CLOSE_ON_EXEC
@ -315,7 +325,7 @@ donefds()
didfds = 0;
#ifdef NISPLUS
{
int fd = open(_PATH_DEVNULL, O_RDONLY);
int fd = open(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE);
(void) dup2(fd, 1);
(void) dup2(fd, 2);
if (fd != 0) {

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.proc.c,v 3.76 2002/03/08 17:36:46 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.proc.c,v 3.81 2003/11/09 03:02:46 christos Exp $ */
/*
* sh.proc.c: Job manipulations
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.proc.c,v 3.76 2002/03/08 17:36:46 christos Exp $")
RCSID("$Id: sh.proc.c,v 3.81 2003/11/09 03:02:46 christos Exp $")
#include "ed.h"
#include "tc.h"
@ -603,7 +603,7 @@ pjwait(pp)
if ((jobflags & PRUNNING) == 0)
break;
#ifdef JOBDEBUG
xprintf("%d starting to sigpause for SIGCHLD on %d\n",
xprintf("%d starting to sigpause for SIGCHLD on %d\n",
getpid(), fp->p_procid);
#endif /* JOBDEBUG */
#ifdef BSDSIGS
@ -1566,8 +1566,9 @@ dokill(v, c)
}
}
if (Isdigit(*sigptr)) {
signum = atoi(short2str(sigptr));
if (signum < 0 || signum > (MAXSIG-1))
char *ep;
signum = strtoul(short2str(sigptr), &ep, 0);
if (*ep || signum < 0 || signum > (MAXSIG-1))
stderror(ERR_NAME | ERR_BADSIG);
}
else {
@ -1677,12 +1678,15 @@ pkill(v, signum)
else if (!(Isdigit(*cp) || *cp == '-'))
stderror(ERR_NAME | ERR_JOBARGS);
else {
char *ep;
#ifndef WINNT_NATIVE
pid = atoi(short2str(cp));
pid = strtol(short2str(cp), &ep, 10);
#else
pid = strtoul(short2str(cp),NULL,0);
pid = strtoul(short2str(cp), &ep, 0);
#endif /* WINNT_NATIVE */
if (kill(pid, signum) < 0) {
if (*ep)
stderror(ERR_NAME | ERR_JOBARGS);
else if (kill(pid, signum) < 0) {
xprintf("%d: %s\n", pid, strerror(errno));
err1++;
goto cont;

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.sem.c,v 3.56 2002/03/08 17:36:46 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.sem.c,v 3.60 2004/02/23 15:04:36 christos Exp $ */
/*
* sh.sem.c: I/O redirections and job forking. A touchy issue!
* Most stuff with builtins is incorrect
@ -33,7 +33,7 @@
*/
#include "sh.h"
RCSID("$Id: sh.sem.c,v 3.56 2002/03/08 17:36:46 christos Exp $")
RCSID("$Id: sh.sem.c,v 3.60 2004/02/23 15:04:36 christos Exp $")
#include "tc.h"
#include "tw.h"
@ -859,12 +859,12 @@ doio(t, pipein, pipeout)
(void) strncpy(tmp, short2str(cp), MAXPATHLEN);
tmp[MAXPATHLEN] = '\0';
xfree((ptr_t) cp);
if ((fd = open(tmp, O_RDONLY)) < 0)
if ((fd = open(tmp, O_RDONLY|O_LARGEFILE)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
#ifdef O_LARGEFILE
/* allow input files larger than 2Gb */
#ifndef WINNT_NATIVE
(void) fcntl(fd, O_LARGEFILE, 0);
#endif /* O_LARGEFILE */
#endif /*!WINNT_NATIVE*/
(void) dmove(fd, 0);
}
else if (flags & F_PIPEIN) {
@ -875,7 +875,7 @@ doio(t, pipein, pipeout)
}
else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
(void) close(0);
(void) open(_PATH_DEVNULL, O_RDONLY);
(void) open(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE);
}
else {
(void) close(0);
@ -905,9 +905,9 @@ doio(t, pipein, pipeout)
(void) dcopy(SHDIAG, 2);
if ((flags & F_APPEND) != 0) {
#ifdef O_APPEND
fd = open(tmp, O_WRONLY | O_APPEND);
fd = open(tmp, O_WRONLY|O_APPEND|O_LARGEFILE);
#else /* !O_APPEND */
fd = open(tmp, O_WRONLY);
fd = open(tmp, O_WRONLY|O_LARGEFILE);
(void) lseek(fd, (off_t) 0, L_XTND);
#endif /* O_APPEND */
}
@ -921,10 +921,10 @@ doio(t, pipein, pipeout)
}
if ((fd = creat(tmp, 0666)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
#ifdef O_LARGEFILE
/* allow input files larger than 2Gb */
#ifndef WINNT_NATIVE
(void) fcntl(fd, O_LARGEFILE, 0);
#endif /* O_LARGEFILE */
#endif /*!WINNT_NATIVE*/
}
(void) dmove(fd, 1);
is1atty = isatty(1);

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.set.c,v 3.44 2002/07/01 20:50:22 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $ */
/*
* sh.set.c: Setting and Clearing of variables
*/
@ -32,13 +32,14 @@
*/
#include "sh.h"
RCSID("$Id: sh.set.c,v 3.44 2002/07/01 20:50:22 christos Exp $")
RCSID("$Id: sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $")
#include "ed.h"
#include "tw.h"
extern Char HistLit;
extern bool GotTermCaps;
int numeof = 0;
static void update_vars __P((Char *));
static Char *getinx __P((Char *, int *));
@ -122,7 +123,7 @@ update_vars(vp)
ed_Init(); /* reset the editor */
}
else if (eq(vp, STRhome)) {
register Char *cp;
Char *cp;
cp = Strsave(varval(vp)); /* get the old value back */
@ -147,6 +148,18 @@ update_vars(vp)
else if (eq(vp, STRshlvl)) {
tsetenv(STRKSHLVL, varval(vp));
}
else if (eq(vp, STRignoreeof)) {
Char *cp;
numeof = 0;
for ((cp = varval(STRignoreeof)); cp && *cp; cp++) {
if (!Isdigit(*cp)) {
numeof = 0;
break;
}
numeof = numeof * 10 + *cp - '0';
}
if (numeof <= 0) numeof = 26; /* Sanity check */
}
else if (eq(vp, STRbackslash_quote)) {
bslash_quote = 1;
}
@ -732,6 +745,8 @@ unset(v, c)
HIST = '!';
HISTSUB = '^';
}
if (adrof(STRignoreeof) == 0)
numeof = 0;
if (adrof(STRpromptchars) == 0) {
PRCH = '>';
PRCHROOT = '#';
@ -1230,9 +1245,13 @@ autoset_dspmbyte(pcp)
{ STRLANGEUCJPB, STRKEUC },
{ STRLANGEUCKRB, STRKEUC },
{ STRLANGEUCZHB, STRKEUC },
#ifdef linux
{ STRLANGEUCJPC, STRKEUC },
#endif
{ STRLANGSJIS, STRKSJIS },
{ STRLANGSJISB, STRKSJIS },
{ STRLANGBIG5, STRKBIG5 },
{ STRSTARKUTF8, STRKUTF8 },
{ NULL, NULL }
};
@ -1240,7 +1259,8 @@ autoset_dspmbyte(pcp)
return;
for (i = 0; dspmt[i].n; i++) {
if (eq(pcp, dspmt[i].n)) {
Char *estr;
if (t_pmatch(pcp, dspmt[i].n, &estr, 1) > 0) {
set(CHECK_MBYTEVAR, Strsave(dspmt[i].v), VAR_READWRITE);
update_dspmbyte_vars();
break;

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/sh.types.h,v 3.39 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/sh.types.h,v 3.40 2003/06/18 19:32:44 christos Exp $ */
/* sh.types.h: Do the necessary typedefs for each system.
* Up till now I avoided making this into a separate file
* But I just wanted to eliminate the whole mess from sh.h
@ -142,6 +142,7 @@
# define _SPEED_T
# endif /* _SPEED_T */
# if HPUXVERSION < 1100 /* XXX: Not true for 11.0 */
extern uid_t getuid(), geteuid();
extern gid_t getgid(), getegid();
extern sigmask_t sigblock();
@ -155,6 +156,7 @@ extern void qsort();
extern void free();
extern unsigned int alarm();
extern unsigned int sleep();
# endif /* HPUXVERSION < 1100 */
# if HPUXVERSION < 800 /* XXX: Not true for 8.0 */
extern void sigpause();
extern sigmask_t sigspace();

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.const.c,v 3.67 2002/07/06 22:21:07 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.const.c,v 3.74 2004/03/21 16:48:15 christos Exp $ */
/*
* sh.const.c: String constants for tcsh.
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.const.c,v 3.67 2002/07/06 22:21:07 christos Exp $")
RCSID("$Id: tc.const.c,v 3.74 2004/03/21 16:48:15 christos Exp $")
Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
Char STRautologout[] = { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't',
@ -119,30 +119,31 @@ Char STRNLSPATH[] = { 'N', 'L', 'S', 'P', 'A', 'T', 'H', '\0' };
Char STRnokanji[] = { 'n', 'o', 'k', 'a', 'n', 'j', 'i', '\0' };
# ifdef DSPMBYTE
Char STRdspmbyte[] = { 'd', 's', 'p', 'm', 'b', 'y', 't', 'e', '\0' };
# ifdef BSDCOLORLS
Char STRmmliteral[] = { '-', 'G', '\0' };
# else
Char STRmmliteral[] = { '-', '-', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\0' };
# endif
Char STRKEUC[] = { 'e', 'u', 'c', '\0' };
Char STRKSJIS[] = { 's', 'j', 'i', 's', '\0' };
Char STRKBIG5[] = { 'b', 'i', 'g', '5', '\0' };
Char STRKUTF8[] = { 'u', 't', 'f', '8', '\0' };
Char STRSTARKUTF8[] = { '*', 'u', 't', 'f', '8', '\0' };
# ifdef MBYTEDEBUG /* Sorry, use for beta testing */
Char STRmbytemap[] = { 'm', 'b', 'y', 't', 'e', 'm', 'a', 'p', '\0' };
# endif /* MBYTEMAP */
/* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
/* dspmbyte autoset trap */
/* STRLANGEUCJP,STRLANGEUCJPB = EUCJP Trap */
/* STRLANGEUCJP,STRLANGEUCJPB(,STRLANGEUCJPC) = EUCJP Trap */
/* STRLANGEUCKR,STRLANGEUCKRB = EUCKR Trap */
/* STRLANGEUCZH,STRLANGEUCZHB = EUCZH Trap */
/* STRLANGSJIS,STRLANGSJISB = SJIS Trap */
# if defined(__uxps__) || defined(sgi) || defined(aix) || defined(__CYGWIN__) || defined(linux)
# if defined(__uxps__) || defined(sgi) || defined(aix) || defined(__CYGWIN__)
Char STRLANGEUCJP[] = { 'j', 'a', '_', 'J', 'P', '.', 'E', 'U', 'C', '\0' };
Char STRLANGEUCKR[] = { 'k', 'o', '_', 'K', 'R', '.', 'E', 'U', 'C', '\0' };
# if defined(__uxps__)
Char STRLANGEUCJPB[] = { 'j', 'a', 'p', 'a', 'n', '\0' };
Char STRLANGEUCKRB[] = { 'k', 'o', 'r', 'e', 'a', '\0' };
# elif defined(linux)
Char STRLANGEUCJPB[] = { 'j', 'a', '_', 'J', 'P', '.', 'u', 'j', 'i', 's',
'\0' };
Char STRLANGEUCKRB[] = { 'k', 'o', '_', 'K', 'R', '.', 'e', 'u', 'c', '\0' };
# elif defined(aix)
Char STRLANGEUCJPB[] = { 'j', 'a', '_', 'J', 'P', '\0' };
Char STRLANGEUCKRB[] = { 'k', 'o', '_', 'K', 'R', '\0' };
@ -157,7 +158,23 @@ Char STRLANGBIG5[] = { 'z', 'h', '_', 'T', 'W', '.', 'B', 'i', 'g', '5',
'\0' };
Char STRLANGEUCZH[] = { '\0' };
Char STRLANGEUCZHB[] = { '\0' };
# elif defined(__FreeBSD__)
# elif defined(linux)
Char STRLANGEUCJP[] = { 'j', 'a', '_', 'J', 'P', '.', 'E', 'U', 'C', '-',
'J', 'P', '\0' };
Char STRLANGEUCKR[] = { 'k', 'o', '_', 'K', 'R', '.', 'E', 'U', 'C', '\0' };
Char STRLANGEUCJPB[] = { 'j', 'a', '_', 'J', 'P', '.', 'e', 'u', 'c', 'J',
'P', '\0' };
Char STRLANGEUCKRB[] = { 'k', 'o', '_', 'K', 'R', '.', 'e', 'u', 'c', '\0' };
Char STRLANGEUCJPC[] = { 'j', 'a', '_', 'J', 'P', '.', 'u', 'j', 'i', 's',
'\0' };
Char STRLANGSJIS[] = { 'j', 'a', '_', 'J', 'P', '.', 'S', 'J', 'I', 'S',
'\0' };
Char STRLANGSJISB[] = { '\0' };
Char STRLANGBIG5[] = { 'z', 'h', '_', 'T', 'W', '.', 'B', 'i', 'g', '5',
'\0' };
Char STRLANGEUCZH[] = { '\0' };
Char STRLANGEUCZHB[] = { '\0' };
# elif (defined(__FreeBSD__) || defined(__NetBSD__))
Char STRLANGEUCJP[] = { 'j', 'a', '_', 'J', 'P', '.', 'e', 'u', 'c', 'J',
'P', '\0' };
Char STRLANGEUCJPB[] = { 'j', 'a', '_', 'J', 'P', '.', 'E', 'U', 'C', '\0' };
@ -361,6 +378,7 @@ Char STRerase[] = { 'e', 'r', 'a', 's', 'e', '\0' };
Char STRprev[] = { 'p', 'r', 'e', 'v', '\0' };
Char STRcomplete[] = { 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '\0' };
Char STRenhance[] = { 'e', 'n', 'h', 'a', 'n', 'c', 'e', '\0' };
Char STRigncase[] = { 'i', 'g', 'n', 'c', 'a', 's', 'e', '\0' };
Char STRautoexpand[] = { 'a', 'u', 't', 'o', 'e', 'x', 'p', 'a', 'n', 'd',
'\0' };
Char STRautocorrect[] = { 'a', 'u', 't', 'o', 'c', 'o', 'r', 'r', 'e', 'c',
@ -407,6 +425,7 @@ Char STRkilldup[] = { 'k', 'i', 'l', 'l', 'd', 'u', 'p', '\0' };
Char STRshlvl[] = { 's', 'h', 'l', 'v', 'l', '\0' };
Char STRKSHLVL[] = { 'S', 'H', 'L', 'V', 'L', '\0' };
Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' };
Char STRLC_NUMERIC[] = { 'L', 'C', '_', 'N', 'U', 'M', 'E', 'R', 'I',
'C', '\0' };

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.decls.h,v 3.50 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.decls.h,v 3.52 2004/02/21 20:34:25 christos Exp $ */
/*
* tc.decls.h: Function declarations from all the tcsh modules
*/
@ -141,6 +141,10 @@ extern void dodmmode __P((Char **, struct command *));
extern void douniverse __P((Char **, struct command *));
#endif /* masscomp */
#if defined(_OSD_POSIX) /* BS2000 */
extern void dobs2cmd __P((Char **, struct command *));
#endif /* _OSD_POSIX */
#if defined(hcx)
extern void doatt __P((Char **, struct command *));
extern void doucb __P((Char **, struct command *));
@ -299,6 +303,7 @@ extern size_t s_strlen __P((const Char *));
extern int s_strcmp __P((const Char *, const Char *));
extern int s_strncmp __P((const Char *, const Char *,
size_t));
extern int s_strcasecmp __P((const Char *, const Char *));
extern Char *s_strsave __P((const Char *));
extern Char *s_strend __P((const Char *));
extern Char *s_strstr __P((const Char *, const Char *));

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.func.c,v 3.105 2002/07/12 13:16:18 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.func.c,v 3.107 2003/05/16 18:10:29 christos Exp $ */
/*
* tc.func.c: New tcsh builtins.
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.func.c,v 3.105 2002/07/12 13:16:18 christos Exp $")
RCSID("$Id: tc.func.c,v 3.107 2003/05/16 18:10:29 christos Exp $")
#include "ed.h"
#include "ed.defns.h" /* for the function names */
@ -689,7 +689,7 @@ xgetpass(prm)
sigint = (signalfun_t) sigset(SIGINT, SIG_IGN);
(void) Rawmode(); /* Make sure, cause we want echo off */
if ((fd = open("/dev/tty", O_RDWR)) == -1)
if ((fd = open("/dev/tty", O_RDWR|O_LARGEFILE)) == -1)
fd = SHIN;
xprintf("%s", prm); flush();
@ -1759,7 +1759,7 @@ doaliases(v, c)
trim(v);
}
if ((fd = open(tmp = short2str(*v), O_RDONLY)) < 0)
if ((fd = open(tmp = short2str(*v), O_RDONLY|O_LARGEFILE)) < 0)
stderror(ERR_NAME | ERR_SYSTEM, tmp, strerror(errno));
getexit(oldexit);
@ -2163,7 +2163,7 @@ getremotehost()
* have not caught up yet.
*/
addr.s_addr = inet_addr(name);
if (addr.s_addr != (unsigned long)~0)
if (addr.s_addr != (unsigned int)~0)
host = name;
else {
if (sptr != name) {

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.os.c,v 3.53 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.os.c,v 3.55 2004/02/21 20:34:25 christos Exp $ */
/*
* tc.os.c: OS Dependent builtin functions
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.os.c,v 3.53 2002/03/08 17:36:47 christos Exp $")
RCSID("$Id: tc.os.c,v 3.55 2004/02/21 20:34:25 christos Exp $")
#include "tw.h"
#include "ed.h"
@ -697,6 +697,214 @@ douniverse(v, c)
}
#endif /* masscomp || _CX_UX */
/***
*** BS2000/OSD POSIX (Fujitsu Siemens Computers)
***/
#if defined(_OSD_POSIX)
static int
bs2upcase(char *str)
{
enum { outside = ' ', singlequote='\'', doublequote='"'} string = outside;
char *white;
for (white = str + strlen(str) - 1; isspace(*white) && white > str; --white)
*white = '\0';
for (; *str != '\0'; ++str)
{
if (string == outside)
{
*str = toupper (*str);
}
if (*str == '\'')
{
if (string == outside)
string = singlequote;
else if (string != doublequote)
string = outside;
}
else if (*str == '"')
{
if (string == outside)
string = doublequote;
else if (string != singlequote)
string = outside;
}
}
if (string != outside)
{
stderror(ERR_NAME | ERR_UNMATCHED, (Char) string);
return 1;
}
return 0;
}
static int
bs2cmdlist(char *str)
{
char *str_beg = NULL;
int ret = 0;
enum { outside = ' ', singlequote='\'', doublequote='"'} string = outside;
while (*str != '\0')
{
while (isspace(*str))
++str;
if (*str == '\0')
break;
str_beg = str;
for (; *str != '\0'; ++str)
{
if (string == outside && *str == ';') /* End of command */
{
*str++ = '\0';
break; /* continue with next command */
}
if (*str == '\'')
{
if (string == outside)
string = singlequote;
else if (string != doublequote)
string = outside;
}
else if (*str == '"')
{
if (string == outside)
string = doublequote;
else if (string != singlequote)
string = outside;
}
}
if (strlen(str_beg) != 0)
{
ret = bs2system(str_beg);
flush();
if (ret != 0 /*&& !option.err_ignore*/)
break; /* do not continue after errors */
}
}
if (string != outside)
{
stderror(ERR_NAME | ERR_UNMATCHED, (Char) string);
return -1;
}
return ret;
}
/*ARGSUSED*/
void
dobs2cmd(v, c)
register Char **v;
struct command *c;
{
register Char *cp;
register int i = 0, len = 0;
char *cmd = NULL;
int pvec[2];
struct command faket;
Char *fakecom[2];
char tibuf[BUFSIZE];
int icnt;
static const Char STRbs2cmd[] = { 'b','s','2','c','m','d','\0' };
if (setintr)
#ifdef BSDSIGS
(void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
#else /* !BSDSIGS */
(void) sigrelse (SIGINT);
#endif /* BSDSIGS */
v++;
gflag = 0, tglob(v);
if (gflag) {
v = globall(v);
if (v == 0)
stderror(ERR_NAME | ERR_NOMATCH);
}
else {
v = gargv = saveblk(v);
trim(v);
}
/* First round: count the string lengths */
for (i=0; v[i]; ++i) {
len += s_strlen(v[i]) + (v[i+1] != NULL);
}
cmd = xmalloc(len+1); /* 1 for the final '\0' */
/* 2nd round: fill cmd buffer */
i = 0;
while ((cp = *v++) != 0) {
register int c;
while (c = *cp++)
cmd[i++] = (char)c;
if (*v)
cmd[i++] = ' ';
}
cmd[i] = '\0';
/* Make upper case */
bs2upcase(cmd);
faket.t_dtyp = NODE_COMMAND;
faket.t_dflg = F_BACKQ|F_STDERR;
faket.t_dlef = 0;
faket.t_drit = 0;
faket.t_dspr = 0;
faket.t_dcom = fakecom;
fakecom[0] = STRbs2cmd;
fakecom[1] = 0;
mypipe(pvec);
if (pfork(&faket, -1) == 0) {
/* child */
(void) close(pvec[0]);
(void) dmove(pvec[1], 1);
(void) dmove(SHDIAG, 2);
initdesc();
/* closem();*/
#ifdef SIGTSTP
(void) sigignore(SIGTSTP);
#endif
#ifdef SIGTTIN
(void) sigignore(SIGTTIN);
#endif
#ifdef SIGTTOU
(void) sigignore(SIGTTOU);
#endif
xexit(bs2cmdlist(cmd));
}
(void) close(pvec[1]);
for(;;) {
do
icnt = read(pvec[0], tibuf, BUFSIZE);
while (icnt == -1 && errno == EINTR);
if (icnt <= 0)
break;
for (i = 0; i < icnt; i++)
xputchar((unsigned char) tibuf[i]);
}
(void) close(pvec[0]);
pwait();
flush();
if (setintr)
#ifdef BSDSIGS
(void) sigblock(sigmask(SIGINT));
#else /* !BSDSIGS */
(void) sighold(SIGINT);
#endif /* BSDSIGS */
if (gargv)
blkfree(gargv), gargv = 0;
}
#endif /* _OSD_POSIX */
#if defined(_CX_UX)
/*ARGSUSED*/
void
@ -935,7 +1143,7 @@ fix_strcoll_bug()
static char *root = "/";
if (!didfds)
fd = open(root, O_RDONLY);
fd = open(root, O_RDONLY|O_LARGEFILE);
(void) strcoll(root, root);

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.os.h,v 3.88 2002/05/16 13:51:26 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.os.h,v 3.90 2004/01/23 16:21:10 christos Exp $ */
/*
* tc.os.h: Shell os dependent defines
*/
@ -33,9 +33,11 @@
#ifndef _h_tc_os
#define _h_tc_os
#ifndef __STDC__
#ifndef WINNT_NATIVE
#define NEEDstrerror /* Too hard to find which systems have it */
#endif /* WINNT_NATIVE */
#endif
#ifdef notdef
@ -48,6 +50,8 @@
#endif /* notdef */
#ifdef __CYGWIN__
# undef NOFILE
# define NOFILE sysconf(_SC_OPEN_MAX)
# undef NEEDstrerror
#endif

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.printf.c,v 3.23 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.printf.c,v 3.24 2003/12/02 17:59:30 christos Exp $ */
/*
* tc.printf.c: A public-domain, minimal printf/sprintf routine that prints
* through the putchar() routine. Feel free to use for
@ -34,7 +34,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.printf.c,v 3.23 2002/03/08 17:36:47 christos Exp $")
RCSID("$Id: tc.printf.c,v 3.24 2003/12/02 17:59:30 christos Exp $")
#ifdef lint
#undef va_arg
@ -174,6 +174,11 @@ doprnt(addchar, sfmt, ap)
(*addchar) ((int) (' ' | attributes));
break;
case 'p':
do_long = 1;
hash = 1;
fmt = 'x';
/*FALLTHROUGH*/
case 'o':
case 'x':
case 'u':

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.prompt.c,v 3.46 2002/07/12 13:16:19 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.prompt.c,v 3.47 2002/07/25 17:14:59 christos Exp $ */
/*
* tc.prompt.c: Prompt printing stuff
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.prompt.c,v 3.46 2002/07/12 13:16:19 christos Exp $")
RCSID("$Id: tc.prompt.c,v 3.47 2002/07/25 17:14:59 christos Exp $")
#include "ed.h"
#include "tw.h"
@ -554,7 +554,8 @@ tprintf(what, buf, fmt, siz, str, tim, info)
default:
#ifndef HAVENOUTMP
if (*cp == 'a' && what == FMT_WHO) {
cz = who_info(info, 'a', (char *) cbuff, sizeof(cbuff));
cz = (unsigned char *) who_info(info, 'a', (char *) cbuff,
sizeof(cbuff));
for (; cz && *cz; *p++ = attributes | *cz++)
if (p >= ep) break;
}

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.str.c,v 3.10 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.str.c,v 3.13 2004/02/21 20:34:25 christos Exp $ */
/*
* tc.str.c: Short string package
* This has been a lesson of how to write buggy code!
@ -33,7 +33,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.str.c,v 3.10 2002/03/08 17:36:47 christos Exp $")
RCSID("$Id: tc.str.c,v 3.13 2004/02/21 20:34:25 christos Exp $")
#define MALLOC_INCR 128
@ -309,6 +309,33 @@ s_strncmp(str1, str2, n)
return(0);
}
int
s_strcasecmp(str1, str2)
register const Char *str1, *str2;
{
unsigned char c1, c2, l1 = 0, l2 = 0;
for (; *str1 && ((*str1 == *str2 && (l1 = l2 = 0) == 0) ||
((c1 = (unsigned char)*str1) == *str1 &&
(c2 = (unsigned char)*str2) == *str2 &&
(l1 = tolower(c1)) == (l2 = tolower(c2)))); str1++, str2++)
continue;
/*
* The following case analysis is necessary so that characters which look
* negative collate low against normal characters but high against the
* end-of-string NUL.
*/
if (*str1 == '\0' && *str2 == '\0')
return (0);
else if (*str1 == '\0')
return (-1);
else if (*str2 == '\0')
return (1);
else if (l1 == l2) /* They are zero when they are equal */
return (*str1 - *str2);
else
return (l1 - l2);
}
Char *
s_strsave(s)
register const Char *s;

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tc.who.c,v 3.35 2002/07/01 21:12:04 christos Exp $ */
/* $Header: /src/pub/tcsh/tc.who.c,v 3.37 2002/11/21 20:02:01 christos Exp $ */
/*
* tc.who.c: Watch logins and logouts...
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tc.who.c,v 3.35 2002/07/01 21:12:04 christos Exp $")
RCSID("$Id: tc.who.c,v 3.37 2002/11/21 20:02:01 christos Exp $")
#include "tc.h"
@ -52,6 +52,8 @@ RCSID("$Id: tc.who.c,v 3.35 2002/07/01 21:12:04 christos Exp $")
# ifndef _PATH_UTMP
# if defined(__UTMPX_FILE) && !defined(UTMPX_FILE)
# define _PATH_UTMP __UTMPX_FILE
# elif defined(_PATH_UTMPX)
# define _PATH_UTMP _PATH_UTMPX
# else
# define _PATH_UTMP UTMPX_FILE
# endif /* __UTMPX_FILE && !UTMPX_FILE */
@ -261,7 +263,7 @@ watch_login(force)
return;
}
stlast = sta.st_mtime;
if ((utmpfd = open(_PATH_UTMP, O_RDONLY)) < 0) {
if ((utmpfd = open(_PATH_UTMP, O_RDONLY|O_LARGEFILE)) < 0) {
if (!force)
xprintf(CGETS(26, 2,
"%s cannot be opened. Please \"unset watch\".\n"),

View File

@ -72,7 +72,7 @@
.\" used here if you can. In particular, please don't use nroff commands
.\" which aren't already used herein.
.\"
.TH TCSH 1 "23 July 2002" "Astron 6.12.00"
.TH TCSH 1 "19 May 2004" "Astron 6.13.00"
.SH NAME
tcsh \- C shell with file name completion and command line editing
.SH SYNOPSIS
@ -684,7 +684,7 @@ See also \fIdelete-char-or-list-or-eof\fR.
.TP 8
.B magic-space \fR(not bound)
Expands history substitutions in the current line,
like \fIexpand-history\fR, and appends a space.
like \fIexpand-history\fR, and inserts a space.
\fImagic-space\fR is designed to be bound to the space bar,
but is not bound by default.
.TP 8
@ -777,6 +777,14 @@ Like \fIvi-search-back\fR, but searches forward.
.B which-command \fR(M-?)
Does a \fIwhich\fR (see the description of the builtin command) on the
first word of the input buffer.
.TP 8
.B yank-pop \fR(M-y)
When executed immediately after a \fIyank\fR or another \fIyank-pop\fR,
replaces the yanked string with the next previous string from the
killring. This also has the effect of rotating the killring, such that
this string will be considered the most recently killed by a later
\fIyank\fR command. Repeating \fIyank-pop\fR will cycle through the
killring any number of times.
.SS "Lexical structure"
The shell splits input lines into words at blanks and tabs. The special
characters `&', `|', `;', `<', `>', `(', and `)' and the doubled characters
@ -987,12 +995,6 @@ specification.
.PP
A history reference may have a word designator but no event specification.
It then references the previous command.
.ig \" Not true, but we thought it was for a long time ...
, unless a previous history reference
occurred on the same line in which case this form repeats the previous
reference. Thus `!?foo?^ !$' gives the first and last arguments from the
command matching `?foo?'.
..
Continuing our `diff' example, we could have said simply `diff
!^.old !^' or, to get the arguments in the opposite order, just `diff !*'.
.PP
@ -1959,6 +1961,9 @@ On systems that support TCF (aix-ibm370, aix-ps2),
and \fImigrate\fR migrates processes between sites. The \fIjobs\fR builtin
prints the site on which each job is executing.
.PP
Under BS2000, \fIbs2cmd\fR executes commands of the underlying BS2000/OSD
operating system.
.PP
Under Domain/OS, \fIinlib\fR adds shared libraries to the current environment,
\fIrootnode\fR changes the rootnode and \fIver\fR changes the systype.
.PP
@ -2081,13 +2086,6 @@ With \fIname\fR and \fIwordlist\fR, assigns
\fIwordlist\fR is command and filename substituted.
\fIname\fR may not be `alias' or `unalias'.
See also the \fIunalias\fR builtin command.
.ig \" Obsolete tcsh command
.TP 8
.B aliases \fR[\fIfile\fR] (+)
Without arguments, prints all aliases.
With \fIfile\fR, loads a list of aliases from \fIfile\fR, one per line.
Retained for only downward compatibility.
..
.TP 8
.B alloc
Shows the amount of dynamic memory acquired, broken down into used and free
@ -2101,23 +2099,6 @@ Puts the specified jobs (or, without arguments, the current job)
into the background, continuing each if it is stopped.
\fIjob\fR may be a number, a string, `', `%', `+' or `\-' as described
under \fBJobs\fR.
.ig \" Obsolete tcsh command
.TP 8
.B bind \fR[\fBdefaults\fR|\fBemacs\fR|\fBvi\fR|\fIkey\fR|\fIkey command\fR] (+)
An older version of \fIbindkey\fR, retained for only downward compatibility.
Without arguments, lists all bound keys and the editor command to which each is bound.
`bind defaults', `bind emacs' and `bind vi' are equivalent to
`bindkey \-d', `bindkey \-e' and `bindkey \-v'.
With \fIkey\fR, lists the editor command to which \fIkey\fR is bound.
With \fIkey\fR and \fIcommand\fR, binds the editor command \fIcommand\fR to \fIkey\fR.
.IP "" 8
\fIkey\fR may be a literal character,
a control character written ^\fIcharacter\fR (e.g., `^A'),
a meta character written M-\fIcharacter\fR (e.g., `M-A')
or a function key written F-\fIstring\fR (e.g., `F-foo').
For the function key form to work, the function key prefix must be
bound to \fIsequence-lead-in\fR and \fIstring\fR must not contain that prefix.
..
.PP
.B bindkey \fR[\fB\-l\fR|\fB\-d\fR|\fB\-e\fR|\fB\-v\fR|\fB\-u\fR] (+)
.br
@ -2230,6 +2211,12 @@ The ASCII character corresponding to the octal number \fInnn\fR
any, notably `\\' and `^'.
.RE
.TP 8
.B bs2cmd \fIbs2000-command\fR (+)
Passes \fIbs2000-command\fR to the BS2000 command interpreter for
execution. Only non-interactive commands can be executed, and it is
not possible to execute any command that would overlay the image
of the current process, like /EXECUTE or /CALL-PROCEDURE. (BS2000 only)
.TP 8
.B break
Causes execution to resume after the \fIend\fR of the nearest
enclosing \fIforeach\fR or \fIwhile\fR. The remaining commands on the
@ -2310,12 +2297,6 @@ Position-dependent completion.
variables, which must include the current word.
.PD
.RE
.ig \" No longer true in 6.05.04
.PP
When \fIpattern\fR is a glob-pattern (for \fBc\fR, \fBC\fR, \fBn\fR and
\fBN\fR-type completion), a \fIpattern\fR of `*' does not match an empty
word.
..
.PP
\fIlist\fR, the list of possible completions, may be one of the following:
.PP
@ -2458,11 +2439,6 @@ and `set' with shell variables.
`true' doesn't have any options, so \fBx\fR does nothing when completion
is attempted and prints `Truth has no options.' when completion choices are listed.
.PP
.ig \" Changed in 6.05.04
The \fIman\fR example, and several other examples below, use
\fBp\fR-type completion, rather than \fBC\fR- or \fBn\fR-type, so that
`*' will match an empty word.
..
Note that the \fIman\fR example, and several other examples below, could
just as well have used 'c/*' or 'n/*' as 'p/*'.
.PP
@ -2549,13 +2525,13 @@ Finally, here's a complex example for inspiration:
.IP "" 4
> complete find \\
.br
\'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
\&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
.br
\'n/\-exec/c/' 'n/\-ok/c/' 'n/\-user/u/' \e
.br
\'n/\-group/g/' 'n/\-fstype/(nfs 4.2)/' \e
\&'n/\-group/g/' 'n/\-fstype/(nfs 4.2)/' \e
.br
\'n/\-type/(b c d f l p s)/' \e
\&'n/\-type/(b c d f l p s)/' \e
.br
\'c/\-/(name newer cpio ncpio exec ok user \e
.br
@ -2565,7 +2541,7 @@ ls mtime nogroup nouser perm print prune \e
.br
size xdev)/' \e
.br
\'p/*/d/'
\&'p/*/d/'
.PP
This completes words following `\-name', `\-newer', `\-cpio' or `ncpio'
(note the pattern which matches both) to files,
@ -2868,11 +2844,6 @@ or HUP (hangup), then the job or process is sent a
CONT (continue) signal as well.
The third form lists the signal names.
.PD
.ig \" Obsolete tcsh command
.TP 8
.B linedit \fR(+)
A synonym for the \fIecho\fR builtin command.
..
.TP 8
.B limit \fR[\fB\-h\fR] [\fIresource\fR [\fImaximum-use\fR]]
Limits the consumption by the current process and each
@ -3611,7 +3582,8 @@ If set, the command which was passed to the shell with the \fB-c\fR flag (q.v.).
.B complete \fR(+)
If set to `enhance', completion 1) ignores case and 2) considers
periods, hyphens and underscores (`.', `\-' and `_') to be word
separators and hyphens and underscores to be equivalent.
separators and hyphens and underscores to be equivalent. If set to
`igncase', the completion becomes case insensitive.
.TP 8
.B continue \fR(+)
If set to a list of commands, the shell will continue the listed
@ -3814,9 +3786,11 @@ If set to the empty string or `0' and the input device is a terminal,
the \fIend-of-file\fR command (usually generated by the user by typing
`^D' on an empty line) causes the shell to print `Use "exit" to leave
tcsh.' instead of exiting. This prevents the shell from accidentally
being killed. If set to a number \fIn\fR, the shell ignores \fIn\fR -
1 consecutive \fIend-of-file\fRs and exits on the \fIn\fRth. (+) If
unset, `1' is used, i.e., the shell exits on a single `^D'.
being killed. Historically this setting exited after 26 successive
EOF's to avoid infinite loops. If set to a number \fIn\fR, the shell
ignores \fIn - 1\fR consecutive \fIend-of-file\fRs and exits on the
\fIn\fRth. (+) If unset, `1' is used, i.e., the shell exits on a
single `^D'.
.TP 8
.B implicitcd \fR(+)
If set, the shell treats a directory name typed as a command as though
@ -3843,6 +3817,12 @@ string is erased and the current one is inserted.
Indicates the number of killed strings to keep in memory. Set to `30'
by default. If unset or set to less than `2', the shell will only
keep the most recently killed string.
Strings are put in the killring by the editor commands that delete
(kill) strings of text, e.g. \fIbackward-delete-word\fR,
\fIkill-line\fR, etc, as well as the \fIcopy-region-as-kill\fR command.
The \fIyank\fR editor command will yank the most recently killed string
into the command-line, while \fIyank-pop\fR (see \fBEditor commands\fR)
can be used to yank earlier killed strings.
.TP 8
.B listflags \fR(+)
If set to `x', `a' or `A', or any combination thereof (e.g., `xA'), they
@ -3911,7 +3891,7 @@ of `You have new mail.'
.B matchbeep \fR(+)
If set to `never', completion never beeps.
If set to `nomatch', it beeps only when there is no match.
If set to `ambiguous, it beeps when there are multiple matches.
If set to `ambiguous', it beeps when there are multiple matches.
If set to `notunique', it beeps when there is one exact and other longer matches.
If unset, `ambiguous' is used.
.TP 8
@ -4407,7 +4387,7 @@ The number of reads from raw disk devices.
The number of writes to raw disk devices.
.PD
.PP
and the default time format is `%Uu %Ss $E %P %I+%Oio %Fpf+%Ww'.
and the default time format is `%Uu %Ss %E %P %I+%Oio %Fpf+%Ww'.
Note that the CPU percentage can be higher than 100% on multi-processors.
.RE
.TP 8
@ -5039,7 +5019,7 @@ pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
termio(7), Introduction to the C Shell
.SH VERSION
This manual documents tcsh 6.12.00 (Astron) 2002-07-23.
This manual documents tcsh 6.13.00 (Astron) 2004-05-19.
.SH AUTHORS
.PD 0
.TP 2

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tw.color.c,v 1.11 2002/06/25 19:02:11 christos Exp $ */
/* $Header: /src/pub/tcsh/tw.color.c,v 1.12 2004/01/23 16:21:33 christos Exp $ */
/*
* tw.color.c: builtin color ls-F
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tw.color.c,v 1.11 2002/06/25 19:02:11 christos Exp $")
RCSID("$Id: tw.color.c,v 1.12 2004/01/23 16:21:33 christos Exp $")
#include "tw.h"
#include "ed.h"
@ -346,7 +346,7 @@ print_with_color(filename, len, suffix)
xputchar(suffix);
}
else
xprintf("%S%c", filename, suffix);
xprintf("\045S%c", filename, suffix);
}

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tw.comp.c,v 1.33 2002/06/25 19:02:11 christos Exp $ */
/* $Header: /src/pub/tcsh/tw.comp.c,v 1.34 2004/02/21 20:34:25 christos Exp $ */
/*
* tw.comp.c: File completion builtin
*/
@ -32,7 +32,7 @@
*/
#include "sh.h"
RCSID("$Id: tw.comp.c,v 1.33 2002/06/25 19:02:11 christos Exp $")
RCSID("$Id: tw.comp.c,v 1.34 2004/02/21 20:34:25 christos Exp $")
#include "tw.h"
#include "ed.h"
@ -62,6 +62,7 @@ docomplete(v, t)
{
register struct varent *vp;
register Char *p;
Char **pp;
USE(t);
v++;
@ -72,6 +73,15 @@ docomplete(v, t)
vp = adrof1(strip(p), &completions);
if (vp && vp->vec)
tw_pr(vp->vec), xputchar('\n');
else
{
#ifdef TDEBUG
xprintf("tw_find(%s) \n", short2str(strip(p)));
#endif /* TDEBUG */
pp = tw_find(strip(p), &completions, FALSE);
if (pp)
tw_pr(pp), xputchar('\n');
}
}
else
set1(strip(p), saveblk(v), &completions, VAR_READWRITE);

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tw.help.c,v 3.18 2002/03/08 17:36:47 christos Exp $ */
/* $Header: /src/pub/tcsh/tw.help.c,v 3.19 2002/11/21 20:02:01 christos Exp $ */
/* tw.help.c: actually look up and print documentation on a file.
* Look down the path for an appropriate file, then print it.
* Note that the printing is NOT PAGED. This is because the
@ -35,7 +35,7 @@
*/
#include "sh.h"
RCSID("$Id: tw.help.c,v 3.18 2002/03/08 17:36:47 christos Exp $")
RCSID("$Id: tw.help.c,v 3.19 2002/11/21 20:02:01 christos Exp $")
#include "tw.h"
#include "tc.h"
@ -120,7 +120,7 @@ do_help(command)
for (sp = h_ext; *sp; sp++) {
*ep = '\0';
catn(full, str2short(*sp), (int) (sizeof(full) / sizeof(Char)));
if ((f = open(short2str(full), O_RDONLY)) != -1)
if ((f = open(short2str(full), O_RDONLY|O_LARGEFILE)) != -1)
break;
}
if (f != -1) {

View File

@ -1,4 +1,4 @@
/* $Header: /src/pub/tcsh/tw.parse.c,v 3.92 2002/06/25 19:02:12 christos Exp $ */
/* $Header: /src/pub/tcsh/tw.parse.c,v 3.96 2004/01/23 16:21:33 christos Exp $ */
/*
* tw.parse.c: Everyone has taken a shot in this futile effort to
* lexically analyze a csh line... Well we cannot good
@ -35,7 +35,7 @@
*/
#include "sh.h"
RCSID("$Id: tw.parse.c,v 3.92 2002/06/25 19:02:12 christos Exp $")
RCSID("$Id: tw.parse.c,v 3.96 2004/01/23 16:21:33 christos Exp $")
#include "tw.h"
#include "ed.h"
@ -115,7 +115,8 @@ static int c_glob __P((Char ***));
static int is_prefix __P((Char *, Char *));
static int is_prefixmatch __P((Char *, Char *, int));
static int is_suffix __P((Char *, Char *));
static int recognize __P((Char *, Char *, int, int, int));
static int recognize __P((Char *, Char *, int, int, int,
int));
static int ignored __P((Char *));
static int isadirectory __P((Char *, Char *));
#ifndef __MVS__
@ -813,29 +814,19 @@ starting_a_command(wordstart, inputline)
* If we shorten it back to the prefix length, stop searching.
*/
static int
recognize(exp_name, item, name_length, numitems, enhanced)
recognize(exp_name, item, name_length, numitems, enhanced, igncase)
Char *exp_name, *item;
int name_length, numitems, enhanced;
int name_length, numitems, enhanced, igncase;
{
Char MCH1, MCH2;
register Char *x, *ent;
register int len = 0;
#ifdef WINNT_NATIVE
struct varent *vp;
int igncase;
igncase = (vp = adrof(STRcomplete)) != NULL && vp->vec != NULL &&
Strcmp(*(vp->vec), STRigncase) == 0;
#endif /* WINNT_NATIVE */
if (numitems == 1) { /* 1st match */
copyn(exp_name, item, MAXNAMLEN);
return (0);
}
if (!enhanced
#ifdef WINNT_NATIVE
&& !igncase
#endif /* WINNT_NATIVE */
) {
if (!enhanced && !igncase) {
for (x = exp_name, ent = item; *x && (*x & TRIM) == (*ent & TRIM); x++, ent++)
len++;
} else {
@ -890,7 +881,7 @@ tw_collect_items(command, looking, exp_dir, exp_name, target, pat, flags)
Char *item, *ptr;
Char buf[MAXPATHLEN+1];
struct varent *vp;
int len, enhanced;
int len, enhanced = 0;
int cnt = 0;
int igncase = 0;
@ -929,6 +920,23 @@ tw_collect_items(command, looking, exp_dir, exp_name, target, pat, flags)
break;
case TW_COMMAND:
#if defined(_UWIN) || defined(__CYGWIN__)
/* Turn foo.{exe,com,bat} into foo since UWIN's readdir returns
* the file with the .exe, .com, .bat extension
*/
{
size_t ext = strlen((char *)item) - 4;
if ((ext > 0) && (strcasecmp((char *)&item[ext], ".exe") == 0 ||
strcasecmp((char *)&item[ext], ".bat") == 0 ||
strcasecmp((char *)&item[ext], ".com") == 0))
{
item[ext] = '\0';
#if defined(__CYGWIN__)
strlwr((char *)item);
#endif /* __CYGWIN__ */
}
}
#endif /* _UWIN || __CYGWIN__ */
exec_check = flags & TW_EXEC_CHK;
dir_ok = flags & TW_DIR_OK;
break;
@ -988,11 +996,16 @@ tw_collect_items(command, looking, exp_dir, exp_name, target, pat, flags)
case RECOGNIZE_ALL:
case RECOGNIZE_SCROLL:
#ifdef WINNT_NATIVE
igncase = (vp = adrof(STRcomplete)) != NULL && vp->vec != NULL &&
Strcmp(*(vp->vec), STRigncase) == 0;
#endif /* WINNT_NATIVE */
enhanced = (vp = adrof(STRcomplete)) != NULL && !Strcmp(*(vp->vec),STRenhance);
if ((vp = adrof(STRcomplete)) != NULL && vp->vec != NULL) {
Char **cp;
for (cp = vp->vec; *cp; cp++) {
if (Strcmp(*cp, STRigncase) == 0)
igncase = 1;
if (Strcmp(*cp, STRenhance) == 0)
enhanced = 1;
}
}
if (enhanced || igncase) {
if (!is_prefixmatch(target, item, igncase))
break;
@ -1077,7 +1090,8 @@ tw_collect_items(command, looking, exp_dir, exp_name, target, pat, flags)
break;
}
}
if (recognize(exp_name, item, name_length, ++numitems, enhanced))
if (recognize(exp_name, item, name_length, ++numitems,
enhanced, igncase))
if (command != RECOGNIZE_SCROLL)
done = TRUE;
if (enhanced && (int)Strlen(exp_name) < name_length)
@ -2092,7 +2106,7 @@ print_by_column(dir, items, count, no_file_suffix)
}
else {
/* Print filename followed by '/' or '*' or ' ' */
xprintf("%S%c", items[i],
xprintf("\045S%c", items[i],
filetype(dir, items[i]));
w++;
}