View | Details | Raw Unified | Return to bug 207860 | Differences between
and this patch

Collapse All | Expand All

(-)bin/csh/Makefile (-1 / +4 lines)
Lines 24-30 Link Here
24
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
24
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
25
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
25
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
26
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
26
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
27
SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
27
SRCS+=	sh.decls.h glob.c glob.h dotlock.h dotlock.c mi.termios.c \
28
	mi.wait.h mi.varargs.h
28
SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
29
SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
29
	tw.comp.c tw.color.c
30
	tw.comp.c tw.color.c
30
SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
31
SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
Lines 59-64 Link Here
59
		greek:el_GR.UTF-8 \
60
		greek:el_GR.UTF-8 \
60
		italian:it_IT.UTF-8 \
61
		italian:it_IT.UTF-8 \
61
		ja:ja_JP.UTF-8 \
62
		ja:ja_JP.UTF-8 \
63
		pl:pl_PL.UTF-8 \
62
		russian:ru_RU.UTF-8 \
64
		russian:ru_RU.UTF-8 \
63
		spanish:es_ES.UTF-8 \
65
		spanish:es_ES.UTF-8 \
64
		ukrainian:uk_UA.UTF-8
66
		ukrainian:uk_UA.UTF-8
Lines 84-89 Link Here
84
NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
86
NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
85
		it_IT.ISO8859-15
87
		it_IT.ISO8859-15
86
NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
88
NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
89
NLSLINKS_pl_PL.UTF-8 = pl_PL.ISO8859-2
87
NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
90
NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
88
NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
91
NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
89
.else
92
.else
(-)contrib/tcsh/Copyright (+28 lines)
Line 0 Link Here
1
/*-
2
 * Copyright (c) 1980, 1991 The Regents of the University of California.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of the University nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
 * SUCH DAMAGE.
28
 */
(-)contrib/tcsh/FREEBSD-Xlist (+13 lines)
Lines 1-9 Link Here
1
$FreeBSD$
1
$FreeBSD$
2
*/.cvsignore
3
*/.gitignore
4
*/.travis.yml
5
*/Announce*
6
*/BUG-TRACKING
2
*/BUGS
7
*/BUGS
8
*/MAKERELEASE
9
*/Makefile.ADMIN
10
*/Makefile.man2html
11
*/RELEASE-PROCEDURE
12
*/bar
3
*/config/a*
13
*/config/a*
4
*/config/bs2000
14
*/config/bs2000
5
*/config/bsd
15
*/config/bsd
6
*/config/bsdreno
16
*/config/bsdreno
7
*/config/[c-z]*
17
*/config/[c-z]*
18
*/cygwin
19
*/m4
20
*/tcsh.vcproj
8
*/tests
21
*/tests
9
*/win32
22
*/win32
(-)contrib/tcsh/Fixes (+92 lines)
Lines 1-3 Link Here
1
 20. V6.20.00 - 20161124
2
 19. Don't resize the screen if it did not change size.
3
 18. V6.19.01 - 20161025
4
 17. restore file description when cleaning up after eval:
5
	repeat 99 time
6
 16. PR/572: Fix $SHLVL issue when exec'ing subshells.
7
 15. PR/403: Fix backquote expansion for multi-byte character sets.
8
 14. Fix drawing issu with multi-line prompt (Kensuke Iwahashi/David Kaspar)
9
 13. always send prusage to stdout.
10
 12. PR/526: Fix double \\ printing from previous fix in history expansion.
11
 11. Android updates from Corinna Vinschen
12
 10. PR/526: Quote backslashes properly so they can be preserved in ``
13
     expansions
14
  9. Fix memory leak for paraml
15
  8. Add notempty and ask values for the noclobber setting (Martin Tournoij)
16
  7. more correct $wordchars for vimode (Luke Mewburn)
17
  6. expose VImode in $vimode (Luke Mewburn)
18
  5. display what the compiled in editor is in bindkey -d (Luke Mewburn)
19
  4. run-fg-editor improvements and documentation (Luke Mewburn)
20
  3. Fix parsing of 'if (cond)then' (Fridolin Pokorny)
21
  2. PR/437: Fix handling of invalid unicode characters.
22
  1. PR/451: Fix error messages containing %c to be always '%c'
23
24
 41. V6.19.00 - 20150521
25
 40. V6.18.05 - 20150510
26
 39. fix reseting when interrupted inside an eval "eval sleep 10^C"
27
     (paulo.cesar.pereira.de.andrade)
28
 38. rename handle_intr -> handle_interrupt as originally intended.
29
 37. fix input tests that need stdin on a tty
30
 36. V6.18.04 - 20150504
31
 35. revert fix echo "\1", it is incorrect.
32
 34. revert fix to PR/437, breaks short strings.
33
 33. V6.18.03 - 20150503
34
 32. PR/437: Nakajima Akira: Fix segmentation fault reading input files
35
 31. PR/291: Print job status messages to stderr.
36
 30. Fridolin Pokorny NUL in `` does not mean EOF.
37
 29. Pavel Raiskup fix hang with:
38
	while (1)
39
	   ( date & ; wait )
40
        end
41
 28. Add cdtohome special variable (Martin Tournoij)
42
 27. Fix root prompt char for windows (Corinna Vinschen)
43
 26. For "next" completion matches only consider exact matches of the previous
44
     word (Jamie Landeg-Jones)
45
 25. Fix echo "\1" for echo_style=both where the first character was
46
     not processed properly (Gary Duzan)
47
 24. V6.18.02 - 20140618
48
 23. fix ls-F /non printing exit value twice.
49
 22. rename configure.in to configure.ac, add aclocal.m4 to CVS
50
 21. set foo="aabaabaa"; echo $foo:as/a// should produce bb
51
 20. Add locked merge history support (Marcin Konarski)
52
 19. Support more resource limits from various BSD's
53
 18. Cache history count to speed up thing
54
 17. PR/240: minix support 
55
 16. revert fix for 15. Causes extra quoting, for example (foo is a program
56
     that prints its arguments):
57
	$ ./foo 'abc' *
58
	'\a\b\c'
59
 15. fix globbing for ``, stripping backslashes. Example:
60
	cat << _EOF > huh
61
	echo 'hello\;world'
62
        _EOF
63
	echo `./huh 0`
64
	echo `./huh $?`
65
 14. fix for `` that causes hang. Example:
66
	cat << _EOF > huh
67
	#!/bin/sh
68
	echo "[$@]"
69
	echo "I am running"
70
	echo "I am running ($$)" >> huh.out
71
	_EOF
72
	cat << _EOF > huh.tcsh
73
	#!/bin/tcsh -f
74
75
	./huh \
76
	    `#comment blah blah blah` \
77
	    parameter a \
78
	    `#comment blah blah blah` \
79
	    parameter b \
80
	    `#comment blah blah blah` \
81
	    parameter c
82
	echo ok
83
	_EOF
84
 13. remove AsciiOnly fix now that the real issue has been fixed (Roman Kollar)
85
 12. define utmp file for aix (Laurence Darby)
86
 11. fix if history in loops
87
 10. make ls-F print to stderr and set the exit code
88
  9. make rmstar interruptible on linux
89
  8. Get rid of pret_t and make the printf functions return the number of
90
     characters printed as the system ones do.
91
  7. Parse a FreeBSD compat $LSCOLORS. What to do when both LSCOLORS and
92
     LS_COLORS are set. I am not documenting this until we decide.
1
  6. V6.18.01 - 20120214
93
  6. V6.18.01 - 20120214
2
  5. fix interruptible wait again
94
  5. fix interruptible wait again
3
  4. ignore bogus compiler overflow message
95
  4. ignore bogus compiler overflow message
(-)contrib/tcsh/Imakefile (-3 / +3 lines)
Lines 1-5 Link Here
1
XCOMM
1
XCOMM
2
XCOMM $tcsh: Imakefile,v 1.87 2010/01/28 19:01:05 christos Exp $
2
XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $
3
XCOMM
3
XCOMM
4
XCOMM Imakefile for tcsh 6.12
4
XCOMM Imakefile for tcsh 6.12
5
XCOMM Marc Horowitz, MIT SIPB
5
XCOMM Marc Horowitz, MIT SIPB
Lines 526-533 Link Here
526
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
526
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
527
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
527
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
528
	README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
528
	README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
529
	snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \
529
	snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \
530
	Makefile.win32
530
	Makefile.win32 aclocal.m4
531
CONFSRCS=config/[a-z]*
531
CONFSRCS=config/[a-z]*
532
532
533
533
(-)contrib/tcsh/Makefile.in (-33 / +17 lines)
Lines 1-4 Link Here
1
# $tcsh: Makefile.in,v 3.49 2011/02/05 17:35:31 christos Exp $
1
# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $
2
#	Makefile.in	4.3	6/11/83
2
#	Makefile.in	4.3	6/11/83
3
#
3
#
4
# C Shell with process control; VM/UNIX VAX Makefile
4
# C Shell with process control; VM/UNIX VAX Makefile
Lines 315-322 Link Here
315
# on the suns does not know how to make dynamically linked binaries.
315
# on the suns does not know how to make dynamically linked binaries.
316
# This is set by autoconf.
316
# This is set by autoconf.
317
CC = @CC@
317
CC = @CC@
318
#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra
318
#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra -Wcast-qual -Wwrite-strings -Wold-style-definition -Wuninitialized -Wpointer-sign
319
# -ansi -pedantic
319
# -Wconversion -Wformat=2 -ansi -pedantic
320
#CC=	gcc -Wall -pipe -B/bin/
320
#CC=	gcc -Wall -pipe -B/bin/
321
# Generate code for Intel 486 (linux)
321
# Generate code for Intel 486 (linux)
322
#CC=	gcc -m486 -pipe -Wall
322
#CC=	gcc -m486 -pipe -Wall
Lines 377-383 Link Here
377
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
377
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
378
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
378
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
379
	tw.color.c
379
	tw.color.c
380
PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
380
PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
381
	vms.termcap.c
381
	vms.termcap.c
382
SHSRCS= ${ASSRCS} ${PSSRCS}
382
SHSRCS= ${ASSRCS} ${PSSRCS}
383
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
383
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
Lines 384-390 Link Here
384
	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
384
	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
385
	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
385
	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
386
	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
386
	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
387
	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \
387
	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \
388
	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
388
	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
389
389
390
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
390
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
Lines 411-422 Link Here
411
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
411
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
412
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
412
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
413
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
413
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
414
	host.defs gethost.c tcsh.man2html configure.in configure config.h.in \
414
	host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \
415
	tests/testsuite.at
415
	tests/testsuite.at aclocal.m4
416
TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \
416
TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \
417
	tests/expr.at tests/lexical.at tests/mb-eucjp.at \
417
	tests/expr.at tests/lexical.at tests/mb-eucjp.at \
418
	tests/mb-utf8.at tests/noexec.at tests/syntax.at tests/subst.at \
418
	tests/mb-utf8.at tests/noexec.at tests/parenthesis.at tests/syntax.at \
419
	tests/variables.at tests/sh.dol.at
419
	tests/subst.at tests/variables.at tests/sh.dol.at
420
420
421
VHSRCS=${PVSRCS} ${AVSRCS}
421
VHSRCS=${PVSRCS} ${AVSRCS}
422
422
Lines 533-543 Link Here
533
	${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
533
	${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
534
	    $(srcdir)/tc.const.c | \
534
	    $(srcdir)/tc.const.c | \
535
	    sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
535
	    sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
536
	    sort >> $@.tmp
536
	    LC_COLLATE=C sort >> $@.tmp
537
	@echo '#endif /* _h_tc_const */' >> $@.tmp
537
	@echo '#endif /* _h_tc_const */' >> $@.tmp
538
	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
538
	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
539
539
540
$(srcdir)/tests/package.m4: $(srcdir)/configure.in
540
$(srcdir)/tests/package.m4: $(srcdir)/configure.ac
541
	{								   \
541
	{								   \
542
	  echo '# Signature of the current package.';			   \
542
	  echo '# Signature of the current package.';			   \
543
	  echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])';	   \
543
	  echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])';	   \
Lines 594-605 Link Here
594
	@vgrind -t -x -h Index index >/crp/bill/csh/index.t
594
	@vgrind -t -x -h Index index >/crp/bill/csh/index.t
595
595
596
install-strip: install
596
install-strip: install
597
	-strip ${DESTBIN}/tcsh$(EXEEXT)
597
598
598
install: tcsh$(EXEEXT) install.catalogs install.man
599
install: tcsh$(EXEEXT) install.catalogs install.man
599
	-mkdir -p ${DESTBIN}
600
	-mkdir -p ${DESTBIN}
600
	-mv -f ${DESTBIN}/tcsh$(EXEEXT)  ${DESTBIN}/tcsh.old
601
	-mv -f ${DESTBIN}/tcsh$(EXEEXT)  ${DESTBIN}/tcsh.old
601
	cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
602
	cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
602
	-strip ${DESTBIN}/tcsh$(EXEEXT)
603
	chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
603
	chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
604
604
605
install.catalogs:
605
install.catalogs:
Lines 623-647 Link Here
623
#	nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z
623
#	nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z
624
#	chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
624
#	chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
625
625
626
install.cygwin: install
627
	-gzip ${DESTMAN}/tcsh.${MANSECT}
628
	-mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh
629
	cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh
630
	cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh
631
	cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh
632
	perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man
633
	cp -rp tcsh.html ${DESTDIR}${prefix}/share/doc/tcsh
634
	-mkdir -p ${DESTDIR}/etc/defaults/etc/profile.d
635
	-mkdir -p ${DESTDIR}/etc/profile.d
636
	-mkdir -p ${DESTDIR}/etc/postinstall
637
	-mkdir -p ${DESTDIR}/etc/preremove
638
	cp -p ${srcdir}/cygwin/csh.cshrc ${DESTDIR}/etc/defaults/etc
639
	cp -p ${srcdir}/cygwin/csh.login ${DESTDIR}/etc/defaults/etc
640
	cp -p ${srcdir}/cygwin/bindkey.tcsh ${DESTDIR}/etc/defaults/etc/profile.d
641
	cp -p ${srcdir}/complete.tcsh ${DESTDIR}/etc/defaults/etc/profile.d
642
	cp -p ${srcdir}/cygwin/postinstall.sh ${DESTDIR}/etc/postinstall/tcsh.sh
643
	cp -p ${srcdir}/cygwin/preremove.sh ${DESTDIR}/etc/preremove/tcsh.sh
644
645
clean: clean.catalogs
626
clean: clean.catalogs
646
	${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost
627
	${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost
647
	${RM} -f *.${SUF} *.i *.s
628
	${RM} -f *.${SUF} *.i *.s
Lines 748-758 Link Here
748
729
749
autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
730
autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
750
731
751
$(srcdir)/configure: $(srcdir)/configure.in
732
$(srcdir)/configure: $(srcdir)/configure.ac
752
	cd $(srcdir) && autoconf
733
	cd $(srcdir) && autoconf
753
734
754
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
735
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
755
$(srcdir)/stamp-h.in: $(srcdir)/configure.in
736
$(srcdir)/stamp-h.in: $(srcdir)/configure.ac
756
	cd $(srcdir) && autoheader
737
	cd $(srcdir) && autoheader
757
	@echo timestamp > $(srcdir)/stamp-h.in
738
	@echo timestamp > $(srcdir)/stamp-h.in
758
739
Lines 787-792 Link Here
787
# glob.h
768
# glob.h
788
glob.${SUF} sh.glob.${SUF}: glob.h
769
glob.${SUF} sh.glob.${SUF}: glob.h
789
770
771
# dotlock.h
772
dotlock.${SUF}: dotlock.h
773
790
# ed.defns.h
774
# ed.defns.h
791
EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
775
EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
792
${EDOBJS} ${EDDINC}: ed.defns.h
776
${EDOBJS} ${EDDINC}: ed.defns.h
(-)contrib/tcsh/Makefile.std (-7 / +11 lines)
Lines 1-4 Link Here
1
# $tcsh: Makefile.std,v 1.97 2006/03/02 18:46:44 christos Exp $
1
# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $
2
#	Makefile.std	4.3	6/11/83
2
#	Makefile.std	4.3	6/11/83
3
#
3
#
4
# C Shell with process control; VM/UNIX VAX Makefile
4
# C Shell with process control; VM/UNIX VAX Makefile
Lines 287-293 Link Here
287
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
287
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
288
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
288
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
289
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 
289
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 
290
PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
290
PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
291
	vms.termcap.c
291
	vms.termcap.c
292
SHSRCS= ${ASSRCS} ${PSSRCS}
292
SHSRCS= ${ASSRCS} ${PSSRCS}
293
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
293
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
Lines 294-300 Link Here
294
	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
294
	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
295
	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
295
	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
296
	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
296
	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
297
	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \
297
	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \
298
	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
298
	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
299
299
300
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
300
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
Lines 321-327 Link Here
321
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
321
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
322
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
322
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
323
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
323
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
324
	host.defs gethost.c tcsh.man2html configure.in configure config.h.in
324
	host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \
325
	aclocal.m4
325
326
326
VHSRCS=${PVSRCS} ${AVSRCS}
327
VHSRCS=${PVSRCS} ${AVSRCS}
327
328
Lines 424-430 Link Here
424
	${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
425
	${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
425
	    $(srcdir)/tc.const.c | grep 'Char STR' | \
426
	    $(srcdir)/tc.const.c | grep 'Char STR' | \
426
	    sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \
427
	    sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \
427
	    sort >> $@
428
	    LC_COLLATE=C sort >> $@
428
	@echo '#endif /* _h_tc_const */' >> $@
429
	@echo '#endif /* _h_tc_const */' >> $@
429
430
430
csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
431
csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
Lines 584-594 Link Here
584
585
585
autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
586
autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
586
587
587
$(srcdir)/configure: $(srcdir)/configure.in
588
$(srcdir)/configure: $(srcdir)/configure.ac
588
	cd $(srcdir) && autoconf
589
	cd $(srcdir) && autoconf
589
590
590
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
591
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
591
$(srcdir)/stamp-h.in: $(srcdir)/configure.in
592
$(srcdir)/stamp-h.in: $(srcdir)/configure.ac
592
	cd $(srcdir) && autoheader
593
	cd $(srcdir) && autoheader
593
	@echo timestamp > $(srcdir)/stamp-h.in
594
	@echo timestamp > $(srcdir)/stamp-h.in
594
595
Lines 620-625 Link Here
620
# glob.h
621
# glob.h
621
glob.${SUF} sh.glob.${SUF}: glob.h
622
glob.${SUF} sh.glob.${SUF}: glob.h
622
623
624
# dotlock.h
625
dotlock.${SUF}: dotlock.h
626
623
# ed.defns.h
627
# ed.defns.h
624
EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
628
EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
625
${EDOBJS} ${EDDINC}: ed.defns.h
629
${EDOBJS} ${EDDINC}: ed.defns.h
(-)contrib/tcsh/Makefile.vms (-2 / +2 lines)
Lines 1-4 Link Here
1
# $tcsh: Makefile.vms,v 1.39 2006/03/02 18:46:44 christos Exp $
1
# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $
2
#	Makefile.vms	4.3	6/11/83
2
#	Makefile.vms	4.3	6/11/83
3
#
3
#
4
# C Shell with process control; VM/UNIX VAX Makefile
4
# C Shell with process control; VM/UNIX VAX Makefile
Lines 299-305 Link Here
299
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
299
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
300
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
300
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
301
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
301
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
302
	host.defs gethost.c tcsh.man2html configure.in
302
	host.defs gethost.c tcsh.man2html configure.ac aclocal.m4
303
303
304
VHSRCS=${PVSRCS} ${AVSRCS}
304
VHSRCS=${PVSRCS} ${AVSRCS}
305
305
(-)contrib/tcsh/README (-1 / +1 lines)
Lines 1-4 Link Here
1
This is tcsh version 6.18.01.  Tcsh is a version of the Berkeley
1
This is tcsh version 6.20.00.  Tcsh is a version of the Berkeley
2
C-Shell, with the addition of: a command line editor, command and file
2
C-Shell, with the addition of: a command line editor, command and file
3
name completion, listing, etc. and a bunch of small additions to the
3
name completion, listing, etc. and a bunch of small additions to the
4
shell itself.
4
shell itself.
(-)contrib/tcsh/aclocal.m4 (+1409 lines)
Line 0 Link Here
1
# generated automatically by aclocal 1.15 -*- Autoconf -*-
2
3
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4
5
# This file is free software; the Free Software Foundation
6
# gives unlimited permission to copy and/or distribute it,
7
# with or without modifications, as long as this notice is preserved.
8
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
# PARTICULAR PURPOSE.
13
14
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15
# iconv.m4 serial 19 (gettext-0.18.2)
16
dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
17
dnl This file is free software; the Free Software Foundation
18
dnl gives unlimited permission to copy and/or distribute it,
19
dnl with or without modifications, as long as this notice is preserved.
20
21
dnl From Bruno Haible.
22
23
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
24
[
25
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
26
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
27
  AC_REQUIRE([AC_LIB_RPATH])
28
29
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
30
  dnl accordingly.
31
  AC_LIB_LINKFLAGS_BODY([iconv])
32
])
33
34
AC_DEFUN([AM_ICONV_LINK],
35
[
36
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
37
  dnl those with the standalone portable GNU libiconv installed).
38
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
39
40
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
41
  dnl accordingly.
42
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
43
44
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
45
  dnl because if the user has installed libiconv and not disabled its use
46
  dnl via --without-libiconv-prefix, he wants to use it. The first
47
  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
48
  am_save_CPPFLAGS="$CPPFLAGS"
49
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
50
51
  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
52
    am_cv_func_iconv="no, consider installing GNU libiconv"
53
    am_cv_lib_iconv=no
54
    AC_LINK_IFELSE(
55
      [AC_LANG_PROGRAM(
56
         [[
57
#include <stdlib.h>
58
#include <iconv.h>
59
         ]],
60
         [[iconv_t cd = iconv_open("","");
61
           iconv(cd,NULL,NULL,NULL,NULL);
62
           iconv_close(cd);]])],
63
      [am_cv_func_iconv=yes])
64
    if test "$am_cv_func_iconv" != yes; then
65
      am_save_LIBS="$LIBS"
66
      LIBS="$LIBS $LIBICONV"
67
      AC_LINK_IFELSE(
68
        [AC_LANG_PROGRAM(
69
           [[
70
#include <stdlib.h>
71
#include <iconv.h>
72
           ]],
73
           [[iconv_t cd = iconv_open("","");
74
             iconv(cd,NULL,NULL,NULL,NULL);
75
             iconv_close(cd);]])],
76
        [am_cv_lib_iconv=yes]
77
        [am_cv_func_iconv=yes])
78
      LIBS="$am_save_LIBS"
79
    fi
80
  ])
81
  if test "$am_cv_func_iconv" = yes; then
82
    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
83
      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
84
      dnl Solaris 10.
85
      am_save_LIBS="$LIBS"
86
      if test $am_cv_lib_iconv = yes; then
87
        LIBS="$LIBS $LIBICONV"
88
      fi
89
      am_cv_func_iconv_works=no
90
      for ac_iconv_const in '' 'const'; do
91
        AC_RUN_IFELSE(
92
          [AC_LANG_PROGRAM(
93
             [[
94
#include <iconv.h>
95
#include <string.h>
96
97
#ifndef ICONV_CONST
98
# define ICONV_CONST $ac_iconv_const
99
#endif
100
             ]],
101
             [[int result = 0;
102
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
103
     returns.  */
104
  {
105
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
106
    if (cd_utf8_to_88591 != (iconv_t)(-1))
107
      {
108
        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
109
        char buf[10];
110
        ICONV_CONST char *inptr = input;
111
        size_t inbytesleft = strlen (input);
112
        char *outptr = buf;
113
        size_t outbytesleft = sizeof (buf);
114
        size_t res = iconv (cd_utf8_to_88591,
115
                            &inptr, &inbytesleft,
116
                            &outptr, &outbytesleft);
117
        if (res == 0)
118
          result |= 1;
119
        iconv_close (cd_utf8_to_88591);
120
      }
121
  }
122
  /* Test against Solaris 10 bug: Failures are not distinguishable from
123
     successful returns.  */
124
  {
125
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
126
    if (cd_ascii_to_88591 != (iconv_t)(-1))
127
      {
128
        static ICONV_CONST char input[] = "\263";
129
        char buf[10];
130
        ICONV_CONST char *inptr = input;
131
        size_t inbytesleft = strlen (input);
132
        char *outptr = buf;
133
        size_t outbytesleft = sizeof (buf);
134
        size_t res = iconv (cd_ascii_to_88591,
135
                            &inptr, &inbytesleft,
136
                            &outptr, &outbytesleft);
137
        if (res == 0)
138
          result |= 2;
139
        iconv_close (cd_ascii_to_88591);
140
      }
141
  }
142
  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
143
  {
144
    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
145
    if (cd_88591_to_utf8 != (iconv_t)(-1))
146
      {
147
        static ICONV_CONST char input[] = "\304";
148
        static char buf[2] = { (char)0xDE, (char)0xAD };
149
        ICONV_CONST char *inptr = input;
150
        size_t inbytesleft = 1;
151
        char *outptr = buf;
152
        size_t outbytesleft = 1;
153
        size_t res = iconv (cd_88591_to_utf8,
154
                            &inptr, &inbytesleft,
155
                            &outptr, &outbytesleft);
156
        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
157
          result |= 4;
158
        iconv_close (cd_88591_to_utf8);
159
      }
160
  }
161
#if 0 /* This bug could be worked around by the caller.  */
162
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
163
  {
164
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
165
    if (cd_88591_to_utf8 != (iconv_t)(-1))
166
      {
167
        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
168
        char buf[50];
169
        ICONV_CONST char *inptr = input;
170
        size_t inbytesleft = strlen (input);
171
        char *outptr = buf;
172
        size_t outbytesleft = sizeof (buf);
173
        size_t res = iconv (cd_88591_to_utf8,
174
                            &inptr, &inbytesleft,
175
                            &outptr, &outbytesleft);
176
        if ((int)res > 0)
177
          result |= 8;
178
        iconv_close (cd_88591_to_utf8);
179
      }
180
  }
181
#endif
182
  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
183
     provided.  */
184
  if (/* Try standardized names.  */
185
      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
186
      /* Try IRIX, OSF/1 names.  */
187
      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
188
      /* Try AIX names.  */
189
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
190
      /* Try HP-UX names.  */
191
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
192
    result |= 16;
193
  return result;
194
]])],
195
          [am_cv_func_iconv_works=yes], ,
196
          [case "$host_os" in
197
             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
198
             *)            am_cv_func_iconv_works="guessing yes" ;;
199
           esac])
200
        test "$am_cv_func_iconv_works" = no || break
201
      done
202
      LIBS="$am_save_LIBS"
203
    ])
204
    case "$am_cv_func_iconv_works" in
205
      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
206
      *)   am_func_iconv=yes ;;
207
    esac
208
  else
209
    am_func_iconv=no am_cv_lib_iconv=no
210
  fi
211
  if test "$am_func_iconv" = yes; then
212
    AC_DEFINE([HAVE_ICONV], [1],
213
      [Define if you have the iconv() function and it works.])
214
  fi
215
  if test "$am_cv_lib_iconv" = yes; then
216
    AC_MSG_CHECKING([how to link with libiconv])
217
    AC_MSG_RESULT([$LIBICONV])
218
  else
219
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
220
    dnl either.
221
    CPPFLAGS="$am_save_CPPFLAGS"
222
    LIBICONV=
223
    LTLIBICONV=
224
  fi
225
  AC_SUBST([LIBICONV])
226
  AC_SUBST([LTLIBICONV])
227
])
228
229
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
230
dnl avoid warnings like
231
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
232
dnl This is tricky because of the way 'aclocal' is implemented:
233
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
234
dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
235
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
236
dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
237
dnl   warnings.
238
m4_define([gl_iconv_AC_DEFUN],
239
  m4_version_prereq([2.64],
240
    [[AC_DEFUN_ONCE(
241
        [$1], [$2])]],
242
    [m4_ifdef([gl_00GNULIB],
243
       [[AC_DEFUN_ONCE(
244
           [$1], [$2])]],
245
       [[AC_DEFUN(
246
           [$1], [$2])]])]))
247
gl_iconv_AC_DEFUN([AM_ICONV],
248
[
249
  AM_ICONV_LINK
250
  if test "$am_cv_func_iconv" = yes; then
251
    AC_MSG_CHECKING([for iconv declaration])
252
    AC_CACHE_VAL([am_cv_proto_iconv], [
253
      AC_COMPILE_IFELSE(
254
        [AC_LANG_PROGRAM(
255
           [[
256
#include <stdlib.h>
257
#include <iconv.h>
258
extern
259
#ifdef __cplusplus
260
"C"
261
#endif
262
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
263
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
264
#else
265
size_t iconv();
266
#endif
267
           ]],
268
           [[]])],
269
        [am_cv_proto_iconv_arg1=""],
270
        [am_cv_proto_iconv_arg1="const"])
271
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
272
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
273
    AC_MSG_RESULT([
274
         $am_cv_proto_iconv])
275
    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
276
      [Define as const if the declaration of iconv() needs const.])
277
    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
278
    m4_ifdef([gl_ICONV_H_DEFAULTS],
279
      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
280
       if test -n "$am_cv_proto_iconv_arg1"; then
281
         ICONV_CONST="const"
282
       fi
283
      ])
284
  fi
285
])
286
287
# lib-ld.m4 serial 6
288
dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc.
289
dnl This file is free software; the Free Software Foundation
290
dnl gives unlimited permission to copy and/or distribute it,
291
dnl with or without modifications, as long as this notice is preserved.
292
293
dnl Subroutines of libtool.m4,
294
dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
295
dnl collision with libtool.m4.
296
297
dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
298
AC_DEFUN([AC_LIB_PROG_LD_GNU],
299
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
300
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
301
case `$LD -v 2>&1 </dev/null` in
302
*GNU* | *'with BFD'*)
303
  acl_cv_prog_gnu_ld=yes
304
  ;;
305
*)
306
  acl_cv_prog_gnu_ld=no
307
  ;;
308
esac])
309
with_gnu_ld=$acl_cv_prog_gnu_ld
310
])
311
312
dnl From libtool-2.4. Sets the variable LD.
313
AC_DEFUN([AC_LIB_PROG_LD],
314
[AC_REQUIRE([AC_PROG_CC])dnl
315
AC_REQUIRE([AC_CANONICAL_HOST])dnl
316
317
AC_ARG_WITH([gnu-ld],
318
    [AS_HELP_STRING([--with-gnu-ld],
319
        [assume the C compiler uses GNU ld [default=no]])],
320
    [test "$withval" = no || with_gnu_ld=yes],
321
    [with_gnu_ld=no])dnl
322
323
# Prepare PATH_SEPARATOR.
324
# The user is always right.
325
if test "${PATH_SEPARATOR+set}" != set; then
326
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
327
  # contains only /bin. Note that ksh looks also at the FPATH variable,
328
  # so we have to set that as well for the test.
329
  PATH_SEPARATOR=:
330
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
331
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
332
           || PATH_SEPARATOR=';'
333
       }
334
fi
335
336
ac_prog=ld
337
if test "$GCC" = yes; then
338
  # Check if gcc -print-prog-name=ld gives a path.
339
  AC_MSG_CHECKING([for ld used by $CC])
340
  case $host in
341
  *-*-mingw*)
342
    # gcc leaves a trailing carriage return which upsets mingw
343
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
344
  *)
345
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
346
  esac
347
  case $ac_prog in
348
    # Accept absolute paths.
349
    [[\\/]]* | ?:[[\\/]]*)
350
      re_direlt='/[[^/]][[^/]]*/\.\./'
351
      # Canonicalize the pathname of ld
352
      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
353
      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
354
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
355
      done
356
      test -z "$LD" && LD="$ac_prog"
357
      ;;
358
  "")
359
    # If it fails, then pretend we aren't using GCC.
360
    ac_prog=ld
361
    ;;
362
  *)
363
    # If it is relative, then search for the first ld in PATH.
364
    with_gnu_ld=unknown
365
    ;;
366
  esac
367
elif test "$with_gnu_ld" = yes; then
368
  AC_MSG_CHECKING([for GNU ld])
369
else
370
  AC_MSG_CHECKING([for non-GNU ld])
371
fi
372
AC_CACHE_VAL([acl_cv_path_LD],
373
[if test -z "$LD"; then
374
  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
375
  for ac_dir in $PATH; do
376
    IFS="$acl_save_ifs"
377
    test -z "$ac_dir" && ac_dir=.
378
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
379
      acl_cv_path_LD="$ac_dir/$ac_prog"
380
      # Check to see if the program is GNU ld.  I'd rather use --version,
381
      # but apparently some variants of GNU ld only accept -v.
382
      # Break only if it was the GNU/non-GNU ld that we prefer.
383
      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
384
      *GNU* | *'with BFD'*)
385
        test "$with_gnu_ld" != no && break
386
        ;;
387
      *)
388
        test "$with_gnu_ld" != yes && break
389
        ;;
390
      esac
391
    fi
392
  done
393
  IFS="$acl_save_ifs"
394
else
395
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
396
fi])
397
LD="$acl_cv_path_LD"
398
if test -n "$LD"; then
399
  AC_MSG_RESULT([$LD])
400
else
401
  AC_MSG_RESULT([no])
402
fi
403
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
404
AC_LIB_PROG_LD_GNU
405
])
406
407
# lib-link.m4 serial 26 (gettext-0.18.2)
408
dnl Copyright (C) 2001-2014 Free Software Foundation, Inc.
409
dnl This file is free software; the Free Software Foundation
410
dnl gives unlimited permission to copy and/or distribute it,
411
dnl with or without modifications, as long as this notice is preserved.
412
413
dnl From Bruno Haible.
414
415
AC_PREREQ([2.54])
416
417
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
418
dnl the libraries corresponding to explicit and implicit dependencies.
419
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
420
dnl augments the CPPFLAGS variable.
421
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
422
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
423
AC_DEFUN([AC_LIB_LINKFLAGS],
424
[
425
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
426
  AC_REQUIRE([AC_LIB_RPATH])
427
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
428
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
429
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
430
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
431
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
432
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
433
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
434
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
435
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
436
  ])
437
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
438
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
439
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
440
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
441
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
442
  AC_SUBST([LIB]NAME)
443
  AC_SUBST([LTLIB]NAME)
444
  AC_SUBST([LIB]NAME[_PREFIX])
445
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
446
  dnl results of this search when this library appears as a dependency.
447
  HAVE_LIB[]NAME=yes
448
  popdef([NAME])
449
  popdef([Name])
450
])
451
452
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
453
dnl searches for libname and the libraries corresponding to explicit and
454
dnl implicit dependencies, together with the specified include files and
455
dnl the ability to compile and link the specified testcode. The missing-message
456
dnl defaults to 'no' and may contain additional hints for the user.
457
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
458
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
459
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
460
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
461
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
462
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
463
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
464
[
465
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
466
  AC_REQUIRE([AC_LIB_RPATH])
467
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
468
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
469
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
470
471
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
472
  dnl accordingly.
473
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
474
475
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
476
  dnl because if the user has installed lib[]Name and not disabled its use
477
  dnl via --without-lib[]Name-prefix, he wants to use it.
478
  ac_save_CPPFLAGS="$CPPFLAGS"
479
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
480
481
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
482
    ac_save_LIBS="$LIBS"
483
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
484
    dnl because these -l options might require -L options that are present in
485
    dnl LIBS. -l options benefit only from the -L options listed before it.
486
    dnl Otherwise, add it to the front of LIBS, because it may be a static
487
    dnl library that depends on another static library that is present in LIBS.
488
    dnl Static libraries benefit only from the static libraries listed after
489
    dnl it.
490
    case " $LIB[]NAME" in
491
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
492
      *)       LIBS="$LIB[]NAME $LIBS" ;;
493
    esac
494
    AC_LINK_IFELSE(
495
      [AC_LANG_PROGRAM([[$3]], [[$4]])],
496
      [ac_cv_lib[]Name=yes],
497
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
498
    LIBS="$ac_save_LIBS"
499
  ])
500
  if test "$ac_cv_lib[]Name" = yes; then
501
    HAVE_LIB[]NAME=yes
502
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
503
    AC_MSG_CHECKING([how to link with lib[]$1])
504
    AC_MSG_RESULT([$LIB[]NAME])
505
  else
506
    HAVE_LIB[]NAME=no
507
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
508
    dnl $INC[]NAME either.
509
    CPPFLAGS="$ac_save_CPPFLAGS"
510
    LIB[]NAME=
511
    LTLIB[]NAME=
512
    LIB[]NAME[]_PREFIX=
513
  fi
514
  AC_SUBST([HAVE_LIB]NAME)
515
  AC_SUBST([LIB]NAME)
516
  AC_SUBST([LTLIB]NAME)
517
  AC_SUBST([LIB]NAME[_PREFIX])
518
  popdef([NAME])
519
  popdef([Name])
520
])
521
522
dnl Determine the platform dependent parameters needed to use rpath:
523
dnl   acl_libext,
524
dnl   acl_shlibext,
525
dnl   acl_libname_spec,
526
dnl   acl_library_names_spec,
527
dnl   acl_hardcode_libdir_flag_spec,
528
dnl   acl_hardcode_libdir_separator,
529
dnl   acl_hardcode_direct,
530
dnl   acl_hardcode_minus_L.
531
AC_DEFUN([AC_LIB_RPATH],
532
[
533
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
534
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
535
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
536
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
537
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
538
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
539
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
540
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
541
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
542
    . ./conftest.sh
543
    rm -f ./conftest.sh
544
    acl_cv_rpath=done
545
  ])
546
  wl="$acl_cv_wl"
547
  acl_libext="$acl_cv_libext"
548
  acl_shlibext="$acl_cv_shlibext"
549
  acl_libname_spec="$acl_cv_libname_spec"
550
  acl_library_names_spec="$acl_cv_library_names_spec"
551
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
552
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
553
  acl_hardcode_direct="$acl_cv_hardcode_direct"
554
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
555
  dnl Determine whether the user wants rpath handling at all.
556
  AC_ARG_ENABLE([rpath],
557
    [  --disable-rpath         do not hardcode runtime library paths],
558
    :, enable_rpath=yes)
559
])
560
561
dnl AC_LIB_FROMPACKAGE(name, package)
562
dnl declares that libname comes from the given package. The configure file
563
dnl will then not have a --with-libname-prefix option but a
564
dnl --with-package-prefix option. Several libraries can come from the same
565
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
566
dnl macro call that searches for libname.
567
AC_DEFUN([AC_LIB_FROMPACKAGE],
568
[
569
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
570
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
571
  define([acl_frompackage_]NAME, [$2])
572
  popdef([NAME])
573
  pushdef([PACK],[$2])
574
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
575
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
576
  define([acl_libsinpackage_]PACKUP,
577
    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
578
  popdef([PACKUP])
579
  popdef([PACK])
580
])
581
582
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
583
dnl the libraries corresponding to explicit and implicit dependencies.
584
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
585
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
586
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
587
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
588
[
589
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
590
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
591
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
592
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
593
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
594
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
595
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
596
  dnl Autoconf >= 2.61 supports dots in --with options.
597
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
598
  dnl By default, look in $includedir and $libdir.
599
  use_additional=yes
600
  AC_LIB_WITH_FINAL_PREFIX([
601
    eval additional_includedir=\"$includedir\"
602
    eval additional_libdir=\"$libdir\"
603
  ])
604
  AC_ARG_WITH(P_A_C_K[-prefix],
605
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
606
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
607
[
608
    if test "X$withval" = "Xno"; then
609
      use_additional=no
610
    else
611
      if test "X$withval" = "X"; then
612
        AC_LIB_WITH_FINAL_PREFIX([
613
          eval additional_includedir=\"$includedir\"
614
          eval additional_libdir=\"$libdir\"
615
        ])
616
      else
617
        additional_includedir="$withval/include"
618
        additional_libdir="$withval/$acl_libdirstem"
619
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
620
           && ! test -d "$withval/$acl_libdirstem"; then
621
          additional_libdir="$withval/$acl_libdirstem2"
622
        fi
623
      fi
624
    fi
625
])
626
  dnl Search the library and its dependencies in $additional_libdir and
627
  dnl $LDFLAGS. Using breadth-first-seach.
628
  LIB[]NAME=
629
  LTLIB[]NAME=
630
  INC[]NAME=
631
  LIB[]NAME[]_PREFIX=
632
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
633
  dnl computed. So it has to be reset here.
634
  HAVE_LIB[]NAME=
635
  rpathdirs=
636
  ltrpathdirs=
637
  names_already_handled=
638
  names_next_round='$1 $2'
639
  while test -n "$names_next_round"; do
640
    names_this_round="$names_next_round"
641
    names_next_round=
642
    for name in $names_this_round; do
643
      already_handled=
644
      for n in $names_already_handled; do
645
        if test "$n" = "$name"; then
646
          already_handled=yes
647
          break
648
        fi
649
      done
650
      if test -z "$already_handled"; then
651
        names_already_handled="$names_already_handled $name"
652
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
653
        dnl or AC_LIB_HAVE_LINKFLAGS call.
654
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
655
        eval value=\"\$HAVE_LIB$uppername\"
656
        if test -n "$value"; then
657
          if test "$value" = yes; then
658
            eval value=\"\$LIB$uppername\"
659
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
660
            eval value=\"\$LTLIB$uppername\"
661
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
662
          else
663
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
664
            dnl that this library doesn't exist. So just drop it.
665
            :
666
          fi
667
        else
668
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
669
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
670
          found_dir=
671
          found_la=
672
          found_so=
673
          found_a=
674
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
675
          if test -n "$acl_shlibext"; then
676
            shrext=".$acl_shlibext"             # typically: shrext=.so
677
          else
678
            shrext=
679
          fi
680
          if test $use_additional = yes; then
681
            dir="$additional_libdir"
682
            dnl The same code as in the loop below:
683
            dnl First look for a shared library.
684
            if test -n "$acl_shlibext"; then
685
              if test -f "$dir/$libname$shrext"; then
686
                found_dir="$dir"
687
                found_so="$dir/$libname$shrext"
688
              else
689
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
690
                  ver=`(cd "$dir" && \
691
                        for f in "$libname$shrext".*; do echo "$f"; done \
692
                        | sed -e "s,^$libname$shrext\\\\.,," \
693
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
694
                        | sed 1q ) 2>/dev/null`
695
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
696
                    found_dir="$dir"
697
                    found_so="$dir/$libname$shrext.$ver"
698
                  fi
699
                else
700
                  eval library_names=\"$acl_library_names_spec\"
701
                  for f in $library_names; do
702
                    if test -f "$dir/$f"; then
703
                      found_dir="$dir"
704
                      found_so="$dir/$f"
705
                      break
706
                    fi
707
                  done
708
                fi
709
              fi
710
            fi
711
            dnl Then look for a static library.
712
            if test "X$found_dir" = "X"; then
713
              if test -f "$dir/$libname.$acl_libext"; then
714
                found_dir="$dir"
715
                found_a="$dir/$libname.$acl_libext"
716
              fi
717
            fi
718
            if test "X$found_dir" != "X"; then
719
              if test -f "$dir/$libname.la"; then
720
                found_la="$dir/$libname.la"
721
              fi
722
            fi
723
          fi
724
          if test "X$found_dir" = "X"; then
725
            for x in $LDFLAGS $LTLIB[]NAME; do
726
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
727
              case "$x" in
728
                -L*)
729
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
730
                  dnl First look for a shared library.
731
                  if test -n "$acl_shlibext"; then
732
                    if test -f "$dir/$libname$shrext"; then
733
                      found_dir="$dir"
734
                      found_so="$dir/$libname$shrext"
735
                    else
736
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
737
                        ver=`(cd "$dir" && \
738
                              for f in "$libname$shrext".*; do echo "$f"; done \
739
                              | sed -e "s,^$libname$shrext\\\\.,," \
740
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
741
                              | sed 1q ) 2>/dev/null`
742
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
743
                          found_dir="$dir"
744
                          found_so="$dir/$libname$shrext.$ver"
745
                        fi
746
                      else
747
                        eval library_names=\"$acl_library_names_spec\"
748
                        for f in $library_names; do
749
                          if test -f "$dir/$f"; then
750
                            found_dir="$dir"
751
                            found_so="$dir/$f"
752
                            break
753
                          fi
754
                        done
755
                      fi
756
                    fi
757
                  fi
758
                  dnl Then look for a static library.
759
                  if test "X$found_dir" = "X"; then
760
                    if test -f "$dir/$libname.$acl_libext"; then
761
                      found_dir="$dir"
762
                      found_a="$dir/$libname.$acl_libext"
763
                    fi
764
                  fi
765
                  if test "X$found_dir" != "X"; then
766
                    if test -f "$dir/$libname.la"; then
767
                      found_la="$dir/$libname.la"
768
                    fi
769
                  fi
770
                  ;;
771
              esac
772
              if test "X$found_dir" != "X"; then
773
                break
774
              fi
775
            done
776
          fi
777
          if test "X$found_dir" != "X"; then
778
            dnl Found the library.
779
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
780
            if test "X$found_so" != "X"; then
781
              dnl Linking with a shared library. We attempt to hardcode its
782
              dnl directory into the executable's runpath, unless it's the
783
              dnl standard /usr/lib.
784
              if test "$enable_rpath" = no \
785
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
786
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
787
                dnl No hardcoding is needed.
788
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
789
              else
790
                dnl Use an explicit option to hardcode DIR into the resulting
791
                dnl binary.
792
                dnl Potentially add DIR to ltrpathdirs.
793
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
794
                haveit=
795
                for x in $ltrpathdirs; do
796
                  if test "X$x" = "X$found_dir"; then
797
                    haveit=yes
798
                    break
799
                  fi
800
                done
801
                if test -z "$haveit"; then
802
                  ltrpathdirs="$ltrpathdirs $found_dir"
803
                fi
804
                dnl The hardcoding into $LIBNAME is system dependent.
805
                if test "$acl_hardcode_direct" = yes; then
806
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
807
                  dnl resulting binary.
808
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
809
                else
810
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
811
                    dnl Use an explicit option to hardcode DIR into the resulting
812
                    dnl binary.
813
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
814
                    dnl Potentially add DIR to rpathdirs.
815
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
816
                    haveit=
817
                    for x in $rpathdirs; do
818
                      if test "X$x" = "X$found_dir"; then
819
                        haveit=yes
820
                        break
821
                      fi
822
                    done
823
                    if test -z "$haveit"; then
824
                      rpathdirs="$rpathdirs $found_dir"
825
                    fi
826
                  else
827
                    dnl Rely on "-L$found_dir".
828
                    dnl But don't add it if it's already contained in the LDFLAGS
829
                    dnl or the already constructed $LIBNAME
830
                    haveit=
831
                    for x in $LDFLAGS $LIB[]NAME; do
832
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
833
                      if test "X$x" = "X-L$found_dir"; then
834
                        haveit=yes
835
                        break
836
                      fi
837
                    done
838
                    if test -z "$haveit"; then
839
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
840
                    fi
841
                    if test "$acl_hardcode_minus_L" != no; then
842
                      dnl FIXME: Not sure whether we should use
843
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
844
                      dnl here.
845
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
846
                    else
847
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
848
                      dnl here, because this doesn't fit in flags passed to the
849
                      dnl compiler. So give up. No hardcoding. This affects only
850
                      dnl very old systems.
851
                      dnl FIXME: Not sure whether we should use
852
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
853
                      dnl here.
854
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
855
                    fi
856
                  fi
857
                fi
858
              fi
859
            else
860
              if test "X$found_a" != "X"; then
861
                dnl Linking with a static library.
862
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
863
              else
864
                dnl We shouldn't come here, but anyway it's good to have a
865
                dnl fallback.
866
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
867
              fi
868
            fi
869
            dnl Assume the include files are nearby.
870
            additional_includedir=
871
            case "$found_dir" in
872
              */$acl_libdirstem | */$acl_libdirstem/)
873
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
874
                if test "$name" = '$1'; then
875
                  LIB[]NAME[]_PREFIX="$basedir"
876
                fi
877
                additional_includedir="$basedir/include"
878
                ;;
879
              */$acl_libdirstem2 | */$acl_libdirstem2/)
880
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
881
                if test "$name" = '$1'; then
882
                  LIB[]NAME[]_PREFIX="$basedir"
883
                fi
884
                additional_includedir="$basedir/include"
885
                ;;
886
            esac
887
            if test "X$additional_includedir" != "X"; then
888
              dnl Potentially add $additional_includedir to $INCNAME.
889
              dnl But don't add it
890
              dnl   1. if it's the standard /usr/include,
891
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
892
              dnl   3. if it's already present in $CPPFLAGS or the already
893
              dnl      constructed $INCNAME,
894
              dnl   4. if it doesn't exist as a directory.
895
              if test "X$additional_includedir" != "X/usr/include"; then
896
                haveit=
897
                if test "X$additional_includedir" = "X/usr/local/include"; then
898
                  if test -n "$GCC"; then
899
                    case $host_os in
900
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
901
                    esac
902
                  fi
903
                fi
904
                if test -z "$haveit"; then
905
                  for x in $CPPFLAGS $INC[]NAME; do
906
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
907
                    if test "X$x" = "X-I$additional_includedir"; then
908
                      haveit=yes
909
                      break
910
                    fi
911
                  done
912
                  if test -z "$haveit"; then
913
                    if test -d "$additional_includedir"; then
914
                      dnl Really add $additional_includedir to $INCNAME.
915
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
916
                    fi
917
                  fi
918
                fi
919
              fi
920
            fi
921
            dnl Look for dependencies.
922
            if test -n "$found_la"; then
923
              dnl Read the .la file. It defines the variables
924
              dnl dlname, library_names, old_library, dependency_libs, current,
925
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
926
              save_libdir="$libdir"
927
              case "$found_la" in
928
                */* | *\\*) . "$found_la" ;;
929
                *) . "./$found_la" ;;
930
              esac
931
              libdir="$save_libdir"
932
              dnl We use only dependency_libs.
933
              for dep in $dependency_libs; do
934
                case "$dep" in
935
                  -L*)
936
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
937
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
938
                    dnl But don't add it
939
                    dnl   1. if it's the standard /usr/lib,
940
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
941
                    dnl   3. if it's already present in $LDFLAGS or the already
942
                    dnl      constructed $LIBNAME,
943
                    dnl   4. if it doesn't exist as a directory.
944
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
945
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
946
                      haveit=
947
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
948
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
949
                        if test -n "$GCC"; then
950
                          case $host_os in
951
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
952
                          esac
953
                        fi
954
                      fi
955
                      if test -z "$haveit"; then
956
                        haveit=
957
                        for x in $LDFLAGS $LIB[]NAME; do
958
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
959
                          if test "X$x" = "X-L$additional_libdir"; then
960
                            haveit=yes
961
                            break
962
                          fi
963
                        done
964
                        if test -z "$haveit"; then
965
                          if test -d "$additional_libdir"; then
966
                            dnl Really add $additional_libdir to $LIBNAME.
967
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
968
                          fi
969
                        fi
970
                        haveit=
971
                        for x in $LDFLAGS $LTLIB[]NAME; do
972
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
973
                          if test "X$x" = "X-L$additional_libdir"; then
974
                            haveit=yes
975
                            break
976
                          fi
977
                        done
978
                        if test -z "$haveit"; then
979
                          if test -d "$additional_libdir"; then
980
                            dnl Really add $additional_libdir to $LTLIBNAME.
981
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
982
                          fi
983
                        fi
984
                      fi
985
                    fi
986
                    ;;
987
                  -R*)
988
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
989
                    if test "$enable_rpath" != no; then
990
                      dnl Potentially add DIR to rpathdirs.
991
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
992
                      haveit=
993
                      for x in $rpathdirs; do
994
                        if test "X$x" = "X$dir"; then
995
                          haveit=yes
996
                          break
997
                        fi
998
                      done
999
                      if test -z "$haveit"; then
1000
                        rpathdirs="$rpathdirs $dir"
1001
                      fi
1002
                      dnl Potentially add DIR to ltrpathdirs.
1003
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1004
                      haveit=
1005
                      for x in $ltrpathdirs; do
1006
                        if test "X$x" = "X$dir"; then
1007
                          haveit=yes
1008
                          break
1009
                        fi
1010
                      done
1011
                      if test -z "$haveit"; then
1012
                        ltrpathdirs="$ltrpathdirs $dir"
1013
                      fi
1014
                    fi
1015
                    ;;
1016
                  -l*)
1017
                    dnl Handle this in the next round.
1018
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1019
                    ;;
1020
                  *.la)
1021
                    dnl Handle this in the next round. Throw away the .la's
1022
                    dnl directory; it is already contained in a preceding -L
1023
                    dnl option.
1024
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1025
                    ;;
1026
                  *)
1027
                    dnl Most likely an immediate library name.
1028
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1029
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1030
                    ;;
1031
                esac
1032
              done
1033
            fi
1034
          else
1035
            dnl Didn't find the library; assume it is in the system directories
1036
            dnl known to the linker and runtime loader. (All the system
1037
            dnl directories known to the linker should also be known to the
1038
            dnl runtime loader, otherwise the system is severely misconfigured.)
1039
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1040
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1041
          fi
1042
        fi
1043
      fi
1044
    done
1045
  done
1046
  if test "X$rpathdirs" != "X"; then
1047
    if test -n "$acl_hardcode_libdir_separator"; then
1048
      dnl Weird platform: only the last -rpath option counts, the user must
1049
      dnl pass all path elements in one option. We can arrange that for a
1050
      dnl single library, but not when more than one $LIBNAMEs are used.
1051
      alldirs=
1052
      for found_dir in $rpathdirs; do
1053
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1054
      done
1055
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1056
      acl_save_libdir="$libdir"
1057
      libdir="$alldirs"
1058
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
1059
      libdir="$acl_save_libdir"
1060
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1061
    else
1062
      dnl The -rpath options are cumulative.
1063
      for found_dir in $rpathdirs; do
1064
        acl_save_libdir="$libdir"
1065
        libdir="$found_dir"
1066
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
1067
        libdir="$acl_save_libdir"
1068
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1069
      done
1070
    fi
1071
  fi
1072
  if test "X$ltrpathdirs" != "X"; then
1073
    dnl When using libtool, the option that works for both libraries and
1074
    dnl executables is -R. The -R options are cumulative.
1075
    for found_dir in $ltrpathdirs; do
1076
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1077
    done
1078
  fi
1079
  popdef([P_A_C_K])
1080
  popdef([PACKLIBS])
1081
  popdef([PACKUP])
1082
  popdef([PACK])
1083
  popdef([NAME])
1084
])
1085
1086
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1087
dnl unless already present in VAR.
1088
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1089
dnl contains two or three consecutive elements that belong together.
1090
AC_DEFUN([AC_LIB_APPENDTOVAR],
1091
[
1092
  for element in [$2]; do
1093
    haveit=
1094
    for x in $[$1]; do
1095
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1096
      if test "X$x" = "X$element"; then
1097
        haveit=yes
1098
        break
1099
      fi
1100
    done
1101
    if test -z "$haveit"; then
1102
      [$1]="${[$1]}${[$1]:+ }$element"
1103
    fi
1104
  done
1105
])
1106
1107
dnl For those cases where a variable contains several -L and -l options
1108
dnl referring to unknown libraries and directories, this macro determines the
1109
dnl necessary additional linker options for the runtime path.
1110
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1111
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1112
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1113
dnl otherwise linking without libtool is assumed.
1114
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1115
[
1116
  AC_REQUIRE([AC_LIB_RPATH])
1117
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1118
  $1=
1119
  if test "$enable_rpath" != no; then
1120
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1121
      dnl Use an explicit option to hardcode directories into the resulting
1122
      dnl binary.
1123
      rpathdirs=
1124
      next=
1125
      for opt in $2; do
1126
        if test -n "$next"; then
1127
          dir="$next"
1128
          dnl No need to hardcode the standard /usr/lib.
1129
          if test "X$dir" != "X/usr/$acl_libdirstem" \
1130
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1131
            rpathdirs="$rpathdirs $dir"
1132
          fi
1133
          next=
1134
        else
1135
          case $opt in
1136
            -L) next=yes ;;
1137
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1138
                 dnl No need to hardcode the standard /usr/lib.
1139
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
1140
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1141
                   rpathdirs="$rpathdirs $dir"
1142
                 fi
1143
                 next= ;;
1144
            *) next= ;;
1145
          esac
1146
        fi
1147
      done
1148
      if test "X$rpathdirs" != "X"; then
1149
        if test -n ""$3""; then
1150
          dnl libtool is used for linking. Use -R options.
1151
          for dir in $rpathdirs; do
1152
            $1="${$1}${$1:+ }-R$dir"
1153
          done
1154
        else
1155
          dnl The linker is used for linking directly.
1156
          if test -n "$acl_hardcode_libdir_separator"; then
1157
            dnl Weird platform: only the last -rpath option counts, the user
1158
            dnl must pass all path elements in one option.
1159
            alldirs=
1160
            for dir in $rpathdirs; do
1161
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1162
            done
1163
            acl_save_libdir="$libdir"
1164
            libdir="$alldirs"
1165
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
1166
            libdir="$acl_save_libdir"
1167
            $1="$flag"
1168
          else
1169
            dnl The -rpath options are cumulative.
1170
            for dir in $rpathdirs; do
1171
              acl_save_libdir="$libdir"
1172
              libdir="$dir"
1173
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
1174
              libdir="$acl_save_libdir"
1175
              $1="${$1}${$1:+ }$flag"
1176
            done
1177
          fi
1178
        fi
1179
      fi
1180
    fi
1181
  fi
1182
  AC_SUBST([$1])
1183
])
1184
1185
# lib-prefix.m4 serial 7 (gettext-0.18)
1186
dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc.
1187
dnl This file is free software; the Free Software Foundation
1188
dnl gives unlimited permission to copy and/or distribute it,
1189
dnl with or without modifications, as long as this notice is preserved.
1190
1191
dnl From Bruno Haible.
1192
1193
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1194
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1195
dnl require excessive bracketing.
1196
ifdef([AC_HELP_STRING],
1197
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1198
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1199
1200
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1201
dnl to access previously installed libraries. The basic assumption is that
1202
dnl a user will want packages to use other packages he previously installed
1203
dnl with the same --prefix option.
1204
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1205
dnl libraries, but is otherwise very convenient.
1206
AC_DEFUN([AC_LIB_PREFIX],
1207
[
1208
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1209
  AC_REQUIRE([AC_PROG_CC])
1210
  AC_REQUIRE([AC_CANONICAL_HOST])
1211
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1212
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1213
  dnl By default, look in $includedir and $libdir.
1214
  use_additional=yes
1215
  AC_LIB_WITH_FINAL_PREFIX([
1216
    eval additional_includedir=\"$includedir\"
1217
    eval additional_libdir=\"$libdir\"
1218
  ])
1219
  AC_LIB_ARG_WITH([lib-prefix],
1220
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1221
  --without-lib-prefix    don't search for libraries in includedir and libdir],
1222
[
1223
    if test "X$withval" = "Xno"; then
1224
      use_additional=no
1225
    else
1226
      if test "X$withval" = "X"; then
1227
        AC_LIB_WITH_FINAL_PREFIX([
1228
          eval additional_includedir=\"$includedir\"
1229
          eval additional_libdir=\"$libdir\"
1230
        ])
1231
      else
1232
        additional_includedir="$withval/include"
1233
        additional_libdir="$withval/$acl_libdirstem"
1234
      fi
1235
    fi
1236
])
1237
  if test $use_additional = yes; then
1238
    dnl Potentially add $additional_includedir to $CPPFLAGS.
1239
    dnl But don't add it
1240
    dnl   1. if it's the standard /usr/include,
1241
    dnl   2. if it's already present in $CPPFLAGS,
1242
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1243
    dnl   4. if it doesn't exist as a directory.
1244
    if test "X$additional_includedir" != "X/usr/include"; then
1245
      haveit=
1246
      for x in $CPPFLAGS; do
1247
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1248
        if test "X$x" = "X-I$additional_includedir"; then
1249
          haveit=yes
1250
          break
1251
        fi
1252
      done
1253
      if test -z "$haveit"; then
1254
        if test "X$additional_includedir" = "X/usr/local/include"; then
1255
          if test -n "$GCC"; then
1256
            case $host_os in
1257
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1258
            esac
1259
          fi
1260
        fi
1261
        if test -z "$haveit"; then
1262
          if test -d "$additional_includedir"; then
1263
            dnl Really add $additional_includedir to $CPPFLAGS.
1264
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1265
          fi
1266
        fi
1267
      fi
1268
    fi
1269
    dnl Potentially add $additional_libdir to $LDFLAGS.
1270
    dnl But don't add it
1271
    dnl   1. if it's the standard /usr/lib,
1272
    dnl   2. if it's already present in $LDFLAGS,
1273
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1274
    dnl   4. if it doesn't exist as a directory.
1275
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1276
      haveit=
1277
      for x in $LDFLAGS; do
1278
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1279
        if test "X$x" = "X-L$additional_libdir"; then
1280
          haveit=yes
1281
          break
1282
        fi
1283
      done
1284
      if test -z "$haveit"; then
1285
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1286
          if test -n "$GCC"; then
1287
            case $host_os in
1288
              linux*) haveit=yes;;
1289
            esac
1290
          fi
1291
        fi
1292
        if test -z "$haveit"; then
1293
          if test -d "$additional_libdir"; then
1294
            dnl Really add $additional_libdir to $LDFLAGS.
1295
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1296
          fi
1297
        fi
1298
      fi
1299
    fi
1300
  fi
1301
])
1302
1303
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1304
dnl acl_final_exec_prefix, containing the values to which $prefix and
1305
dnl $exec_prefix will expand at the end of the configure script.
1306
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1307
[
1308
  dnl Unfortunately, prefix and exec_prefix get only finally determined
1309
  dnl at the end of configure.
1310
  if test "X$prefix" = "XNONE"; then
1311
    acl_final_prefix="$ac_default_prefix"
1312
  else
1313
    acl_final_prefix="$prefix"
1314
  fi
1315
  if test "X$exec_prefix" = "XNONE"; then
1316
    acl_final_exec_prefix='${prefix}'
1317
  else
1318
    acl_final_exec_prefix="$exec_prefix"
1319
  fi
1320
  acl_save_prefix="$prefix"
1321
  prefix="$acl_final_prefix"
1322
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1323
  prefix="$acl_save_prefix"
1324
])
1325
1326
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1327
dnl variables prefix and exec_prefix bound to the values they will have
1328
dnl at the end of the configure script.
1329
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1330
[
1331
  acl_save_prefix="$prefix"
1332
  prefix="$acl_final_prefix"
1333
  acl_save_exec_prefix="$exec_prefix"
1334
  exec_prefix="$acl_final_exec_prefix"
1335
  $1
1336
  exec_prefix="$acl_save_exec_prefix"
1337
  prefix="$acl_save_prefix"
1338
])
1339
1340
dnl AC_LIB_PREPARE_MULTILIB creates
1341
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1342
dnl   "lib" or "lib64" or "lib/64",
1343
dnl - a variable acl_libdirstem2, as a secondary possible value for
1344
dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1345
dnl   "lib/amd64".
1346
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1347
[
1348
  dnl There is no formal standard regarding lib and lib64.
1349
  dnl On glibc systems, the current practice is that on a system supporting
1350
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1351
  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1352
  dnl the compiler's default mode by looking at the compiler's library search
1353
  dnl path. If at least one of its elements ends in /lib64 or points to a
1354
  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1355
  dnl Otherwise we use the default, namely "lib".
1356
  dnl On Solaris systems, the current practice is that on a system supporting
1357
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1358
  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1359
  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1360
  AC_REQUIRE([AC_CANONICAL_HOST])
1361
  acl_libdirstem=lib
1362
  acl_libdirstem2=
1363
  case "$host_os" in
1364
    solaris*)
1365
      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1366
      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1367
      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1368
      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1369
      dnl symlink is missing, so we set acl_libdirstem2 too.
1370
      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1371
        [AC_EGREP_CPP([sixtyfour bits], [
1372
#ifdef _LP64
1373
sixtyfour bits
1374
#endif
1375
           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1376
        ])
1377
      if test $gl_cv_solaris_64bit = yes; then
1378
        acl_libdirstem=lib/64
1379
        case "$host_cpu" in
1380
          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
1381
          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1382
        esac
1383
      fi
1384
      ;;
1385
    *)
1386
      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1387
      if test -n "$searchpath"; then
1388
        acl_save_IFS="${IFS= 	}"; IFS=":"
1389
        for searchdir in $searchpath; do
1390
          if test -d "$searchdir"; then
1391
            case "$searchdir" in
1392
              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1393
              */../ | */.. )
1394
                # Better ignore directories of this form. They are misleading.
1395
                ;;
1396
              *) searchdir=`cd "$searchdir" && pwd`
1397
                 case "$searchdir" in
1398
                   */lib64 ) acl_libdirstem=lib64 ;;
1399
                 esac ;;
1400
            esac
1401
          fi
1402
        done
1403
        IFS="$acl_save_IFS"
1404
      fi
1405
      ;;
1406
  esac
1407
  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1408
])
1409
(-)contrib/tcsh/complete.tcsh (-1099 / +1152 lines)
Lines 1-5 Link Here
1
#
1
#
2
# $tcsh: complete.tcsh,v 1.52 2010/05/07 17:54:13 christos Exp $
2
# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $
3
# example file using the new completion code
3
# example file using the new completion code
4
#
4
#
5
# Debian GNU/Linux
5
# Debian GNU/Linux
Lines 20-1228 Link Here
20
# Cleanup by Martin A. Godisch <martin@godisch.de>.
20
# Cleanup by Martin A. Godisch <martin@godisch.de>.
21
21
22
onintr -
22
onintr -
23
if (! $?prompt) goto end
23
if ( ! $?prompt ) goto end
24
24
25
if ($?tcsh) then
25
if ( $?tcsh ) then
26
    if ($tcsh != 1) then
26
  if ( $tcsh != 1 ) then
27
   	set rev=$tcsh:r
27
    set rev=$tcsh:r:r
28
	set rel=$rev:e
28
    set rel=$tcsh:r:e
29
	set pat=$tcsh:e
29
    if ( $rev > 6 || ( $rev > 5 && $rel > 1 ) ) then
30
	set rev=$rev:r
30
      set _has_complete=1
31
    endif
31
    endif
32
    if ($rev > 5 && $rel > 1) then
32
  endif
33
	set _complete=1
33
  unset rev rel
34
    endif
35
    unset rev rel pat
36
endif
34
endif
37
35
38
if ($?_complete) then
36
if ( ! $?_has_complete ) goto end
39
    set noglob
40
    if ( ! $?hosts ) set hosts
41
    foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv)
42
        if ( -r "$f" ) then
43
	    set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " "	" | cut -f 1`)
44
	endif
45
    end
46
    if ( -r "$HOME/.netrc" ) then
47
	set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null
48
	set hosts=($hosts $f)
49
    endif
50
    if ( -r "$HOME/.ssh/known_hosts" ) then
51
	set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null
52
	set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
53
	set hosts=($hosts $f)
54
    endif
55
    unset f
56
    if ( ! $?hosts ) then
57
	set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
58
		   guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
59
		   ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
60
		   labrea.stanford.edu sumex-aim.stanford.edu \
61
		   tut.cis.ohio-state.edu)
62
    endif
63
37
64
    complete ywho  	n/*/\$hosts/	# argument from list in $hosts
38
if ( ! $?noglob ) set noglob _unset_noglob
65
    complete rsh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
66
    complete ssh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
67
    complete xrsh	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
68
    complete rlogin 	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
69
    complete telnet 	p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
70
39
71
    complete cd  	p/1/d/		# Directories only
40
# Old TCSH versions don't define OSTYPE.
72
    complete chdir 	p/1/d/
41
# Use a close approximation instead.
73
    complete pushd 	p/1/d/
74
    complete popd 	p/1/d/
75
    complete pu 	p/1/d/
76
    complete po 	p/1/d/
77
    complete complete 	p/1/X/		# Completions only
78
    complete uncomplete	n/*/X/
79
    complete exec 	p/1/c/		# Commands only
80
    complete trace 	p/1/c/
81
    complete strace 	p/1/c/
82
    complete which	n/*/c/
83
    complete where	n/*/c/
84
    complete skill 	p/1/c/
85
    complete dde	p/1/c/ 
86
    complete adb	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
87
    complete sdb	p/1/c/
88
    complete dbx	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
89
    complete xdb	p/1/c/
90
    complete gdb	n/-d/d/ n/*/c/
91
    complete ups	p/1/c/
92
    complete set	'c/*=/f/' 'p/1/s/=' 'n/=/f/'
93
    complete unset	n/*/s/
94
    complete alias 	p/1/a/		# only aliases are valid
95
    complete unalias	n/*/a/
96
    complete xdvi 	n/*/f:*.dvi/	# Only files that match *.dvi
97
    complete dvips 	n/*/f:*.dvi/
98
    if ($?traditional_complete) then
99
        complete tex 	n/*/f:*.tex/	# Only files that match *.tex
100
    else
101
        complete tex 	n/*/f:*.{tex,texi}/	# Files that match *.tex and *.texi
102
    endif
103
    complete latex 	n/*/f:*.{tex,ltx}/
104
    complete su		c/--/"(login fast preserve-environment command shell \
105
			help version)"/	c/-/"(f l m p c s -)"/ \
106
			n/{-c,--command}/c/ \
107
			n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
108
    complete cc 	c/-[IL]/d/ \
109
              c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
110
			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
111
    complete acc 	c/-[IL]/d/ \
112
       c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
113
			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
114
    complete gcc 	c/-[IL]/d/ \
115
		 	c/-f/"(caller-saves cse-follow-jumps delayed-branch \
116
		               elide-constructors expensive-optimizations \
117
			       float-store force-addr force-mem inline \
118
			       inline-functions keep-inline-functions \
119
			       memoize-lookups no-default-inline \
120
			       no-defer-pop no-function-cse omit-frame-pointer \
121
			       rerun-cse-after-loop schedule-insns \
122
			       schedule-insns2 strength-reduce \
123
			       thread-jumps unroll-all-loops \
124
			       unroll-loops syntax-only all-virtual \
125
			       cond-mismatch dollars-in-identifiers \
126
			       enum-int-equiv no-asm no-builtin \
127
			       no-strict-prototype signed-bitfields \
128
			       signed-char this-is-variable unsigned-bitfields \
129
			       unsigned-char writable-strings call-saved-reg \
130
			       call-used-reg fixed-reg no-common \
131
			       no-gnu-binutils nonnull-objects \
132
			       pcc-struct-return pic PIC shared-data \
133
			       short-enums short-double volatile)"/ \
134
		 	c/-W/"(all aggregate-return cast-align cast-qual \
135
		      	       comment conversion enum-clash error format \
136
		      	       id-clash-len implicit missing-prototypes \
137
		      	       no-parentheses pointer-arith return-type shadow \
138
		      	       strict-prototypes switch uninitialized unused \
139
		      	       write-strings)"/ \
140
		 	c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
141
			       short c68000 c68020 soft-float g gnu unix fpu \
142
			       no-epilogue)"/ \
143
		 	c/-d/"(D M N)"/ \
144
		 	c/-/"(f W vspec v vpath ansi traditional \
145
			      traditional-cpp trigraphs pedantic x o l c g L \
146
			      I D U O O2 C E H B b V M MD MM i dynamic \
147
			      nodtdlib static nostdinc undef)"/ \
148
		 	c/-l/f:*.a/ \
149
		 	n/*/f:*.{c,C,cc,o,a,s,i}/
150
    complete g++ 	n/*/f:*.{C,cc,o,s,i}/
151
    complete CC 	n/*/f:*.{C,cc,cpp,o,s,i}/
152
    complete rm 	c/--/"(directory force interactive verbose \
153
			recursive help version)"/ c/-/"(d f i v r R -)"/ \
154
			n/*/f:^*.{c,cc,C,h,in}/	# Protect precious files
155
    complete vi 	n/*/f:^*.[oa]/
156
    complete bindkey    N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
157
			n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
158
			n/-k/"(left right up down)"/ p/2-/b/ \
159
			p/1/'x:<key-sequence or option>'/
160
42
161
    complete find 	n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
43
if ( ! $?OSTYPE ) then
162
		  	n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
44
  setenv OSTYPE `echo "$HOSTTYPE" | sed -e 's/^(i[3456]86|(amd|x86_)64)-//'`
163
			n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
45
endif
164
		  	c/-/"(fstype name perm prune type user nouser \
165
		  	     group nogroup size inum atime mtime ctime exec \
166
			     ok print ls cpio ncpio newer xdev depth \
167
			     daystart follow maxdepth mindepth noleaf version \
168
			     anewer cnewer amin cmin mmin true false uid gid \
169
			     ilname iname ipath iregex links lname empty path \
170
			     regex used xtype fprint fprint0 fprintf \
171
			     print0 printf not a and o or)"/ \
172
			     n/*/d/
173
46
174
    complete -%*	c/%/j/			# fill in the jobs builtin
47
if ( ! $?hosts ) set hosts
175
    complete {fg,bg,stop}	c/%/j/ p/1/"(%)"//
176
48
177
    complete limit	c/-/"(h)"/ n/*/l/
49
foreach f ( "$HOME/."{,r,ssh/known_}hosts* \
178
    complete unlimit	c/-/"(h)"/ n/*/l/
50
  /usr/local/etc/csh.hosts /etc/hosts.equiv )
51
  if ( -r "$f" ) then
52
    set hosts=($hosts `sed \
53
      -e 's/#.*//' \
54
      -e '/^[+-]@/d' \
55
      -e 's/^[-+]//' \
56
      -e 's/[[:space:]].*//' \
57
      -e 's/,/\n/g' "$f" \
58
      | sed -e '/^[.:[:xdigit:][:space:]]*$/d'`)
59
  endif
60
end
61
unset f
179
62
180
    complete -co*	p/0/"(compress)"/	# make compress completion
63
if ( -r "$HOME/.netrc" ) then
181
						# not ambiguous
64
  set hosts=($hosts `awk '$1 == "machine" { print $2 }' "$HOME/.netrc"`)
182
    if ($?traditional_complete) then
65
endif
183
        complete zcat	n/*/f:*.Z/
184
    else
185
        # "zcat" may be linked to "compress" or "gzip"
186
        if (-X zcat) then
187
            zcat --version >& /dev/null
188
            if ($status != 0) then
189
                complete zcat	n/*/f:*.Z/
190
            else
191
                complete zcat	c/--/"(force help license quiet version)"/ \
192
				c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
193
	    endif
194
        endif
195
    endif
196
66
197
    complete finger	c/*@/\$hosts/ n/*/u/@ 
67
set hosts=(`echo $hosts | tr ' ' '\012' | sort -u`)
198
    complete ping	p/1/\$hosts/
199
    complete traceroute	p/1/\$hosts/
200
68
201
    complete {talk,ntalk,phone}	p/1/'`users | tr " " "\012" | uniq`'/ \
69
if ( ! $#hosts ) then
202
		n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
70
  # This is just a hint for the user.
71
  set hosts=(ftp.funet.fi ftp.gnu.org ftp.uu.net)
72
endif
203
73
204
    complete ftp	c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
74
complete ywho		n/*/\$hosts/	# argument from list in $hosts
75
complete rsh		p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
76
complete ssh		p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
77
complete xrsh		p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
78
complete rlogin 	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
79
complete telnet 	p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
205
80
206
    # this one is simple...
81
complete cd  		p/1/d/		# Directories only
207
    #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
82
complete chdir 		p/1/d/
208
    # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> 
83
complete pushd 		p/1/d/
209
    # This one will rsh to the file to fetch the list of files!
84
complete popd 		p/1/d/
210
    complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'
85
complete pu 		p/1/d/
86
complete po 		p/1/d/
87
complete complete 	p/1/X/		# Completions only
88
complete uncomplete	n/*/X/
89
complete exec 		p/1/c/		# Commands only
90
complete trace 		p/1/c/
91
complete strace 	p/1/c/
92
complete which		n/*/c/
93
complete where		n/*/c/
94
complete skill 		p/1/c/
95
complete dde		p/1/c/ 
96
complete adb		c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
97
complete sdb		p/1/c/
98
complete dbx		c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
99
complete xdb		p/1/c/
100
complete gdb		n/-d/d/ n/*/c/
101
complete ups		p/1/c/
102
complete set		'c/*=/f/' 'p/1/s/=' 'n/=/f/'
103
complete unset		n/*/s/
104
complete alias 		p/1/a/		# only aliases are valid
105
complete unalias	n/*/a/
106
complete xdvi 		n/*/f:*.dvi/
107
complete dvips 		n/*/f:*.dvi/
108
complete tex	 	n/*/f:*.{tex,texi}/
109
complete latex	 	n/*/f:*.{tex,ltx}/
211
110
212
    complete dd c/--/"(help version)"/ c/[io]f=/f/ \
111
complete su \
213
		c/conv=*,/"(ascii ebcdic ibm block unblock \
112
  c/--/"(login fast preserve-environment command shell help version)"/ \
214
			    lcase notrunc ucase swab noerror sync)"/,\
113
  c/-/"(f l m p c s -)"/ \
215
		c/conv=/"(ascii ebcdic ibm block unblock \
114
  n/{-c,--command}/c/ \
216
			  lcase notrunc ucase swab noerror sync)"/,\
115
  n@{-s,--shell}@'`cat /etc/shells`'@ \
217
	        c/*=/x:'<number>'/ \
116
  n/*/u/
218
		n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
117
complete cc \
118
  c/-[IL]/d/ \
119
  c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
120
  c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
121
complete acc \
122
  c/-[IL]/d/ \
123
  c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
124
  c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
125
complete gcc \
126
  c/-[IL]/d/ \
127
  c/-f/"(caller-saves cse-follow-jumps delayed-branch elide-constructors \
128
	expensive-optimizations float-store force-addr force-mem inline \
129
	inline-functions keep-inline-functions memoize-lookups \
130
	no-default-inline no-defer-pop no-function-cse omit-frame-pointer \
131
	rerun-cse-after-loop schedule-insns schedule-insns2 strength-reduce \
132
	thread-jumps unroll-all-loops unroll-loops syntax-only all-virtual \
133
	cond-mismatch dollars-in-identifiers enum-int-equiv no-asm no-builtin \
134
	no-strict-prototype signed-bitfields signed-char this-is-variable \
135
	unsigned-bitfields unsigned-char writable-strings call-saved-reg \
136
	call-used-reg fixed-reg no-common no-gnu-binutils nonnull-objects \
137
	pcc-struct-return pic PIC shared-data short-enums short-double \
138
	volatile)"/ \
139
  c/-W/"(all aggregate-return cast-align cast-qual comment conversion \
140
	enum-clash error format id-clash-len implicit missing-prototypes \
141
	no-parentheses pointer-arith return-type shadow strict-prototypes \
142
	switch uninitialized unused write-strings)"/ \
143
  c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd short c68000 c68020 \
144
	soft-float g gnu unix fpu no-epilogue)"/ \
145
  c/-d/"(D M N)"/ \
146
  c/-/"(f W vspec v vpath ansi traditional traditional-cpp trigraphs pedantic \
147
	x o l c g L I D U O O2 C E H B b V M MD MM i dynamic nodtdlib static \
148
	nostdinc undef)"/ \
149
  c/-l/f:*.a/ \
150
  n/*/f:*.{c,C,cc,o,a,s,i}/
151
complete g++ 	n/*/f:*.{C,cc,o,s,i}/
152
complete CC 	n/*/f:*.{C,cc,cpp,o,s,i}/
153
complete rm \
154
  c/--/"(directory force interactive verbose recursive help version)"/ \
155
  c/-/"(d f i v r R -)"/ \
156
  n/*/f:^*.{c,cc,C,h,in}/
157
  # Protect precious files
158
complete vi 	n/*/f:^*.[oa]/
159
complete bindkey \
160
  N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
161
  n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/ \
162
  n/-k/"(left right up down)"/ p/2-/b/ \
163
  p/1/'x:<key-sequence or option>'/
219
164
220
    complete nslookup   p/1/x:'<host>'/ p/2/\$hosts/
165
complete find \
166
  n/-fstype/"(nfs 4.2)"/ \
167
  n/-name/f/ \
168
  n/-type/"(c b d f p l s)"/ \
169
  n/-user/u/ \
170
  n/-group/g/ \
171
  n/-exec/c/ \
172
  n/-ok/c/ \
173
  n/-cpio/f/ \
174
  n/-ncpio/f/ \
175
  n/-newer/f/ \
176
  c/-/"(fstype name perm prune type user nouser group nogroup size inum \
177
	atime mtime ctime exec ok print ls cpio ncpio newer xdev depth \
178
	daystart follow maxdepth mindepth noleaf version anewer cnewer \
179
	amin cmin mmin true false uid gid ilname iname ipath iregex links \
180
	lname empty path regex used xtype fprint fprint0 fprintf print0 \
181
	printf not a and o or)"/ \
182
  n/*/d/
221
183
222
    complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
184
complete -%*		c/%/j/			# fill in the jobs builtin
223
		p/2/f:*.a/ p/*/f:*.o/
185
complete {fg,bg,stop}	c/%/j/ p/1/"(%)"//
224
186
225
    # these should be merged with the MH completion hacks below - jgotts
187
complete limit		c/-/"(h)"/ n/*/l/
226
    complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
188
complete unlimit	c/-/"(h)"/ n/*/l/
227
		"c@+@F:$HOME/Mail/@"
228
189
229
    # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
190
#complete -co*	p/0/"(compress)"/	# make compress completion
230
    complete {rexec,rxexec,rxterm,rmterm} \
191
#					    # not ambiguous
231
			'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
232
			'n/-E/e/' 'n/*/c/'
233
    complete kill	'c/-/S/' 'c/%/j/' \
234
			'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
235
192
236
    # these from Marc Horowitz <marc@cam.ov.com>
193
# "zcat" may be linked to "compress" or "gzip"
237
    complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
194
if (-X zcat) then
238
		    'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
195
  zcat --version >& /dev/null
239
		    'c/-/(verbose quiet force printpath lookup debug map \
196
  if ($status != 0) then
240
			  nomap remap zephyr nozephyr readonly write \
197
    complete zcat	n/*/f:*.Z/
241
			  mountpoint noexplicit explicit type mountoptions \
198
  else
242
			  nosetuid setuid override skipfsck lock user host)/' \
199
    complete zcat	c/--/"(force help license quiet version)"/ \
243
		    'n/-e/f/' 'n/*/()/'
200
			c/-/"(f h L q V -)"/ \
244
    complete hesinfo	'p/1/u/' \
201
			n/*/f:*.{gz,Z,z,zip}/
245
			'p/2/(passwd group uid grplist pcap pobox cluster \
202
  endif
246
			      filsys sloc service)/'
203
endif
247
204
248
    # these from E. Jay Berkenbilt <ejb@ERA.COM>
205
complete finger	c/*@/\$hosts/ n/*/u/@ 
249
    # = isn't always followed by a filename or a path anymore - jgotts
206
complete ping	p/1/\$hosts/
250
    if ($?traditional_complete) then
207
complete traceroute	p/1/\$hosts/
251
        complete ./configure \
252
			 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
253
    				bindir,sbindir,libexecdir,datadir,\
254
				sysconfdir,sharedstatedir,localstatedir,\
255
				libdir,includedir,oldincludedir,infodir,\
256
				mandir,srcdir}/(=)//' \
257
			 'c/--/(cache-file verbose prefix exec-prefix bindir \
258
			 	sbindir libexecdir datadir sysconfdir \
259
				sharedstatedir localstatedir libdir \
260
				includedir oldincludedir infodir mandir \
261
				srcdir)//'
262
    else
263
	complete ./configure \
264
			'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
265
 			'c/--cachefile=*/x:<filename>/' \
266
  			'c/--{enable,disable,with}-*/x:<feature>//' \
267
 			'c/--*=/x:<directory>//' \
268
  			'c/--/(prefix= exec-prefix= bindir= \
269
			sbindir= libexecdir= datadir= sysconfdir= \
270
   			sharedstatedir= localstatedir= infodir= \
271
			mandir= srcdir= x-includes= x-libraries= cachefile= \
272
 			enable- disable- with- \
273
 			help no-create quiet silent version verbose )//'
274
    endif
275
    complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
276
			      dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
277
			      pbmraw pgm pgmraw ppm ppmraw bit)/' \
278
		'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
279
		'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
280
    complete perl	'n/-S/c/'
281
    complete printenv	'n/*/e/'
282
    complete sccs	p/1/"(admin cdc check clean comb deledit delget \
283
			delta diffs edit enter fix get help info \
284
			print prs prt rmdel sccsdiff tell unedit \
285
			unget val what)"/
286
    complete setenv	'p/1/e/' 'c/*:/f/'
287
208
288
    # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
209
complete {talk,ntalk,phone} \
289
    if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then 
210
  p/1/'`users | tr " " "\012" | uniq`'/ \
211
  n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
290
212
291
    if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
213
complete ftp	c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
292
    if ( ! $?MHA )     setenv MHA     "`ali | sed -e '/^ /d' -e 's/:.*//'`"
293
214
294
    set folders = ( $FOLDERS )
215
# this one is simple...
295
    set mha = ( $MHA )
216
#complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
217
# From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> 
218
# This one will rsh to the file to fetch the list of files!
219
complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'
296
220
297
    complete ali \
221
complete dd \
298
        'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
222
  c/--/"(help version)"/ c/[io]f=/f/ \
299
        'n,-alias,f,'
223
  c/conv=*,/"(ascii ebcdic ibm block unblock \
224
	      lcase notrunc ucase swab noerror sync)"/,\
225
  c/conv=/"(ascii ebcdic ibm block unblock \
226
	    lcase notrunc ucase swab noerror sync)"/,\
227
  c/*=/x:'<number>'/ \
228
  n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
300
229
301
    complete anno \
230
complete nslookup   p/1/x:'<host>'/ p/2/\$hosts/
302
        'c/-/(component noinplace inplace nodate date text help)/' \
303
        'c,+,$folders,'  \
304
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
305
231
306
    complete burst \
232
complete ar \
307
        'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
233
  c/[dmpqrtx]/"(c l o u v a b i)"/ \
308
        'c,+,$folders,'  \
234
  p/1/"(d m p q r t x)"// \
309
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
235
  p/2/f:*.a/ \
236
  p/*/f:*.o/
310
237
311
    complete comp \
238
# these should be merged with the MH completion hacks below - jgotts
312
        'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
239
complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
313
        'c,+,$folders,'  \
240
	    "c@+@F:$HOME/Mail/@"
314
        'n,-whatnowproc,c,'  \
315
        'n,-file,f,'\
316
        'n,-form,f,'\
317
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
318
241
319
    complete dist \
242
# these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
320
        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
243
complete {rexec,rxexec,rxterm,rmterm} \
321
        'c,+,$folders,'  \
244
  'p/1/$hosts/' \
322
        'n,-whatnowproc,c,'  \
245
  'c/-/(l L E)/' \
323
        'n,-form,f,'\
246
  'n/-l/u/' \
324
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
247
  'n/-L/f/' \
248
  'n/-E/e/' \
249
  'n/*/c/'
250
complete kill \
251
  'c/-/S/' \
252
  'c/%/j/' \
253
  'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
325
254
326
    complete folder \
255
# these from Marc Horowitz <marc@cam.ov.com>
327
        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
256
complete attach \
328
        'c,+,$folders,'  \
257
  'n/-mountpoint/d/' \
329
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
258
  'n/-m/d/' \
259
  'n/-type/(afs nfs rvd ufs)/' \
260
  'n/-t/(afs nfs rvd ufs)/' \
261
  'n/-user/u/' \
262
  'n/-U/u/' \
263
  'c/-/(verbose quiet force printpath lookup debug map nomap remap zephyr \
264
	nozephyr readonly write mountpoint noexplicit explicit type \
265
	mountoptions nosetuid setuid override skipfsck lock user host)/' \
266
  'n/-e/f/' \
267
  'n/*/()/'
268
complete hesinfo \
269
  'p/1/u/' \
270
  'p/2/(passwd group uid grplist pcap pobox cluster filsys sloc service)/'
330
271
331
    complete folders \
272
complete ./configure \
332
        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
273
  'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
333
        'c,+,$folders,'  \
274
  'c/--cachefile=*/x:<filename>/' \
334
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
275
  'c/--{enable,disable,with}-*/x:<feature>//' \
276
  'c/--*=/x:<directory>//' \
277
  'c/--/(prefix= exec-prefix= bindir= sbindir= libexecdir= datadir= \
278
	sysconfdir= sharedstatedir= localstatedir= infodir= mandir= \
279
	srcdir= x-includes= x-libraries= cachefile= enable- disable- \
280
	with- help no-create quiet silent version verbose )//'
335
281
336
    complete forw \
282
complete gs \
337
        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
283
  'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc dfaxhigh dfaxlow \
338
        'c,+,$folders,'  \
284
		laserjet ljet4 sparc pbm pbmraw pgm pgmraw ppm ppmraw bit)/' \
339
        'n,-whatnowproc,c,'  \
285
  'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
340
        'n,-filter,f,'\
286
  'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
341
        'n,-form,f,'\
287
complete perl		'n/-S/c/'
342
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
288
complete sccs \
289
  p/1/"(admin cdc check clean comb deledit delget delta diffs edit enter \
290
	fix get help info print prs prt rmdel sccsdiff tell unedit unget \
291
	val what)"/
343
292
344
    complete inc \
293
complete printenv	'n/*/e/'
345
        'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
294
complete setenv		'p/1/e/' 'c/*:/f/'
346
        'c,+,$folders,'  \
347
        'n,-audit,f,'\
348
        'n,-form,f,'
349
295
350
    complete mark \
296
# these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
351
        'c/-/(add delete list sequence nopublic public nozero zero help)/' \
297
if ( -f "$HOME/.mh_profile" && -X folders ) then 
352
        'c,+,$folders,'  \
298
  if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
353
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
299
  if ( ! $?MHA )     setenv MHA     "`ali | sed -e '/^ /d' -e 's/:.*//'`"
354
300
355
    complete mhmail \
301
  set folders = ( $FOLDERS )
356
        'c/-/(body cc from subject help)/' \
302
  set mha = ( $MHA )
357
        'n,-cc,$mha,'  \
358
        'n,-from,$mha,'  \
359
        'n/*/$mha/'
360
303
361
    complete mhpath \
304
  complete ali \
362
        'c/-/(help)/' \
305
    'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
363
        'c,+,$folders,'  \
306
    'n,-alias,f,'
364
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
365
307
366
    complete msgchk \
308
  complete anno \
367
        'c/-/(nodate date nonotify notify help)/' 
309
    'c/-/(component noinplace inplace nodate date text help)/' \
310
    'c,+,$folders,'  \
311
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
368
312
369
    complete msh \
313
  complete burst \
370
        'c/-/(prompt noscan scan notopcur topcur help)/' 
314
    'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
315
    'c,+,$folders,'  \
316
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
371
317
372
    complete next \
318
  complete comp \
373
        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
319
    'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
374
        'c,+,$folders,'  \
320
    'c,+,$folders,'  \
375
        'n,-moreproc,c,'  \
321
    'n,-whatnowproc,c,'  \
376
        'n,-showproc,c,'  \
322
    'n,-file,f,'\
377
        'n,-form,f,'
323
    'n,-form,f,'\
324
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
378
325
379
    complete packf \
326
  complete dist \
380
        'c/-/(file help)/' \
327
    'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
381
        'c,+,$folders,'  \
328
    'c,+,$folders,'  \
382
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
329
    'n,-whatnowproc,c,'  \
330
    'n,-form,f,'\
331
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
383
332
384
    complete pick \
333
  complete folder \
385
        'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
334
    'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
386
        'c,+,$folders,'  \
335
    'c,+,$folders,'  \
387
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
336
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
388
337
389
    complete prev \
338
  complete folders \
390
        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
339
    'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
391
        'c,+,$folders,'  \
340
    'c,+,$folders,'  \
392
        'n,-moreproc,c,'  \
341
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
393
        'n,-showproc,c,'  \
394
        'n,-form,f,'
395
342
396
    complete prompter \
343
  complete forw \
397
        'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' 
344
    'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
345
    'c,+,$folders,'  \
346
    'n,-whatnowproc,c,'  \
347
    'n,-filter,f,'\
348
    'n,-form,f,'\
349
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
398
350
399
    complete refile \
351
  complete inc \
400
        'c/-/(draft nolink link nopreserve preserve src file help)/' \
352
    'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
401
        'c,+,$folders,'  \
353
    'c,+,$folders,'  \
402
        'n,-file,f,'\
354
    'n,-audit,f,'\
403
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
355
    'n,-form,f,'
404
356
405
    complete rmf \
357
  complete mark \
406
        'c/-/(nointeractive interactive help)/' \
358
    'c/-/(add delete list sequence nopublic public nozero zero help)/' \
407
        'c,+,$folders,'  
359
    'c,+,$folders,'  \
360
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
408
361
409
    complete rmm \
362
  complete mhmail \
410
        'c/-/(help)/' \
363
    'c/-/(body cc from subject help)/' \
411
        'c,+,$folders,'  \
364
    'n,-cc,$mha,'  \
412
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
365
    'n,-from,$mha,'  \
366
    'n/*/$mha/'
413
367
414
    complete scan \
368
  complete mhpath \
415
        'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
369
    'c/-/(help)/' \
416
        'c,+,$folders,'  \
370
    'c,+,$folders,'  \
417
        'n,-form,f,'\
371
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
418
        'n,-file,f,'\
419
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
420
372
421
    complete send \
373
  complete msgchk \
422
        'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
374
    'c/-/(nodate date nonotify notify help)/' 
423
        'n,-alias,f,'\
424
        'n,-filter,f,'
425
375
426
    complete show \
376
  complete msh \
427
        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
377
    'c/-/(prompt noscan scan notopcur topcur help)/' 
428
        'c,+,$folders,'  \
429
        'n,-moreproc,c,'  \
430
        'n,-showproc,c,'  \
431
        'n,-form,f,'\
432
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
433
378
434
    complete sortm \
379
  complete next \
435
        'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
380
    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
436
        'c,+,$folders,'  \
381
    'c,+,$folders,'  \
437
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
382
    'n,-moreproc,c,'  \
383
    'n,-showproc,c,'  \
384
    'n,-form,f,'
438
385
439
    complete vmh \
386
  complete packf \
440
        'c/-/(prompt vmhproc novmhproc help)/' \
387
    'c/-/(file help)/' \
441
        'n,-vmhproc,c,'  
388
    'c,+,$folders,'  \
389
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
442
390
443
    complete whatnow \
391
  complete pick \
444
        'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' 
392
    'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
393
    'c,+,$folders,'  \
394
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
445
395
446
    complete whom \
396
  complete prev \
447
        'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
397
    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
448
        'n,-alias,f,'
398
    'c,+,$folders,'  \
399
    'n,-moreproc,c,'  \
400
    'n,-showproc,c,'  \
401
    'n,-form,f,'
449
402
450
    complete plum \
403
  complete prompter \
451
        'c/-/()/' \
404
    'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' 
452
        'c,+,$folders,'  \
453
        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
454
405
455
    complete mail \
406
  complete refile \
456
        'c/-/()/' \
407
    'c/-/(draft nolink link nopreserve preserve src file help)/' \
457
        'n/*/$mha/'
408
    'c,+,$folders,'  \
409
    'n,-file,f,'\
410
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
458
411
459
    endif
412
  complete rmf \
413
    'c/-/(nointeractive interactive help)/' \
414
    'c,+,$folders,'  
460
415
461
    #from Dan Nicolaescu <dann@ics.uci.edu>
416
  complete rmm \
462
    if ( $?MODULESHOME ) then
417
    'c/-/(help)/' \
463
	alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print  | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
418
    'c,+,$folders,'  \
464
	complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \
419
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
465
	'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
466
	'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
467
	'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \
468
	'C%[^-]*%`eval Compl_module`%'
469
    endif
470
420
471
    # from George Cox
421
  complete scan \
472
    complete acroread	'p/*/f:*.{pdf,PDF}/'
422
    'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
473
    complete apachectl  'c/*/(start stop restart fullstatus status graceful \
423
    'c,+,$folders,'  \
474
			configtest help)/'
424
    'n,-form,f,'\
475
    complete appletviewer	'p/*/f:*.class/'
425
    'n,-file,f,'\
476
    complete bison	'c/--/(debug defines file-prefix= fixed-output-files \
426
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
477
			help name-prefix= no-lines no-parser output= \
427
478
			token-table verbose version yacc)/' \
428
  complete send \
479
			'c/-/(b d h k l n o p t v y V)/' 'n/-b/f/' 'n/-o/f/' \
429
    'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
480
			'n/-p/f/'
430
    'n,-alias,f,'\
481
    complete bzcat	c/--/"(help test quiet verbose license version)"/ \
431
    'n,-filter,f,'
432
433
  complete show \
434
    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
435
    'c,+,$folders,'  \
436
    'n,-moreproc,c,'  \
437
    'n,-showproc,c,'  \
438
    'n,-form,f,'\
439
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
440
441
  complete sortm \
442
    'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
443
    'c,+,$folders,'  \
444
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
445
446
  complete vmh \
447
    'c/-/(prompt vmhproc novmhproc help)/' \
448
    'n,-vmhproc,c,'  
449
450
  complete whatnow \
451
    'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' 
452
453
  complete whom \
454
    'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
455
    'n,-alias,f,'
456
457
  complete plum \
458
    'c/-/()/' \
459
    'c,+,$folders,'  \
460
    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
461
462
  complete mail \
463
    'c/-/()/' \
464
    'n/*/$mha/'
465
466
endif
467
468
#from Dan Nicolaescu <dann@ics.uci.edu>
469
if ( $?MODULESHOME ) then
470
  alias Compl_module \
471
    'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune \
472
    -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
473
  complete module \
474
    'p%1%(add load unload switch display avail use unuse update purge list \
475
	  clear help initadd initrm initswitch initlist initclear)%' \
476
    'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
477
    'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
478
    'N%{sw*,initsw*}%`eval Compl_module`%' \
479
    'C%-%(-append)%' \
480
    'n%{use,unu*,av*}%d%' \
481
    'n%-append%d%' \
482
    'C%[^-]*%`eval Compl_module`%'
483
endif
484
485
# from George Cox
486
complete acroread	'p/*/f:*.{pdf,PDF}/'
487
complete apachectl	'c/*/(start stop restart fullstatus status graceful \
488
			      configtest help)/'
489
complete appletviewer	'p/*/f:*.class/'
490
complete bison		'c/--/(debug defines file-prefix= fixed-output-files \
491
				help name-prefix= no-lines no-parser output= \
492
				token-table verbose version yacc)/' \
493
			'c/-/(b d h k l n o p t v y V)/' \
494
			'n/-b/f/' 'n/-o/f/' 'n/-p/f/'
495
complete bzcat		c/--/"(help test quiet verbose license version)"/ \
482
			c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
496
			c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
483
    complete bunzip2	c/--/"(help keep force test stdout quiet verbose \
497
complete bunzip2	c/--/"(help keep force test stdout quiet verbose \
484
                        license version)"/ c/-/"(h k f t c q v L V -)"/ \
498
				license version)"/ \
499
			c/-/"(h k f t c q v L V -)"/ \
485
			n/*/f:*.{bz2,tbz}/
500
			n/*/f:*.{bz2,tbz}/
486
    complete bzip2	c/--/"(help decompress compress keep force test \
501
complete bzip2		c/--/"(help decompress compress keep force test \
487
			stdout quiet verbose license version small)"/ \
502
				stdout quiet verbose license version small)"/ \
488
			c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
503
			c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
489
			n/{-d,--decompress}/f:*.{bz2,tbz}/ \
504
			n/{-d,--decompress}/f:*.{bz2,tbz}/ \
490
			N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
505
			N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
491
    complete c++	'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
506
complete c++		'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
492
    complete co		'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
507
complete co		'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
493
    complete crontab	'n/-u/u/'
508
complete crontab	'n/-u/u/'
494
    complete camcontrol	'p/1/(cmd debug defects devlist eject inquiry \
509
complete camcontrol	'p/1/(cmd debug defects devlist eject inquiry \
495
			modepage negotiate periphlist rescan reset start \
510
			      modepage negotiate periphlist rescan reset \
496
			stop tags tur)/'
511
			      start stop tags tur)/'
497
    complete ctlinnd	'p/1/(addhist allow begin cancel changegroup \
512
complete ctlinnd	'p/1/(addhist allow begin cancel changegroup \
498
			checkfile drop feedinfo flush flushlogs go hangup \
513
			      checkfile drop feedinfo flush flushlogs go \
499
			logmode mode name newgroup param pause readers refile \
514
			      hangup logmode mode name newgroup param pause \
500
			reject reload renumber reserve rmgroup send shutdown \
515
			      readers refile reject reload renumber reserve \
501
			kill throttle trace xabort xexec)/'
516
			      rmgroup send shutdown kill throttle trace \
502
    complete cvs	'c/--/(help help-commands help-synonyms)/' \
517
			      xabort xexec)/'
503
			'p/1/(add admin annotate checkout commit diff \
518
complete cvs		'c/--/(help help-commands help-synonyms)/' \
504
			edit editors export history import init log login \
519
			'p/1/(add admin annotate checkout commit diff edit \
505
			logout rdiff release remove rtag status tag unedit \
520
			      editors export history import init log login \
506
			update watch watchers)/' 'n/-a/(edit unedit commit \
521
			      logout rdiff release remove rtag status tag \
507
			all none)/' 'n/watch/(on off add remove)/'
522
			      unedit update watch watchers)/' \
508
    complete svn 	'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
523
			'n/-a/(edit unedit commit all none)/' \
524
			'n/watch/(on off add remove)/'
525
complete svn	 	'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
509
			'n@ls@(file:/// svn+ssh:// svn://)@@' \
526
			'n@ls@(file:/// svn+ssh:// svn://)@@' \
510
			'n@help@(add blame cat checkout \
527
			'n@help@(add blame cat checkout cleanup commit copy \
511
			cleanup commit copy delete export help \
528
				  delete export help import info list ls \
512
			import info list ls lock log merge mkdir \
529
				  lock log merge mkdir move propdel propedit \
513
			move propdel propedit propget proplist \
530
				  propget proplist propset resolved revert \
514
			propset resolved revert status switch unlock \
531
				  status switch unlock update)@' \
515
			update)@' 'p@1@(add blame cat checkout \
532
			'p@1@(add blame cat checkout cleanup commit copy \
516
			cleanup commit copy delete export help \
533
			      delete export help import info list ls lock \
517
			import info list ls lock log merge mkdir \
534
			      log merge mkdir move propdel propedit propget \
518
			move propdel propedit propget proplist \
535
			      proplist propset resolved revert status switch \
519
			propset resolved revert status switch unlock \
536
			      unlock update)@'
520
			update)@'
537
521
    complete cxx	'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
538
complete cxx		'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
522
    complete detex	'p/*/f:*.tex/'
539
complete detex		'p/*/f:*.tex/'
523
    complete edquota    'n/*/u/'
540
complete edquota	'n/*/u/'
524
    complete exec	'p/1/c/'
541
complete exec		'p/1/c/'
525
    complete ghostview	'p/*/f:*.ps/'
542
complete ghostview	'p/*/f:*.ps/'
526
    complete gv		'p/*/f:*.ps/'
543
complete gv		'p/*/f:*.ps/'
527
    complete ifconfig	'p@1@`ifconfig -l`@' 'n/*/(range phase link netmask \
544
complete ifconfig	'p@1@`ifconfig -l`@' \
528
			mtu vlandev vlan metric mediaopt down delete \
545
			'n/*/(range phase link netmask mtu vlandev vlan \
529
			broadcast arp debug)/'
546
			    metric mediaopt down delete broadcast arp debug)/'
530
    complete imake	'c/-I/d/'
547
complete imake		'c/-I/d/'
531
    complete ipfw 	'p/1/(flush add delete list show zero)/' \
548
complete ipfw		'p/1/(flush add delete list show zero)/' \
532
			'n/add/(allow permit accept pass deny drop reject \
549
			'n/add/(allow permit accept pass deny drop reject \
533
			reset count skipto num divert port tee port)/'
550
				reset count skipto num divert port tee port)/'
534
    complete javac	'p/*/f:*.java/'
551
complete javac		'p/*/f:*.java/'
535
    complete ldif2ldbm	'n/-i/f:*.ldif/'
552
complete ldif2ldbm	'n/-i/f:*.ldif/'
536
    complete libtool	'c/--mode=/(compile execute finish install link \
553
complete libtool	'c/--mode=/(compile execute finish install link \
537
			uninstall)/' 'c/--/(config debug dry-run features \
554
				    uninstall)/' \
538
			finish help quiet silent version mode=)/'
555
			'c/--/(config debug dry-run features finish help \
539
    complete libtoolize	'c/--/(automake copy debug dry-run force help ltdl \
556
				quiet silent version mode=)/'
540
			ltdl-tar version)/'
557
complete libtoolize	'c/--/(automake copy debug dry-run force help ltdl \
541
    complete links	'c/-/(assume-codepage async-dns download-dir \
558
				ltdl-tar version)/'
542
			format-cache-size ftp-proxy help http-proxy \
559
complete links		'c/-/(assume-codepage async-dns download-dir \
543
			max-connections max-connections-to-host \
560
			      format-cache-size ftp-proxy help http-proxy \
544
			memory-cache-size receive-timeout retries \
561
			      max-connections max-connections-to-host \
545
			unrestartable-receive-timeout version)/'
562
			      memory-cache-size receive-timeout retries \
546
    complete natd	c/-/'(alias_address config deny_incoming dynamic \
563
			      unrestartable-receive-timeout version)/'
547
			inport interface log log_denied log_facility \
564
complete natd		c/-/'(alias_address config deny_incoming dynamic \
548
			outport outport port pptpalias proxy_only \
565
			      inport interface log log_denied log_facility \
549
			proxy_rule redirect_address redirect_port \
566
			      outport outport port pptpalias proxy_only \
550
			reverse same_ports unregistered_only use_sockets \
567
			      proxy_rule redirect_address redirect_port \
551
			verbose)'/ 'n@-interface@`ifconfig -l`@'
568
			      reverse same_ports unregistered_only use_sockets \
552
    complete netstat	'n@-I@`ifconfig -l`@'
569
			      verbose)'/ \
553
    complete objdump	'c/--/(adjust-vma= all-headers architecture= \
570
			'n@-interface@`ifconfig -l`@'
554
			archive-headers debugging demangle disassemble \
571
complete netstat	'n@-I@`ifconfig -l`@'
555
			disassemble-all disassemble-zeroes dynamic-reloc \
572
complete objdump	'c/--/(adjust-vma= all-headers architecture= \
556
			dynamic-syms endian= file-headers full-contents \
573
			      archive-headers debugging demangle disassemble \
557
			headers help info line-numbers no-show-raw-insn \
574
			      disassemble-all disassemble-zeroes dynamic-reloc \
558
			prefix-addresses private-headers reloc section-headers \
575
			      dynamic-syms endian= file-headers full-contents \
559
			section=source stabs start-address= stop-address= \
576
			      headers help info line-numbers no-show-raw-insn \
560
			syms target= version wide)/' \
577
			      prefix-addresses private-headers reloc \
578
			      section-headers section=source stabs \
579
			      start-address= stop-address= syms target= \
580
			      version wide)/' \
561
			'c/-/(a h i f C d D p r R t T x s S l w)/'
581
			'c/-/(a h i f C d D p r R t T x s S l w)/'
562
    complete xmodmap	'c/-/(display help grammar verbose quiet n e pm pk \
582
complete xmodmap	'c/-/(display help grammar verbose quiet n e pm pk \
563
			pke pp)/'
583
			      pke pp)/'
564
    complete lynx	'c/-/(accept_all_cookies anonymous assume_charset= \
584
complete lynx		'c/-/(accept_all_cookies anonymous assume_charset= \
565
			assume_local_charset= assume_unrec_charset= auth= base \
585
			      assume_local_charset= assume_unrec_charset= \
566
			book buried_news cache= case cfg= child cookie_file= \
586
			      auth= base book buried_news cache= case cfg= \
567
			cookies core crawl debug_partial display= dump editor= \
587
			      child cookie_file= cookies core crawl \
568
			emacskeys enable_scrollback error_file= force_html \
588
			      debug_partial display= dump editor= emacskeys \
569
			force_secure forms_options from ftp get_data head help \
589
			      enable_scrollback error_file= force_html \
570
			hiddenlinks= historical homepage= image_links index= \
590
			      force_secure forms_options from ftp get_data \
571
			ismap link= localhost mime_header minimal \
591
			      head help hiddenlinks= historical homepage= \
572
			newschunksize= newsmaxchunk= nobrowse nocc nocolor \
592
			      image_links index= ismap link= localhost \
573
			nofilereferer nolist nolog nopause noprint noredir \
593
			      mime_header minimal newschunksize= \
574
			noreferer nostatus number_links partial partial_thres \
594
			      newsmaxchunk= nobrowse nocc nocolor \
575
			pauth= popup post_data preparsed print pseudo_inlines \
595
			      nofilereferer nolist nolog nopause noprint \
576
			raw realm reload restrictions= resubmit_posts rlogin \
596
			      noredir noreferer nostatus number_links \
577
			selective show_cursor soft_dquotes source stack_dump \
597
			      partial partial_thres pauth= popup post_data \
578
			startfile_ok tagsoup telnet term= tlog trace traversal \
598
			      preparsed print pseudo_inlines raw realm \
579
			underscore useragent= validate verbose version vikeys \
599
			      reload restrictions= resubmit_posts rlogin \
580
			width=)/' 'c/(http|ftp)/$URLS/'
600
			      selective show_cursor soft_dquotes source \
581
    complete gmake	'c/{--directory=,--include-dir=}/d/' \
601
			      stack_dump startfile_ok tagsoup telnet term= \
602
			      tlog trace traversal underscore useragent= \
603
			      validate verbose version vikeys width=)/' \
604
			'c/(http|ftp)/$URLS/'
605
complete gmake		'c/{--directory=,--include-dir=}/d/' \
582
			'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
606
			'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
583
			'c/--/(assume-new= assume-old= debug directory= \
607
			'c/--/(assume-new= assume-old= debug directory= \
584
			dry-run environment-overrides file= help \
608
			      dry-run environment-overrides file= help \
585
			ignore-errors include-dir= jobs[=N] just-print \
609
			      ignore-errors include-dir= jobs[=N] just-print \
586
			keep-going load-average[=N] makefile= max-load[=N] \
610
			      keep-going load-average[=N] makefile= \
587
			new-file= no-builtin-rules no-keep-going \
611
			      max-load[=N] new-file= no-builtin-rules \
588
			no-print-directory old-file= print-data-base \
612
			      no-keep-going no-print-directory old-file= \
589
			print-directory question quiet recon silent stop \
613
			      print-data-base print-directory question quiet \
590
			touch version warn-undefined-variables what-if=)/' \
614
			      recon silent stop touch version \
615
			      warn-undefined-variables what-if=)/' \
591
			'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
616
			'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
592
			'n/=/f/' 'n/-f/f/'
617
			'n/=/f/' \
593
    complete mixer	p/1/'(vol bass treble synth pcm speaker mic cd mix \
618
			'n/-f/f/'
594
			pcm2 rec igain ogain line1 line2 line3)'/ \
619
complete mixer		p/1/'(vol bass treble synth pcm speaker mic cd mix \
620
			      pcm2 rec igain ogain line1 line2 line3)'/ \
595
			p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
621
			p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
596
622
597
    complete mpg123	'c/--/(2to1 4to1 8bit aggressive au audiodevice \
623
complete mpg123		'c/--/(2to1 4to1 8bit aggressive au audiodevice auth \
598
    			auth buffer cdr check doublespeed equalizer frames \
624
			      buffer cdr check doublespeed equalizer frames \
599
			gain halfspeed headphones left lineout list mix mono \
625
			      gain halfspeed headphones left lineout list \
600
			proxy quiet random rate reopen resync right scale \
626
			      mix mono proxy quiet random rate reopen resync \
601
			shuffle single0 single1 skip speaker stdout stereo \
627
			      right scale shuffle single0 single1 skip \
602
			test verbose wav)/'
628
			      speaker stdout stereo test verbose wav)/'
603
    complete mysqladmin	'n/*/(create drop extended-status flush-hosts \
629
complete mysqladmin	'n/*/(create drop extended-status flush-hosts \
604
			flush-logs flush-status flush-tables flush-privileges \
630
			      flush-logs flush-status flush-tables \
605
			kill password ping processlist reload refresh \
631
			      flush-privileges kill password ping \
606
			shutdown status variables version)/'
632
			      processlist reload refresh shutdown status \
607
    complete mutt	"c@-f=@F:${HOME}/Mail/@" \
633
			      variables version)/'
608
			n/-a/f/ \
609
			n/-F/f/ n/-H/f/ \
610
			n/-s/x:'<subject line>'/ \
611
			n/-e/x:'<command>'/ \
612
			n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
613
			n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
614
			n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
615
    complete ndc	'n/*/(status dumpdb reload stats trace notrace \
616
			querylog start stop restart )/'
617
    if ($?traditional_complete) then
618
        complete nm \
619
		'c/--/(debug-syms defined-only demangle dynamic \
620
			extern-only format= help line-numbers no-demangle \
621
			no-sort numeric-sort portability print-armap \
622
			print-file-name reverse-sort size-sort undefined-only \
623
			version)/' 'p/*/f:^*.{h,C,c,cc}/'
624
    else
625
	complete nm \
626
		'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
627
		'c/--target=/x:<bfdname>/' \
628
		'c/--format=/(bsd sysv posix)/n/' \
629
		'c/--/(debugsyms extern-only demangle dynamic print-armap \
630
			print-file-name numeric-sort no-sort reverse-sort \
631
			size-sort undefined-only portability target= radix= \
632
			format= defined-only\ line-numbers no-demangle version \
633
			help)//' \
634
		'n/*/f:^*.{h,c,cc,s,S}/'
635
    endif
636
    complete nmap	'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
637
    complete perldoc 	'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
638
    complete postfix    'n/*/(start stop reload abort flush check)/'
639
    complete postmap	'n/1/(hash: regexp:)/' 'c/hash:/f/' 'c/regexp:/f/'
640
    complete rcsdiff	'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
641
    complete X		'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
642
			allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
643
			bgamma bpp broadcast bs c cc class co core deferglyphs \
644
			disableModInDev disableVidMode displayID dpi dpms f fc \
645
			flipPixels fn fp gamma ggamma help indirect kb keeptty \
646
			ld lf logo ls nolisten string noloadxkb nolock nopn \
647
			once p pn port probeonly query quiet r rgamma s \
648
			showconfig sp su t terminate to tst v verbose version \
649
			weight wm x xkbdb xkbmap)/'
650
    complete users      'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
651
    complete vidcontrol	'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
652
			80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
653
			VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
654
			VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
655
			VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
656
    complete vim	'n/*/f:^*.[oa]/'
657
    complete where	'n/*/c/'
658
    complete which	'n/*/c/'
659
    complete wmsetbg	'c/-/(display D S a b c d e m p s t u w)/' \
660
			'c/--/(back-color center colors dither help match \
661
			maxscale parse scale smooth tile update-domain \
662
			update-wmaker version workspace)/'
663
    complete xdb	'p/1/c/'
664
    complete xdvi	'c/-/(allowshell debug display expert gamma hushchars \
665
			hushchecksums hushspecials install interpreter keep \
666
			margins nogrey noinstall nomakepk noscan paper safer \
667
			shrinkbuttonn thorough topmargin underlink version)/' \
668
			'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
669
    complete xlock	'c/-/(allowaccess allowroot debug description \
670
			echokeys enablesaver grabmouse grabserver hide inroot \
671
			install inwindow mono mousemotion nolock remote \
672
			resetsaver sound timeelapsed use3d usefirst verbose \
673
			wireframe background batchcount bg bitmap both3d \
674
			count cycles delay delta3d display dpmsoff \
675
			dpmsstandby dpmssuspend endCmd erasedelay erasemode \
676
			erasetime fg font foreground geometry help \
677
			icongeometry info invalid left3d lockdelay logoutCmd \
678
			mailCmd mailIcon message messagefile messagefont \
679
			messagesfile mode name ncolors nice nomailIcon none3d \
680
			parent password planfont program resources right3d \
681
			saturation size startCmd timeout username validate \
682
			version visual)/' 'n/-mode/(ant atlantis ball bat \
683
			blot bouboule bounce braid bubble bubble3d bug cage \
684
			cartoon clock coral crystal daisy dclock decay deco \
685
			demon dilemma discrete drift eyes fadeplot flag flame \
686
			flow forest galaxy gears goop grav helix hop hyper \
687
			ico ifs image invert julia kaleid kumppa lament laser \
688
			life life1d life3d lightning lisa lissie loop lyapunov \
689
			mandelbrot marquee matrix maze moebius morph3d \
690
			mountain munch nose pacman penrose petal pipes puzzle \
691
			pyro qix roll rotor rubik shape sierpinski slip sphere \
692
			spiral spline sproingies stairs star starfish strange \
693
			superquadrics swarm swirl tetris thornbird triangle \
694
			tube turtle vines voters wator wire world worm xjack \
695
			blank bomb random)/' 
696
    complete xfig	'c/-/(display)/' 'p/*/f:*.fig/'
697
    complete wget 	c/--/"(accept= append-output= background cache= \
698
			continue convert-links cut-dirs= debug \
699
			delete-after directory-prefix= domains= \
700
			dont-remove-listing dot-style= exclude-directories= \
701
			exclude-domains= execute= follow-ftp \
702
			force-directories force-html glob= header= help \
703
			http-passwd= http-user= ignore-length \
704
			include-directories= input-file= level= mirror \
705
			no-clobber no-directories no-host-directories \
706
			no-host-lookup no-parent non-verbose \
707
			output-document= output-file= passive-ftp \
708
			proxy-passwd= proxy-user= proxy= quiet quota= \
709
			recursive reject= relative retr-symlinks save-headers \
710
			server-response span-hosts spider timeout= \
711
			timestamping tries= user-agent= verbose version wait=)"/
712
634
713
    # these from Tom Warzeka <tom@waz.cc>
635
complete mutt \
636
  "c@-f=@F:${HOME}/Mail/@" \
637
  n/-a/f/ \
638
  n/-F/f/ \
639
  n/-H/f/ \
640
  n/-s/x:'<subject line>'/ \
641
  n/-e/x:'<command>'/ \
642
  n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
643
  n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
644
  n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
714
645
715
    # this one works but is slow and doesn't descend into subdirectories
646
complete ndc	'n/*/(status dumpdb reload stats trace notrace \
716
    # complete	cd	C@[./\$~]*@d@ \
647
		    querylog start stop restart )/'
717
    #			p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
718
648
719
    if ( -r /etc/shells ) then
649
complete nm \
720
        complete setenv	p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
650
  'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
721
    else
651
  'c/--target=/x:<bfdname>/' \
722
	complete setenv	p@1@e@ n@DISPLAY@\$hosts@:
652
  'c/--format=/(bsd sysv posix)/n/' \
723
    endif
653
  'c/--/(debugsyms extern-only demangle dynamic print-armap \
724
    complete unsetenv	n/*/e/
654
	  print-file-name numeric-sort no-sort reverse-sort \
655
	  size-sort undefined-only portability target= radix= \
656
	  format= defined-only\ line-numbers no-demangle version \
657
	  help)//' \
658
  'n/*/f:^*.{h,c,cc,s,S}/'
725
659
726
    set _maildir = /var/mail
660
complete nmap	'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
727
    if (-r "$HOME/.mailrc") then
661
complete perldoc 	'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
728
        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
662
complete postfix    'n/*/(start stop reload abort flush check)/'
729
			"c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
663
complete postmap	'n/1/(hash: regexp:)/' 'c/hash:/f/' 'c/regexp:/f/'
730
			n@-u@T:$_maildir@ n/-f/f/ \
664
complete rcsdiff	'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
731
			n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
665
complete X		'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
732
			tr -s " " "	" | cut -f 2`'@
666
		    allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
667
		    bgamma bpp broadcast bs c cc class co core deferglyphs \
668
		    disableModInDev disableVidMode displayID dpi dpms f fc \
669
		    flipPixels fn fp gamma ggamma help indirect kb keeptty \
670
		    ld lf logo ls nolisten string noloadxkb nolock nopn \
671
		    once p pn port probeonly query quiet r rgamma s \
672
		    showconfig sp su t terminate to tst v verbose version \
673
		    weight wm x xkbdb xkbmap)/'
674
complete users      'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
675
complete vidcontrol	'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
676
		    80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
677
		    VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
678
		    VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
679
		    VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
680
complete vim	'n/*/f:^*.[oa]/'
681
complete where	'n/*/c/'
682
complete which	'n/*/c/'
683
complete wmsetbg	'c/-/(display D S a b c d e m p s t u w)/' \
684
		    'c/--/(back-color center colors dither help match \
685
		    maxscale parse scale smooth tile update-domain \
686
		    update-wmaker version workspace)/'
687
complete xdb	'p/1/c/'
688
complete xdvi	'c/-/(allowshell debug display expert gamma hushchars \
689
		    hushchecksums hushspecials install interpreter keep \
690
		    margins nogrey noinstall nomakepk noscan paper safer \
691
		    shrinkbuttonn thorough topmargin underlink version)/' \
692
		    'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
693
complete xlock	'c/-/(allowaccess allowroot debug description \
694
		    echokeys enablesaver grabmouse grabserver hide inroot \
695
		    install inwindow mono mousemotion nolock remote \
696
		    resetsaver sound timeelapsed use3d usefirst verbose \
697
		    wireframe background batchcount bg bitmap both3d \
698
		    count cycles delay delta3d display dpmsoff \
699
		    dpmsstandby dpmssuspend endCmd erasedelay erasemode \
700
		    erasetime fg font foreground geometry help \
701
		    icongeometry info invalid left3d lockdelay logoutCmd \
702
		    mailCmd mailIcon message messagefile messagefont \
703
		    messagesfile mode name ncolors nice nomailIcon none3d \
704
		    parent password planfont program resources right3d \
705
		    saturation size startCmd timeout username validate \
706
		    version visual)/' 'n/-mode/(ant atlantis ball bat \
707
		    blot bouboule bounce braid bubble bubble3d bug cage \
708
		    cartoon clock coral crystal daisy dclock decay deco \
709
		    demon dilemma discrete drift eyes fadeplot flag flame \
710
		    flow forest galaxy gears goop grav helix hop hyper \
711
		    ico ifs image invert julia kaleid kumppa lament laser \
712
		    life life1d life3d lightning lisa lissie loop lyapunov \
713
		    mandelbrot marquee matrix maze moebius morph3d \
714
		    mountain munch nose pacman penrose petal pipes puzzle \
715
		    pyro qix roll rotor rubik shape sierpinski slip sphere \
716
		    spiral spline sproingies stairs star starfish strange \
717
		    superquadrics swarm swirl tetris thornbird triangle \
718
		    tube turtle vines voters wator wire world worm xjack \
719
		    blank bomb random)/' 
720
complete xfig	'c/-/(display)/' 'p/*/f:*.fig/'
721
complete wget 	c/--/"(accept= append-output= background cache= \
722
		    continue convert-links cut-dirs= debug \
723
		    delete-after directory-prefix= domains= \
724
		    dont-remove-listing dot-style= exclude-directories= \
725
		    exclude-domains= execute= follow-ftp \
726
		    force-directories force-html glob= header= help \
727
		    http-passwd= http-user= ignore-length \
728
		    include-directories= input-file= level= mirror \
729
		    no-clobber no-directories no-host-directories \
730
		    no-host-lookup no-parent non-verbose \
731
		    output-document= output-file= passive-ftp \
732
		    proxy-passwd= proxy-user= proxy= quiet quota= \
733
		    recursive reject= relative retr-symlinks save-headers \
734
		    server-response span-hosts spider timeout= \
735
		    timestamping tries= user-agent= verbose version wait=)"/
736
737
# these from Tom Warzeka <tom@waz.cc>
738
739
# this one works but is slow and doesn't descend into subdirectories
740
# complete	cd	C@[./\$~]*@d@ \
741
#			p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
742
743
if ( -r /etc/shells ) then
744
    complete setenv	p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
745
else
746
    complete setenv	p@1@e@ n@DISPLAY@\$hosts@:
747
endif
748
complete unsetenv	n/*/e/
749
750
set _maildir = /var/mail
751
if (-r "$HOME/.mailrc") then
752
    complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
753
		    "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
754
		    n@-u@T:$_maildir@ n/-f/f/ \
755
		    n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
756
		    tr -s " " "	" | cut -f 2`'@
757
else
758
    complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
759
		    "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
760
		    n@-u@T:$_maildir@ n/-f/f/ n/*/u/
761
endif
762
unset _maildir
763
764
if (! $?MANPATH) then
765
    if (-r /usr/share/man) then
766
	setenv MANPATH /usr/share/man:
733
    else
767
    else
734
        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
768
	setenv MANPATH /usr/man:
735
			"c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
736
			n@-u@T:$_maildir@ n/-f/f/ n/*/u/
737
    endif
769
    endif
738
    unset _maildir
770
endif
739
771
740
    if (! $?MANPATH) then
772
if ($?traditional_complete) then
741
	if (-r /usr/share/man) then
773
    # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
742
	    setenv MANPATH /usr/share/man:
774
    # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
743
	else
775
    complete man \
744
	    setenv MANPATH /usr/man:
776
	'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
745
	endif
777
	'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
746
    endif
778
	'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
747
779
	'n@4@`set q = "$MANPATH:as%:%/man4 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.4.\*\$%%`@'\
748
    if ($?traditional_complete) then
780
	'n@5@`set q = "$MANPATH:as%:%/man5 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.5.\*\$%%`@'\
749
        # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
781
	'n@6@`set q = "$MANPATH:as%:%/man6 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.6.\*\$%%`@'\
750
        # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
782
	'n@7@`set q = "$MANPATH:as%:%/man7 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.7.\*\$%%`@'\
751
        complete man \
783
	'n@8@`set q = "$MANPATH:as%:%/man8 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.8.\*\$%%`@'\
752
	    'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
784
	'n@9@`set q = "$MANPATH:as%:%/man9 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.9.\*\$%%`@'\
753
	    'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
785
	'n@0@`set q = "$MANPATH:as%:%/man0 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.0.\*\$%%`@'\
754
	    'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
786
	'n@n@`set q = "$MANPATH:as%:%/mann %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.n.\*\$%%`@'\
755
	    'n@4@`set q = "$MANPATH:as%:%/man4 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.4.\*\$%%`@'\
787
	'n@o@`set q = "$MANPATH:as%:%/mano %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.o.\*\$%%`@'\
756
	    'n@5@`set q = "$MANPATH:as%:%/man5 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.5.\*\$%%`@'\
788
	'n@l@`set q = "$MANPATH:as%:%/manl %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.l.\*\$%%`@'\
757
	    'n@6@`set q = "$MANPATH:as%:%/man6 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.6.\*\$%%`@'\
789
	'n@p@`set q = "$MANPATH:as%:%/manp %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.p.\*\$%%`@'\
758
	    'n@7@`set q = "$MANPATH:as%:%/man7 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.7.\*\$%%`@'\
790
	c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:'<keyword>'@ n@-[MP]@d@   \
759
	    'n@8@`set q = "$MANPATH:as%:%/man8 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.8.\*\$%%`@'\
791
	'N@-[MP]@`\ls -1 $:-1/man? |& sed -n s%\\..\\+\$%%p`@'            \
760
	    'n@9@`set q = "$MANPATH:as%:%/man9 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.9.\*\$%%`@'\
792
	'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
761
	    'n@0@`set q = "$MANPATH:as%:%/man0 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.0.\*\$%%`@'\
793
	'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
762
	    'n@n@`set q = "$MANPATH:as%:%/mann %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.n.\*\$%%`@'\
794
	#n@*@c@ # old way -- commands only
763
	    'n@o@`set q = "$MANPATH:as%:%/mano %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.o.\*\$%%`@'\
795
else
764
	    'n@l@`set q = "$MANPATH:as%:%/manl %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.l.\*\$%%`@'\
796
    complete man	    n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
765
	    'n@p@`set q = "$MANPATH:as%:%/manp %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.p.\*\$%%`@'\
797
			n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
766
	    c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:'<keyword>'@ n@-[MP]@d@   \
798
			n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
767
	    'N@-[MP]@`\ls -1 $:-1/man? |& sed -n s%\\..\\+\$%%p`@'            \
799
			n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
768
	    'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
800
			n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
769
	    'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
801
			n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
770
	    #n@*@c@ # old way -- commands only
802
			n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
771
    else
803
			n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
772
        complete man	    n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
804
n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
773
			    n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
805
n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
774
			    n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
806
n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
775
			    n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
807
n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
776
			    n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
777
			    n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
778
			    n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
779
			    n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
780
    n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
781
    n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
782
  n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
783
  n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
784
n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
808
n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
785
n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
809
n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
786
		c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
810
	    c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
787
		N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
811
	    N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
788
    endif
812
endif
789
813
790
    complete ps	        c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
814
complete ps	        c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
791
			n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
815
		    n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
792
    complete compress	c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
816
complete compress	c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
793
    complete uncompress	c/-/"(c f v)"/                        n/*/f:*.Z/
817
complete uncompress	c/-/"(c f v)"/                        n/*/f:*.Z/
794
818
795
    complete uuencode	p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
819
complete uuencode	p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
796
    complete uudecode	c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
820
complete uudecode	c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
797
821
798
    complete xhost	c/[+-]/\$hosts/ n/*/\$hosts/
822
complete xhost	c/[+-]/\$hosts/ n/*/\$hosts/
799
    complete xpdf	c/-/"(z g remote raise quit cmap rgb papercolor       \
823
complete xpdf	c/-/"(z g remote raise quit cmap rgb papercolor       \
800
			      eucjp t1lib freetype ps paperw paperh level1    \
824
			  eucjp t1lib freetype ps paperw paperh level1    \
801
			      upw fullscreen cmd q v h help)"/                \
825
			  upw fullscreen cmd q v h help)"/                \
802
			n/-z/x:'<zoom (-5 .. +5) or "page" or "width">'/      \
826
		    n/-z/x:'<zoom (-5 .. +5) or "page" or "width">'/      \
803
			n/-g/x:'<geometry>'/ n/-remote/x:'<name>'/            \
827
		    n/-g/x:'<geometry>'/ n/-remote/x:'<name>'/            \
804
			n/-rgb/x:'<number>'/ n/-papercolor/x:'<color>'/       \
828
		    n/-rgb/x:'<number>'/ n/-papercolor/x:'<color>'/       \
805
			n/-{t1lib,freetype}/x:'<font_type>'/                  \
829
		    n/-{t1lib,freetype}/x:'<font_type>'/                  \
806
			n/-ps/x:'<PS_file>'/ n/-paperw/x:'<width>'/           \
830
		    n/-ps/x:'<PS_file>'/ n/-paperw/x:'<width>'/           \
807
			n/-paperh/x:'<height>'/ n/-upw/x:'<password>'/        \
831
		    n/-paperh/x:'<height>'/ n/-upw/x:'<password>'/        \
808
			n/-/f:*.{pdf,PDF}/                                    \
832
		    n/-/f:*.{pdf,PDF}/                                    \
809
			N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
833
		    N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
810
			N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
834
		    N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
811
835
812
    complete tcsh	c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
836
complete tcsh	c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
813
			c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
837
		    c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
814
			n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
838
		    n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
815
839
816
    complete rpm	c/--/"(query verify nodeps nofiles nomd5 noscripts    \
840
complete rpm	c/--/"(query verify nodeps nofiles nomd5 noscripts    \
817
	                nogpg nopgp install upgrade freshen erase allmatches  \
841
		    nogpg nopgp install upgrade freshen erase allmatches  \
818
		        notriggers repackage test rebuild recompile initdb    \
842
		    notriggers repackage test rebuild recompile initdb    \
819
		        rebuilddb addsign resign querytags showrc setperms    \
843
		    rebuilddb addsign resign querytags showrc setperms    \
820
		        setugids all file group package querybynumber qf      \
844
		    setugids all file group package querybynumber qf      \
821
		        triggeredby whatprovides whatrequires changelog       \
845
		    triggeredby whatprovides whatrequires changelog       \
822
		        configfiles docfiles dump filesbypkg info last list   \
846
		    configfiles docfiles dump filesbypkg info last list   \
823
		        provides queryformat requires scripts state triggers  \
847
		    provides queryformat requires scripts state triggers  \
824
		        triggerscripts allfiles badreloc excludepath checksig \
848
		    triggerscripts allfiles badreloc excludepath checksig \
825
	                excludedocs force hash ignoresize ignorearch ignoreos \
849
		    excludedocs force hash ignoresize ignorearch ignoreos \
826
		        includedocs justdb noorder oldpackage percent prefix  \
850
		    includedocs justdb noorder oldpackage percent prefix  \
827
		        relocate replace-files replacepkgs buildroot clean    \
851
		    relocate replace-files replacepkgs buildroot clean    \
828
		        nobuild rmsource rmspec short-circuit sign target     \
852
		    nobuild rmsource rmspec short-circuit sign target     \
829
		        help version quiet rcfile pipe dbpath root specfile)"/\
853
		    help version quiet rcfile pipe dbpath root specfile)"/\
830
		        c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc  \
854
		    c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc  \
831
			ti tl ts a f g p c d l R s h ? v vv -)"/              \
855
		    ti tl ts a f g p c d l R s h ? v vv -)"/              \
832
		n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/  \
856
	    n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/  \
833
		n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
857
	    n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
834
		n/--what{provides,requires}/x:'<capability>'/ n/--root/d/     \
858
	    n/--what{provides,requires}/x:'<capability>'/ n/--root/d/     \
835
		n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/           \
859
	    n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/           \
836
		n/--excludepath/x:'<oldpath>'/  n/--prefix/x:'<newpath>'/     \
860
	    n/--excludepath/x:'<oldpath>'/  n/--prefix/x:'<newpath>'/     \
837
		n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
861
	    n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
838
		n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/       \
862
	    n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/       \
839
	        n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
863
	    n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
840
864
841
    # these conform to the latest GNU versions available at press time ...
865
# these conform to the latest GNU versions available at press time ...
842
    # updates by John Gotts <jgotts@engin.umich.edu>
866
# updates by John Gotts <jgotts@engin.umich.edu>
843
    if (-X emacs) then
867
if (-X emacs) then
844
      # TW note:  if your version of GNU Emacs supports the "--version" option,
868
  # TW note:  if your version of GNU Emacs supports the "--version" option,
845
      #           uncomment this line and comment the next to automatically
869
  #           uncomment this line and comment the next to automatically
846
      #           detect the version, else set "_emacs_ver" to your version.
870
  #           detect the version, else set "_emacs_ver" to your version.
847
      #set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
871
  #set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
848
      set _emacs_ver=21.3
872
  set _emacs_ver=21.3
849
      set _emacs_dir=`which emacs | sed s%/bin/emacs%%` 
873
  set _emacs_dir=`which emacs | sed s%/bin/emacs%%` 
850
      complete emacs	c/--/"(batch terminal display no-windows no-init-file \
874
  complete emacs	c/--/"(batch terminal display no-windows no-init-file \
851
                               user debug-init unibyte multibyte version help \
875
			   user debug-init unibyte multibyte version help \
852
                               no-site-file funcall load eval insert kill)"/ \
876
			   no-site-file funcall load eval insert kill)"/ \
853
                        c/-/"(t d nw q u f l -)"/ c/+/x:'<line_number>'/ \
877
		    c/-/"(t d nw q u f l -)"/ c/+/x:'<line_number>'/ \
854
			n/{-t,--terminal}/x:'<terminal>'/ n/{-d,--display}/x:'<display>'/ \
878
		    n/{-t,--terminal}/x:'<terminal>'/ n/{-d,--display}/x:'<display>'/ \
855
	                n/{-u,--user}/u/ n/{-f,--funcall}/x:'<lisp_function>'/ \
879
		    n/{-u,--user}/u/ n/{-f,--funcall}/x:'<lisp_function>'/ \
856
			n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@ \
880
		    n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@ \
857
			n/--eval/x:'<expression>'/ n/--insert/f/ n/*/f:^*[\#~]/
881
		    n/--eval/x:'<expression>'/ n/--insert/f/ n/*/f:^*[\#~]/
858
      unset _emacs_ver _emacs_dir
882
  unset _emacs_ver _emacs_dir
859
    endif
883
endif
860
884
861
    complete gzcat	c/--/"(force help license quiet version)"/ \
885
complete gzcat	c/--/"(force help license quiet version)"/ \
862
			c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
886
		    c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
863
    complete gzip	c/--/"(stdout to-stdout decompress uncompress \
887
complete gzip	c/--/"(stdout to-stdout decompress uncompress \
864
			force help list license no-name quiet recurse \
888
		    force help list license no-name quiet recurse \
865
			suffix test verbose version fast best)"/ \
889
		    suffix test verbose version fast best)"/ \
866
			c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
890
		    c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
867
			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
891
		    n/{-S,--suffix}/x:'<file_name_suffix>'/ \
868
			n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
892
		    n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
869
			N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
893
		    N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
870
			n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
894
		    n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
871
    complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
895
complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
872
			no-name quiet recurse suffix test verbose version)"/ \
896
		    no-name quiet recurse suffix test verbose version)"/ \
873
			c/-/"(c f h l L n q r S t v V -)"/ \
897
		    c/-/"(c f h l L n q r S t v V -)"/ \
874
			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
898
		    n/{-S,--suffix}/x:'<file_name_suffix>'/ \
875
			n/*/f:*.{gz,Z,z,zip,taz,tgz}/
899
		    n/*/f:*.{gz,Z,z,zip,taz,tgz}/
876
    complete zgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
900
complete zgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
877
			c/-/"(A b B c C e f h i l n s v V w x)"/ \
901
		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
878
			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
902
		    p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
879
			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
903
		    n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
880
    complete zegrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
904
complete zegrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
881
			c/-/"(A b B c C e f h i l n s v V w x)"/ \
905
		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
882
			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
906
		    p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
883
			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
907
		    n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
884
    complete zfgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
908
complete zfgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
885
			c/-/"(A b B c C e f h i l n s v V w x)"/ \
909
		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
886
			p/1/x:'<fixed_string>'/ N/-*e/f/ \
910
		    p/1/x:'<fixed_string>'/ N/-*e/f/ \
887
			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
911
		    n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
888
    complete znew	c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
912
complete znew	c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
889
    complete zmore	n/*/f:*.{gz,Z,z,zip}/
913
complete zmore	n/*/f:*.{gz,Z,z,zip}/
890
    complete zfile	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
914
complete zfile	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
891
    complete ztouch	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
915
complete ztouch	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
892
    complete zforce	n/*/f:^*.{gz,tgz}/
916
complete zforce	n/*/f:^*.{gz,tgz}/
893
917
894
    complete dcop 'p/1/`$:0`/ /' \
918
complete dcop 'p/1/`$:0`/ /' \
895
	'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
919
    'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
896
	'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
920
    'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
897
921
898
922
899
    complete grep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
923
complete grep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
900
			c/--/"(extended-regexp fixed-regexp basic-regexp \
924
		    c/--/"(extended-regexp fixed-regexp basic-regexp \
901
			regexp file ignore-case word-regexp line-regexp \
925
		    regexp file ignore-case word-regexp line-regexp \
902
			no-messages revert-match version help byte-offset \
926
		    no-messages revert-match version help byte-offset \
903
			line-number with-filename no-filename quiet silent \
927
		    line-number with-filename no-filename quiet silent \
904
			text directories recursive files-without-match \
928
		    text directories recursive files-without-match \
905
			files-with-matches count before-context after-context \
929
		    files-with-matches count before-context after-context \
906
			context binary unix-byte-offsets)"/ \
930
		    context binary unix-byte-offsets)"/ \
907
			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
931
		    c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
908
				v w x)"/ \
932
			    v w x)"/ \
909
			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
933
		    p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
910
			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
934
		    n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
911
    complete egrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
935
complete egrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
912
			c/--/"(extended-regexp fixed-regexp basic-regexp \
936
		    c/--/"(extended-regexp fixed-regexp basic-regexp \
913
			regexp file ignore-case word-regexp line-regexp \
937
		    regexp file ignore-case word-regexp line-regexp \
914
			no-messages revert-match version help byte-offset \
938
		    no-messages revert-match version help byte-offset \
915
			line-number with-filename no-filename quiet silent \
939
		    line-number with-filename no-filename quiet silent \
916
			text directories recursive files-without-match \
940
		    text directories recursive files-without-match \
917
			files-with-matches count before-context after-context \
941
		    files-with-matches count before-context after-context \
918
			context binary unix-byte-offsets)"/ \
942
		    context binary unix-byte-offsets)"/ \
919
			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
943
		    c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
920
				v w x)"/ \
944
			    v w x)"/ \
921
			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
945
		    p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
922
			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
946
		    n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
923
    complete fgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
947
complete fgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
924
			c/--/"(extended-regexp fixed-regexp basic-regexp \
948
		    c/--/"(extended-regexp fixed-regexp basic-regexp \
925
			regexp file ignore-case word-regexp line-regexp \
949
		    regexp file ignore-case word-regexp line-regexp \
926
			no-messages revert-match version help byte-offset \
950
		    no-messages revert-match version help byte-offset \
927
			line-number with-filename no-filename quiet silent \
951
		    line-number with-filename no-filename quiet silent \
928
			text directories recursive files-without-match \
952
		    text directories recursive files-without-match \
929
			files-with-matches count before-context after-context \
953
		    files-with-matches count before-context after-context \
930
			context binary unix-byte-offsets)"/ \
954
		    context binary unix-byte-offsets)"/ \
931
			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
955
		    c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
932
				v w x)"/ \
956
			    v w x)"/ \
933
			p/1/x:'<fixed_string>'/ N/-*e/f/ \
957
		    p/1/x:'<fixed_string>'/ N/-*e/f/ \
934
			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
958
		    n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
935
959
936
    complete sed	c/--/"(quiet silent version help expression file)"/   \
960
complete sed	c/--/"(quiet silent version help expression file)"/   \
937
			c/-/"(n V e f -)"/ n/{-e,--expression}/x:'<script>'/  \
961
		    c/-/"(n V e f -)"/ n/{-e,--expression}/x:'<script>'/  \
938
			n/{-f,--file}/f:*.sed/ N/-{e,f,-{file,expression}}/f/ \
962
		    n/{-f,--file}/f:*.sed/ N/-{e,f,-{file,expression}}/f/ \
939
			n/-/x:'<script>'/ N/-/f/ p/1/x:'<script>'/ p/2/f/
963
		    n/-/x:'<script>'/ N/-/f/ p/1/x:'<script>'/ p/2/f/
940
964
941
    complete users	c/--/"(help version)"/ p/1/x:'<accounting_file>'/
965
complete users	c/--/"(help version)"/ p/1/x:'<accounting_file>'/
942
    complete who	c/--/"(heading idle count mesg message writable help \
966
complete who	c/--/"(heading idle count mesg message writable help \
943
    			version)"/ c/-/"(H i m q s T w u -)"/ \
967
		    version)"/ c/-/"(H i m q s T w u -)"/ \
944
			p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
968
		    p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
945
969
946
    complete chown	c/--/"(changes dereference no-dereference silent \
970
complete chown	c/--/"(changes dereference no-dereference silent \
947
    			quiet reference recursive verbose help version)"/ \
971
		    quiet reference recursive verbose help version)"/ \
948
			c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
972
		    c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
949
			n/-/u/: p/1/u/: n/*/f/
973
		    n/-/u/: p/1/u/: n/*/f/
950
    complete chgrp	c/--/"(changes no-dereference silent quiet reference \
974
complete chgrp	c/--/"(changes no-dereference silent quiet reference \
951
    			recursive verbose help version)"/ \
975
		    recursive verbose help version)"/ \
952
			c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
976
		    c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
953
    complete chmod	c/--/"(changes silent quiet verbose reference \
977
complete chmod	c/--/"(changes silent quiet verbose reference \
954
    			recursive help version)"/ c/-/"(c f R v)"/
978
		    recursive help version)"/ c/-/"(c f R v)"/
955
    complete df		c/--/"(all block-size human-readable si inodes \
979
complete df		c/--/"(all block-size human-readable si inodes \
956
			kilobytes local megabytes no-sync portability sync \
980
		    kilobytes local megabytes no-sync portability sync \
957
			type print-type exclude-type help version)"/ \
981
		    type print-type exclude-type help version)"/ \
958
			c/-/"(a H h i k l m P T t v x)"/
982
		    c/-/"(a H h i k l m P T t v x)"/
959
    complete du		c/--/"(all block-size bytes total dereference-args \
983
complete du		c/--/"(all block-size bytes total dereference-args \
960
    			human-readable si kilobytes count-links dereference \
984
		    human-readable si kilobytes count-links dereference \
961
			megabytes separate-dirs summarize one-file-system \
985
		    megabytes separate-dirs summarize one-file-system \
962
			exclude-from exclude max-depth help version"/ \
986
		    exclude-from exclude max-depth help version"/ \
963
			c/-/"(a b c D H h k L l m S s X x)"/
987
		    c/-/"(a b c D H h k L l m S s X x)"/
964
988
965
    complete cat	c/--/"(number-nonblank number squeeze-blank show-all \
989
complete cat	c/--/"(number-nonblank number squeeze-blank show-all \
966
			show-nonprinting show-ends show-tabs help version)"/ \
990
		    show-nonprinting show-ends show-tabs help version)"/ \
967
			c/-/"(A b E e n s T t u v -)"/ n/*/f/
991
		    c/-/"(A b E e n s T t u v -)"/ n/*/f/
968
    complete mv		c/--/"(backup force interactive update verbose suffix \
992
complete mv		c/--/"(backup force interactive update verbose suffix \
969
			version-control help version)"/ \
993
		    version-control help version)"/ \
970
			c/-/"(b f i S u V v -)"/ \
994
		    c/-/"(b f i S u V v -)"/ \
971
			n/{-S,--suffix}/x:'<suffix>'/ \
995
		    n/{-S,--suffix}/x:'<suffix>'/ \
972
			n/{-V,--version-control}/"(t numbered nil existing \
996
		    n/{-V,--version-control}/"(t numbered nil existing \
973
			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
997
		    never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
974
    complete cp		c/--/"(archive backup no-dereference force \
998
complete cp		c/--/"(archive backup no-dereference force \
975
    			interactive link preserve parents sparse recursive \
999
		    interactive link preserve parents sparse recursive \
976
			symbolic-link suffix update verbose version-control \
1000
		    symbolic-link suffix update verbose version-control \
977
			one-file-system help version)"/ \
1001
		    one-file-system help version)"/ \
978
			c/-/"(a b d f i l P p R r S s u V v x -)"/ \
1002
		    c/-/"(a b d f i l P p R r S s u V v x -)"/ \
979
			n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
1003
		    n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
980
			n/{-V,--version-control}/"(t numbered nil existing \
1004
		    n/{-V,--version-control}/"(t numbered nil existing \
981
			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
1005
		    never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
982
    complete ln		c/--/"(backup directory force no-dereference \
1006
complete ln		c/--/"(backup directory force no-dereference \
983
    			interactive symbolic suffix verbose version-control \
1007
		    interactive symbolic suffix verbose version-control \
984
			help version)"/ \
1008
		    help version)"/ \
985
			c/-/"(b d F f i n S s V v -)"/ \
1009
		    c/-/"(b d F f i n S s V v -)"/ \
986
			n/{-S,--suffix}/x:'<suffix>'/ \
1010
		    n/{-S,--suffix}/x:'<suffix>'/ \
987
			n/{-V,--version-control}/"(t numbered nil existing \
1011
		    n/{-V,--version-control}/"(t numbered nil existing \
988
			never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
1012
		    never simple)"/ n/-*/f/ N/-*/x:'<link_name>'/ \
989
			p/1/f/ p/2/x:'<link_name>'/
1013
		    p/1/f/ p/2/x:'<link_name>'/
990
    complete touch	c/--/"(date reference time help version)"/ \
1014
complete touch	c/--/"(date reference time help version)"/ \
991
			c/-/"(a c d f m r t -)"/ \
1015
		    c/-/"(a c d f m r t -)"/ \
992
			n/{-d,--date}/x:'<date_string>'/ \
1016
		    n/{-d,--date}/x:'<date_string>'/ \
993
			c/--time/"(access atime mtime modify use)"/ \
1017
		    c/--time/"(access atime mtime modify use)"/ \
994
			n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
1018
		    n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
995
    complete mkdir	c/--/"(mode parents verbose help version)"/ \
1019
complete mkdir	c/--/"(mode parents verbose help version)"/ \
996
    			c/-/"(p m -)"/ \
1020
		    c/-/"(p m -)"/ \
997
			n/{-m,--mode}/x:'<mode>'/ n/*/d/
1021
		    n/{-m,--mode}/x:'<mode>'/ n/*/d/
998
    complete rmdir	c/--/"(ignore-fail-on-non-empty parents verbose help \
1022
complete rmdir	c/--/"(ignore-fail-on-non-empty parents verbose help \
999
    			version)"/ c/-/"(p -)"/ n/*/d/
1023
		    version)"/ c/-/"(p -)"/ n/*/d/
1000
    complete env 	'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
1024
complete env 	'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
1001
1025
1002
    complete tar	c/-[Acru]*/"(b B C f F g G h i l L M N o P \
1026
complete tar	c/-[Acru]*/"(b B C f F g G h i l L M N o P \
1003
			R S T v V w W X z Z)"/ \
1027
		    R S T v V w W X z Z)"/ \
1004
			c/-[dtx]*/"( B C f F g G i k K m M O p P \
1028
		    c/-[dtx]*/"( B C f F g G i k K m M O p P \
1005
			R s S T v w x X z Z)"/ \
1029
		    R s S T v w x X z Z)"/ \
1006
			p/1/"(A c d r t u x -A -c -d -r -t -u -x \
1030
		    p/1/"(A c d r t u x -A -c -d -r -t -u -x \
1007
			--catenate --concatenate --create --diff --compare \
1031
		    --catenate --concatenate --create --diff --compare \
1008
			--delete --append --list --update --extract --get \
1032
		    --delete --append --list --update --extract --get \
1009
			--help --version)"/ \
1033
		    --help --version)"/ \
1010
			c/--/"(catenate concatenate create diff compare \
1034
		    c/--/"(catenate concatenate create diff compare \
1011
			delete append list update extract get atime-preserve \
1035
		    delete append list update extract get atime-preserve \
1012
			block-size read-full-blocks directory checkpoint file \
1036
		    block-size read-full-blocks directory checkpoint file \
1013
			force-local info-script new-volume-script incremental \
1037
		    force-local info-script new-volume-script incremental \
1014
			listed-incremental dereference ignore-zeros \
1038
		    listed-incremental dereference ignore-zeros \
1015
			ignore-failed-read keep-old-files starting-file \
1039
		    ignore-failed-read keep-old-files starting-file \
1016
			one-file-system tape-length modification-time \
1040
		    one-file-system tape-length modification-time \
1017
			multi-volume after-date newer old-archive portability \
1041
		    multi-volume after-date newer old-archive portability \
1018
			to-stdout same-permissions preserve-permissions \
1042
		    to-stdout same-permissions preserve-permissions \
1019
			absolute-paths preserve record-number remove-files \
1043
		    absolute-paths preserve record-number remove-files \
1020
			same-order preserve-order same-owner sparse \
1044
		    same-order preserve-order same-owner sparse \
1021
			files-from null totals verbose label version \
1045
		    files-from null totals verbose label version \
1022
			interactive confirmation verify exclude exclude-from \
1046
		    interactive confirmation verify exclude exclude-from \
1023
			compress uncompress gzip ungzip use-compress-program \
1047
		    compress uncompress gzip ungzip use-compress-program \
1024
			block-compress help version)"/ \
1048
		    block-compress help version)"/ \
1025
			c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
1049
		    c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
1026
			T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
1050
		    T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
1027
			C@/dev@f@ \
1051
		    C@/dev@f@ \
1028
			n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
1052
		    n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
1029
			n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
1053
		    n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
1030
			n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
1054
		    n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
1031
			n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
1055
		    n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
1032
			n/{-[Adrtux]*f,--file}/f:*.tar/ \
1056
		    n/{-[Adrtux]*f,--file}/f:*.tar/ \
1033
			N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
1057
		    N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
1034
			N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
1058
		    N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
1035
			N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
1059
		    N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
1036
			N/{-x*f,--file}/'`tar -tf $:-1`'/ \
1060
		    N/{-x*f,--file}/'`tar -tf $:-1`'/ \
1037
			n/--use-compress-program/c/ \
1061
		    n/--use-compress-program/c/ \
1038
			n/{-b,--block-size}/x:'<block_size>'/ \
1062
		    n/{-b,--block-size}/x:'<block_size>'/ \
1039
			n/{-V,--label}/x:'<volume_label>'/ \
1063
		    n/{-V,--label}/x:'<volume_label>'/ \
1040
			n/{-N,--{after-date,newer}}/x:'<date>'/ \
1064
		    n/{-N,--{after-date,newer}}/x:'<date>'/ \
1041
			n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
1065
		    n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
1042
			n/{-C,--directory}/d/ \
1066
		    n/{-C,--directory}/d/ \
1043
			N/{-C,--directory}/'`\ls $:-1`'/ \
1067
		    N/{-C,--directory}/'`\ls $:-1`'/ \
1044
			n/-[0-7]/"(l m h)"/
1068
		    n/-[0-7]/"(l m h)"/
1045
1069
1046
    switch ( "$OSTYPE" )
1070
switch ( "$OSTYPE" )
1047
    case "linux":
1071
case linux:
1048
      # Linux filesystems
1072
  # Linux filesystems
1049
      complete  mount	c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
1073
  complete  mount	c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
1050
			n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
1074
		    n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
1051
			n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
1075
		    n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
1052
			n@*@'`grep -v "^#" /etc/fstab | tr -s " " "	 " | cut -f 2`'@
1076
		    n@*@'`grep -v "^#" /etc/fstab | tr -s " " "	 " | cut -f 2`'@
1053
      complete umount	c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
1077
  complete umount	c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
1054
			  n/*/'`mount | cut -d " " -f 3`'/
1078
		      n/*/'`mount | cut -d " " -f 3`'/
1055
      breaksw
1079
  breaksw
1056
    case "sunos*":
1080
case sunos*:
1057
    case "solaris":
1081
case solaris:
1058
      # Solaris filesystems
1082
  # Solaris filesystems
1059
      complete  mount	c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
1083
  complete  mount	c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
1060
      			n/-o/x:'<FSType_options>'/ \
1084
		    n/-o/x:'<FSType_options>'/ \
1061
      			n@-F@'`\ls -1 /usr/lib/fs`'@ \
1085
		    n@-F@'`\ls -1 /usr/lib/fs`'@ \
1062
      			n@*@'`grep -v "^#" /etc/vfstab | tr -s " " "	 " | cut -f 3`'@
1086
		    n@*@'`grep -v "^#" /etc/vfstab | tr -s " " "	 " | cut -f 3`'@
1063
      complete umount	c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
1087
  complete umount	c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
1064
      			n/*/'`mount | cut -d " " -f 1`'/
1088
		    n/*/'`mount | cut -d " " -f 1`'/
1065
      complete  mountall	c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
1089
  complete  mountall	c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
1066
      complete umountall	c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
1090
  complete umountall	c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
1067
      			n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
1091
		    n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
1068
      breaksw
1092
  breaksw
1069
    case "cygwin":
1093
case cygwin:
1070
      # Cygwin mounts
1094
  # Cygwin mounts
1071
      complete  mount	c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
1095
  complete  mount	c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
1072
      			n/-c/x:'/'/ \
1096
		    n/-c/x:'/'/ \
1073
			n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
1097
		    n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
1074
      			n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
1098
		    n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
1075
      complete umount	c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
1099
  complete umount	c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
1076
      			n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
1100
		    n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
1077
      breaksw
1101
  breaksw
1078
    default:
1102
endsw
1079
      breaksw
1080
    endsw
1081
1103
1082
    # these deal with NIS (formerly YP); if it's not running you don't need 'em
1104
# these deal with NIS (formerly YP); if it's not running you don't need 'em
1083
    if (-X domainname) then
1105
if (-X domainname) then
1084
      set _domain = "`domainname`"
1106
  set _domain = "`domainname`"
1085
      set _ypdir  = /var/yp	# directory where NIS (YP) maps are kept
1107
  set _ypdir  = /var/yp	# directory where NIS (YP) maps are kept
1086
      if ("$_domain" != "" && "$_domain" != "noname") then
1108
  if ("$_domain" != "" && "$_domain" != "noname") then
1087
        complete domainname p@1@D:$_ypdir@" " n@*@n@
1109
    complete domainname p@1@D:$_ypdir@" " n@*@n@
1088
        complete ypcat	    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1110
    complete ypcat	    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1089
	                    N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1111
			N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1090
	                    n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1112
			n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1091
        complete ypmatch    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1113
    complete ypmatch    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1092
	                    N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
1114
			N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
1093
	                    n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1115
			n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1094
        complete ypwhich    c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1116
    complete ypwhich    c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1095
	                    n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1117
			n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1096
			    N@-m@n@ n@*@\$hosts@
1118
			N@-m@n@ n@*@\$hosts@
1097
      endif
1119
  endif
1098
      unset _domain _ypdir
1120
  unset _domain _ypdir
1099
    endif
1121
endif
1100
1122
1101
    complete make \
1123
complete make \
1102
	'n/-f/f/' \
1124
    'n/-f/f/' \
1103
      	'c/*=/f/' \
1125
    'c/*=/f/' \
1104
	'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
1126
    'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
1105
1127
1106
    if ( -f /etc/printcap ) then
1128
if ( -f /etc/printcap ) then
1107
	set printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
1129
    set printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
1108
1130
1109
	complete lpr    'c/-P/$printers/'
1131
    complete lpr    'c/-P/$printers/'
1110
	complete lpq    'c/-P/$printers/'
1132
    complete lpq    'c/-P/$printers/'
1111
	complete lprm   'c/-P/$printers/'
1133
    complete lprm   'c/-P/$printers/'
1112
	complete lpquota        'p/1/(-Qprlogger)/' 'c/-P/$printers/'
1134
    complete lpquota        'p/1/(-Qprlogger)/' 'c/-P/$printers/'
1113
	complete dvips  'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
1135
    complete dvips  'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
1114
	complete dvilj	'p/*/f:*.dvi/'
1136
    complete dvilj	'p/*/f:*.dvi/'
1115
    endif
1137
endif
1116
1138
1117
    # From Alphonse Bendt
1139
# From Alphonse Bendt
1118
    complete ant \
1140
complete ant \
1119
	 'n/-f/f:*.xml/' \
1141
     'n/-f/f:*.xml/' \
1120
	      'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
1142
	  'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
1121
1143
1122
    if ($?P4CLIENT && -X perl) then
1144
if ($?P4CLIENT && -X perl) then
1123
	# This is from Greg Allen.
1145
    # This is from Greg Allen.
1124
	set p4cmds=(add branch branches commands change changes client clients \
1146
    set p4cmds=(add branch branches commands change changes client clients \
1125
	    counter counters delete depot depots describe diff diff2 \
1147
	counter counters delete depot depots describe diff diff2 \
1126
	    edit filelog files fix fixes fstat group groups have help \
1148
	edit filelog files fix fixes fstat group groups have help \
1127
	    info integrate integrated job jobs jobspec label labels \
1149
	info integrate integrated job jobs jobspec label labels \
1128
	    labelsync lock obliterate opened passwd print protect rename \
1150
	labelsync lock obliterate opened passwd print protect rename \
1129
	    reopen resolve resolved revert review reviews set submit \
1151
	reopen resolve resolved revert review reviews set submit \
1130
	    sync triggers unlock user users verify where)
1152
	sync triggers unlock user users verify where)
1131
	complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
1153
    complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
1132
	    'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1154
	'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1133
	    'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
1155
	'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
1134
	    'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1156
	'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1135
	    'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
1157
	'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
1136
	    *)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
1158
	*)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
1137
	    'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
1159
	'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
1138
    endif
1160
endif
1139
1161
1140
1162
1141
    if (! $?traditional_complete) then
1163
if (! $?traditional_complete) then
1142
        uncomplete vi
1164
    uncomplete vi
1143
        uncomplete vim
1165
    uncomplete vim
1144
        complete {vi,vim,gvim,nvi,elvis} 	n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
1166
    complete {vi,vim,gvim,nvi,elvis} 	n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
1145
        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}/'
1167
    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}/'
1146
        complete elm	'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
1168
    complete elm	'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
1147
        complete ncftp	'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
1169
    complete ncftp	'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
1148
        complete bibtex	'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
1170
    complete bibtex	'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
1149
        complete dvi2tty	n/*/f:*.dvi/	# Only files that match *.dvi
1171
    complete dvi2tty	n/*/f:*.dvi/	# Only files that match *.dvi
1150
	uncomplete gv
1172
    uncomplete gv
1151
	uncomplete ghostview
1173
    uncomplete ghostview
1152
        complete {gv,ghostview}	'n/*/f:*.{ps,eps,epsi}/'
1174
    complete {gv,ghostview}	'n/*/f:*.{ps,eps,epsi}/'
1153
        complete enscript \
1175
    complete enscript \
1154
		'c/--/(columns= pages= header= no-header truncate-lines \
1176
	    'c/--/(columns= pages= header= no-header truncate-lines \
1155
			line-numbers setpagedevice= escapes font= \
1177
		    line-numbers setpagedevice= escapes font= \
1156
			header-font= fancy-header no-job-header \
1178
		    header-font= fancy-header no-job-header \
1157
			highlight-bars indent= filter= borders page-prefeed \
1179
		    highlight-bars indent= filter= borders page-prefeed \
1158
			no-page-prefeed lineprinter lines-per-page= mail \
1180
		    no-page-prefeed lineprinter lines-per-page= mail \
1159
			media= copies= newline= output= missing-characters \
1181
		    media= copies= newline= output= missing-characters \
1160
			printer= quiet silent landscape portrait \
1182
		    printer= quiet silent landscape portrait \
1161
			baselineskip= statusdict= title= tabsize= underlay= \
1183
		    baselineskip= statusdict= title= tabsize= underlay= \
1162
			verbose version encoding pass-through download-font= \
1184
		    verbose version encoding pass-through download-font= \
1163
			filter-stdin= help highlight-bar-gray= list-media \
1185
		    filter-stdin= help highlight-bar-gray= list-media \
1164
			list-options non-printable-format= page-label-format= \
1186
		    list-options non-printable-format= page-label-format= \
1165
			printer-options= ul-angle= ul-font= ul-gray= \
1187
		    printer-options= ul-angle= ul-font= ul-gray= \
1166
			ul-position= ul-style= \
1188
		    ul-position= ul-style= \
1167
		     )/'
1189
		 )/'
1168
    endif
1190
endif
1169
1191
1170
    complete dpkg \
1192
complete dpkg \
1171
		'c/--{admindir,instdir,root}=/d/' \
1193
	    'c/--{admindir,instdir,root}=/d/' \
1172
		'c/--debug=/n/' \
1194
	    'c/--debug=/n/' \
1173
		'c/--{admindir,debug,instdir,root}/(=)//' \
1195
	    'c/--{admindir,debug,instdir,root}/(=)//' \
1174
		'c/--/(admindir= debug= instdir= root= \
1196
	    'c/--/(admindir= debug= instdir= root= \
1175
			assert-support-predepends assert-working-epoch \
1197
		    assert-support-predepends assert-working-epoch \
1176
			audit auto-deconfigure clear-avail \
1198
		    audit auto-deconfigure clear-avail \
1177
			compare-versions configure contents control \
1199
		    compare-versions configure contents control \
1178
			extract force-bad-path field \
1200
		    extract force-bad-path field \
1179
			force-configure-any force-conflicts \
1201
		    force-configure-any force-conflicts \
1180
			force-depends force-depends-version force-help \
1202
		    force-depends force-depends-version force-help \
1181
			force-hold force-non-root \
1203
		    force-hold force-non-root \
1182
			force-overwrite-diverted \
1204
		    force-overwrite-diverted \
1183
			force-remove-essential force-remove-reinstreq \
1205
		    force-remove-essential force-remove-reinstreq \
1184
			forget-old-unavail fsys-tarfile get-selections \
1206
		    forget-old-unavail fsys-tarfile get-selections \
1185
			help ignore-depends info install largemem \
1207
		    help ignore-depends info install largemem \
1186
			license list listfiles merge-avail no-act \
1208
		    license list listfiles merge-avail no-act \
1187
			pending predep-package print-architecture \
1209
		    pending predep-package print-architecture \
1188
			print-gnu-build-architecture \
1210
		    print-gnu-build-architecture \
1189
			print-installation-architecture print-avail \
1211
		    print-installation-architecture print-avail \
1190
			purge record-avail recursive refuse-downgrade \
1212
		    purge record-avail recursive refuse-downgrade \
1191
			remove search set-selections selected-only \
1213
		    remove search set-selections selected-only \
1192
			skip-same-version smallmem status unpack \
1214
		    skip-same-version smallmem status unpack \
1193
			update-avail version vextract \
1215
		    update-avail version vextract \
1194
		      )//' \
1216
		  )//' \
1195
		'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
1217
	    'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
1196
		'n/*/f:*.deb'/
1218
	    'n/*/f:*.deb'/
1197
    complete dpkg-deb 	   'c/--{build}=/d/' \
1219
complete dpkg-deb 	   'c/--{build}=/d/' \
1198
			   'c/--/(build contents info field control extract \
1220
		       'c/--/(build contents info field control extract \
1199
				 vextract fsys-tarfile help version \
1221
			     vextract fsys-tarfile help version \
1200
				 license)//' \
1222
			     license)//' \
1201
			   'n/*/f:*.deb/'
1223
		       'n/*/f:*.deb/'
1202
    complete apt-get \
1224
complete apt-get \
1203
	        'c/--/(build config-file diff-only download-only \
1225
	    'c/--/(build config-file diff-only download-only \
1204
		   fix-broken fix-missing force-yes help ignore-hold no-download \
1226
	       fix-broken fix-missing force-yes help ignore-hold no-download \
1205
		   no-upgrade option print-uris purge reinstall quiet simulate \
1227
	       no-upgrade option print-uris purge reinstall quiet simulate \
1206
		   show-upgraded target-release tar-only version yes )/' \
1228
	       show-upgraded target-release tar-only version yes )/' \
1207
	    	'c/-/(b c= d f h m o= q qq s t x y )/' \
1229
	    'c/-/(b c= d f h m o= q qq s t x y )/' \
1208
 		'n/{source,build-dep}/x:<pkgname>/' \
1230
	    'n/{source,build-dep}/x:<pkgname>/' \
1209
 		'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
1231
	    'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
1210
 		'n/{install}/`apt-cache pkgnames | sort`/' \
1232
	    'n/{install}/`apt-cache pkgnames | sort`/' \
1211
 		'C/*/(update upgrade dselect-upgrade source \
1233
	    'C/*/(update upgrade dselect-upgrade source \
1212
		   build-dep check clean autoclean install remove)/'
1234
	       build-dep check clean autoclean install remove)/'
1213
    complete apt-cache \
1235
complete apt-cache \
1214
 		'c/--/(all-versions config-file generate full help important \
1236
	    'c/--/(all-versions config-file generate full help important \
1215
 		names-only option pkg-cache quiet recurse src-cache version )/' \
1237
	    names-only option pkg-cache quiet recurse src-cache version )/' \
1216
 	    	'c/-/(c= h i o= p= q s= v)/' \
1238
	    'c/-/(c= h i o= p= q s= v)/' \
1217
  		'n/{search}/x:<regex>/' \
1239
	    'n/{search}/x:<regex>/' \
1218
 		'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
1240
	    'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
1219
 		'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
1241
	    'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
1220
 		search depends pkgnames dotty policy )/'
1242
	    search depends pkgnames dotty policy )/'
1221
1243
1222
    unset noglob
1244
switch ( "${OSTYPE}" )
1223
    unset _complete
1245
case FreeBSD:
1224
    unset traditional_complete
1246
  set commands=()
1225
endif
1247
  foreach p (fast force one quiet "")
1248
    foreach c (enabled poll rcvar reload restart start status stop)
1249
      set commands=($commands $p$c)
1250
    end
1251
  end
1252
  complete service \
1253
    n/-R/n/ \
1254
    n/-e/n/ \
1255
    n/-l/n/ \
1256
    n/-r/n/ \
1257
    c/-/"(R e l r v)"/ \
1258
    p/2/"($commands)"/ \
1259
    p@1@'`service -l`'@
1260
  unset commands c p
1261
  breaksw
1262
case linux:
1263
  if ( -d /etc/init.d ) then
1264
    set rcdir=/etc/init.d/
1265
  else
1266
    set rcdir=/etc/rc.d/
1267
  endif
1268
  complete service \
1269
    p/2/"(--full-restart force-reload reload restart start stop status)"/ \
1270
    c/--/"(help status-all version)"/ \
1271
    c/-/"(- h)"/ \
1272
    p@1@F:$rcdir@
1273
  unset rcdir
1274
  breaksw
1275
endsw
1226
1276
1277
if ( $?_unset_noglob ) unset noglob _unset_noglob
1278
1227
end:
1279
end:
1228
	onintr
1280
unset _has_complete
1281
onintr
(-)contrib/tcsh/config/bsd4.4 (+1 lines)
Lines 98-103 Link Here
98
98
99
#elif defined(__APPLE__)
99
#elif defined(__APPLE__)
100
# define SYSMALLOC
100
# define SYSMALLOC
101
# define BSD_STYLE_COLORLS
101
#endif
102
#endif
102
103
103
#endif /* _h_config */
104
#endif /* _h_config */
(-)contrib/tcsh/config.guess (-327 / +263 lines)
Lines 1-14 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# Attempt to guess a canonical system name.
2
# Attempt to guess a canonical system name.
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
#   Copyright 1992-2015 Free Software Foundation, Inc.
4
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5
#   Free Software Foundation, Inc.
6
4
7
timestamp='2009-12-30'
5
timestamp='2015-03-04'
8
6
9
# This file is free software; you can redistribute it and/or modify it
7
# This file is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
8
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2 of the License, or
9
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
10
# (at your option) any later version.
13
#
11
#
14
# This program is distributed in the hope that it will be useful, but
12
# This program is distributed in the hope that it will be useful, but
Lines 17-43 Link Here
17
# General Public License for more details.
15
# General Public License for more details.
18
#
16
#
19
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
18
# along with this program; if not, see <http://www.gnu.org/licenses/>.
21
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22
# 02110-1301, USA.
23
#
19
#
24
# As a special exception to the GNU General Public License, if you
20
# As a special exception to the GNU General Public License, if you
25
# distribute this file as part of a program that contains a
21
# distribute this file as part of a program that contains a
26
# configuration script generated by Autoconf, you may include it under
22
# configuration script generated by Autoconf, you may include it under
27
# the same distribution terms that you use for the rest of that program.
23
# the same distribution terms that you use for the rest of that
28
24
# program.  This Exception is an additional permission under section 7
29
25
# of the GNU General Public License, version 3 ("GPLv3").
30
# Originally written by Per Bothner.  Please send patches (context
31
# diff format) to <config-patches@gnu.org> and include a ChangeLog
32
# entry.
33
#
26
#
34
# This script attempts to guess a canonical system name similar to
27
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
35
# config.sub.  If it succeeds, it prints the system name on stdout, and
36
# exits with 0.  Otherwise, it exits with 1.
37
#
28
#
38
# You can get the latest version of this script from:
29
# You can get the latest version of this script from:
39
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
30
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31
#
32
# Please send patches to <config-patches@gnu.org>.
40
33
34
41
me=`echo "$0" | sed -e 's,.*/,,'`
35
me=`echo "$0" | sed -e 's,.*/,,'`
42
36
43
usage="\
37
usage="\
Lines 56-64 Link Here
56
GNU config.guess ($timestamp)
50
GNU config.guess ($timestamp)
57
51
58
Originally written by Per Bothner.
52
Originally written by Per Bothner.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
53
Copyright 1992-2015 Free Software Foundation, Inc.
60
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61
Software Foundation, Inc.
62
54
63
This is free software; see the source for copying conditions.  There is NO
55
This is free software; see the source for copying conditions.  There is NO
64
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Lines 140-151 Link Here
140
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
132
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
141
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142
134
135
case "${UNAME_SYSTEM}" in
136
Linux|GNU|GNU/*)
137
	# If the system lacks a compiler, then just pick glibc.
138
	# We could probably try harder.
139
	LIBC=gnu
140
141
	eval $set_cc_for_build
142
	cat <<-EOF > $dummy.c
143
	#include <features.h>
144
	#if defined(__UCLIBC__)
145
	LIBC=uclibc
146
	#elif defined(__dietlibc__)
147
	LIBC=dietlibc
148
	#else
149
	LIBC=gnu
150
	#endif
151
	EOF
152
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
153
	;;
154
esac
155
143
# Note: order is significant - the case branches are not exclusive.
156
# Note: order is significant - the case branches are not exclusive.
144
157
145
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146
    *:NetBSD:*:*)
159
    *:NetBSD:*:*)
147
	# NetBSD (nbsd) targets should (where applicable) match one or
160
	# NetBSD (nbsd) targets should (where applicable) match one or
148
	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
161
	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
149
	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
162
	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
150
	# switched to ELF, *-*-netbsd* would select the old
163
	# switched to ELF, *-*-netbsd* would select the old
151
	# object file format.  This provides both forward
164
	# object file format.  This provides both forward
Lines 155-162 Link Here
155
	# Note: NetBSD doesn't particularly care about the vendor
168
	# Note: NetBSD doesn't particularly care about the vendor
156
	# portion of the name.  We always set it to "unknown".
169
	# portion of the name.  We always set it to "unknown".
157
	sysctl="sysctl -n hw.machine_arch"
170
	sysctl="sysctl -n hw.machine_arch"
158
	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171
	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
159
	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172
	    /sbin/$sysctl 2>/dev/null || \
173
	    /usr/sbin/$sysctl 2>/dev/null || \
174
	    echo unknown)`
160
	case "${UNAME_MACHINE_ARCH}" in
175
	case "${UNAME_MACHINE_ARCH}" in
161
	    armeb) machine=armeb-unknown ;;
176
	    armeb) machine=armeb-unknown ;;
162
	    arm*) machine=arm-unknown ;;
177
	    arm*) machine=arm-unknown ;;
Lines 163-174 Link Here
163
	    sh3el) machine=shl-unknown ;;
178
	    sh3el) machine=shl-unknown ;;
164
	    sh3eb) machine=sh-unknown ;;
179
	    sh3eb) machine=sh-unknown ;;
165
	    sh5el) machine=sh5le-unknown ;;
180
	    sh5el) machine=sh5le-unknown ;;
181
	    earmv*)
182
		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
183
		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
184
		machine=${arch}${endian}-unknown
185
		;;
166
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
186
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167
	esac
187
	esac
168
	# The Operating System including object format, if it has switched
188
	# The Operating System including object format, if it has switched
169
	# to ELF recently, or will in the future.
189
	# to ELF recently, or will in the future.
170
	case "${UNAME_MACHINE_ARCH}" in
190
	case "${UNAME_MACHINE_ARCH}" in
171
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
191
	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
172
		eval $set_cc_for_build
192
		eval $set_cc_for_build
173
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
193
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174
			| grep -q __ELF__
194
			| grep -q __ELF__
Lines 181-189 Link Here
181
		fi
201
		fi
182
		;;
202
		;;
183
	    *)
203
	    *)
184
	        os=netbsd
204
		os=netbsd
185
		;;
205
		;;
186
	esac
206
	esac
207
	# Determine ABI tags.
208
	case "${UNAME_MACHINE_ARCH}" in
209
	    earm*)
210
		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
211
		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
212
		;;
213
	esac
187
	# The OS release
214
	# The OS release
188
	# Debian GNU/NetBSD machines have a different userland, and
215
	# Debian GNU/NetBSD machines have a different userland, and
189
	# thus, need a distinct triplet. However, they do not need
216
	# thus, need a distinct triplet. However, they do not need
Lines 200-207 Link Here
200
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
227
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201
	# contains redundant information, the shorter form:
228
	# contains redundant information, the shorter form:
202
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
229
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203
	echo "${machine}-${os}${release}"
230
	echo "${machine}-${os}${release}${abi}"
204
	exit ;;
231
	exit ;;
232
    *:Bitrig:*:*)
233
	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
234
	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
235
	exit ;;
205
    *:OpenBSD:*:*)
236
    *:OpenBSD:*:*)
206
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
237
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207
	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
238
	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
Lines 224-230 Link Here
224
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
255
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225
		;;
256
		;;
226
	*5.*)
257
	*5.*)
227
	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
258
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228
		;;
259
		;;
229
	esac
260
	esac
230
	# According to Compaq, /usr/sbin/psrinfo has been available on
261
	# According to Compaq, /usr/sbin/psrinfo has been available on
Lines 270-276 Link Here
270
	# A Xn.n version is an unreleased experimental baselevel.
301
	# A Xn.n version is an unreleased experimental baselevel.
271
	# 1.2 uses "1.2" for uname -r.
302
	# 1.2 uses "1.2" for uname -r.
272
	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
303
	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273
	exit ;;
304
	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
305
	exitcode=$?
306
	trap '' 0
307
	exit $exitcode ;;
274
    Alpha\ *:Windows_NT*:*)
308
    Alpha\ *:Windows_NT*:*)
275
	# How do we know it's Interix rather than the generic POSIX subsystem?
309
	# How do we know it's Interix rather than the generic POSIX subsystem?
276
	# Should we change UNAME_MACHINE based on the output of uname instead
310
	# Should we change UNAME_MACHINE based on the output of uname instead
Lines 296-307 Link Here
296
	echo s390-ibm-zvmoe
330
	echo s390-ibm-zvmoe
297
	exit ;;
331
	exit ;;
298
    *:OS400:*:*)
332
    *:OS400:*:*)
299
        echo powerpc-ibm-os400
333
	echo powerpc-ibm-os400
300
	exit ;;
334
	exit ;;
301
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
335
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
302
	echo arm-acorn-riscix${UNAME_RELEASE}
336
	echo arm-acorn-riscix${UNAME_RELEASE}
303
	exit ;;
337
	exit ;;
304
    arm:riscos:*:*|arm:RISCOS:*:*)
338
    arm*:riscos:*:*|arm*:RISCOS:*:*)
305
	echo arm-unknown-riscos
339
	echo arm-unknown-riscos
306
	exit ;;
340
	exit ;;
307
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
341
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
Lines 395-417 Link Here
395
    # MiNT.  But MiNT is downward compatible to TOS, so this should
429
    # MiNT.  But MiNT is downward compatible to TOS, so this should
396
    # be no problem.
430
    # be no problem.
397
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
431
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
398
        echo m68k-atari-mint${UNAME_RELEASE}
432
	echo m68k-atari-mint${UNAME_RELEASE}
399
	exit ;;
433
	exit ;;
400
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
434
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
401
	echo m68k-atari-mint${UNAME_RELEASE}
435
	echo m68k-atari-mint${UNAME_RELEASE}
402
        exit ;;
436
	exit ;;
403
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
437
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
404
        echo m68k-atari-mint${UNAME_RELEASE}
438
	echo m68k-atari-mint${UNAME_RELEASE}
405
	exit ;;
439
	exit ;;
406
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
440
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
407
        echo m68k-milan-mint${UNAME_RELEASE}
441
	echo m68k-milan-mint${UNAME_RELEASE}
408
        exit ;;
442
	exit ;;
409
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
443
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
410
        echo m68k-hades-mint${UNAME_RELEASE}
444
	echo m68k-hades-mint${UNAME_RELEASE}
411
        exit ;;
445
	exit ;;
412
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
446
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
413
        echo m68k-unknown-mint${UNAME_RELEASE}
447
	echo m68k-unknown-mint${UNAME_RELEASE}
414
        exit ;;
448
	exit ;;
415
    m68k:machten:*:*)
449
    m68k:machten:*:*)
416
	echo m68k-apple-machten${UNAME_RELEASE}
450
	echo m68k-apple-machten${UNAME_RELEASE}
417
	exit ;;
451
	exit ;;
Lines 481-488 Link Here
481
	echo m88k-motorola-sysv3
515
	echo m88k-motorola-sysv3
482
	exit ;;
516
	exit ;;
483
    AViiON:dgux:*:*)
517
    AViiON:dgux:*:*)
484
        # DG/UX returns AViiON for all architectures
518
	# DG/UX returns AViiON for all architectures
485
        UNAME_PROCESSOR=`/usr/bin/uname -p`
519
	UNAME_PROCESSOR=`/usr/bin/uname -p`
486
	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
520
	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
487
	then
521
	then
488
	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
522
	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
Lines 495-501 Link Here
495
	else
529
	else
496
	    echo i586-dg-dgux${UNAME_RELEASE}
530
	    echo i586-dg-dgux${UNAME_RELEASE}
497
	fi
531
	fi
498
 	exit ;;
532
	exit ;;
499
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
533
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
500
	echo m88k-dolphin-sysv3
534
	echo m88k-dolphin-sysv3
501
	exit ;;
535
	exit ;;
Lines 552-558 Link Here
552
		echo rs6000-ibm-aix3.2
586
		echo rs6000-ibm-aix3.2
553
	fi
587
	fi
554
	exit ;;
588
	exit ;;
555
    *:AIX:*:[456])
589
    *:AIX:*:[4567])
556
	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
590
	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
557
	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
591
	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
558
		IBM_ARCH=rs6000
592
		IBM_ARCH=rs6000
Lines 559-566 Link Here
559
	else
593
	else
560
		IBM_ARCH=powerpc
594
		IBM_ARCH=powerpc
561
	fi
595
	fi
562
	if [ -x /usr/bin/oslevel ] ; then
596
	if [ -x /usr/bin/lslpp ] ; then
563
		IBM_REV=`/usr/bin/oslevel`
597
		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
598
			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
564
	else
599
	else
565
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
600
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
566
	fi
601
	fi
Lines 595-646 Link Here
595
	    9000/[678][0-9][0-9])
630
	    9000/[678][0-9][0-9])
596
		if [ -x /usr/bin/getconf ]; then
631
		if [ -x /usr/bin/getconf ]; then
597
		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
632
		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
598
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
633
		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
599
                    case "${sc_cpu_version}" in
634
		    case "${sc_cpu_version}" in
600
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
635
		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
601
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
636
		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
602
                      532)                      # CPU_PA_RISC2_0
637
		      532)                      # CPU_PA_RISC2_0
603
                        case "${sc_kernel_bits}" in
638
			case "${sc_kernel_bits}" in
604
                          32) HP_ARCH="hppa2.0n" ;;
639
			  32) HP_ARCH="hppa2.0n" ;;
605
                          64) HP_ARCH="hppa2.0w" ;;
640
			  64) HP_ARCH="hppa2.0w" ;;
606
			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
641
			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
607
                        esac ;;
642
			esac ;;
608
                    esac
643
		    esac
609
		fi
644
		fi
610
		if [ "${HP_ARCH}" = "" ]; then
645
		if [ "${HP_ARCH}" = "" ]; then
611
		    eval $set_cc_for_build
646
		    eval $set_cc_for_build
612
		    sed 's/^              //' << EOF >$dummy.c
647
		    sed 's/^		//' << EOF >$dummy.c
613
648
614
              #define _HPUX_SOURCE
649
		#define _HPUX_SOURCE
615
              #include <stdlib.h>
650
		#include <stdlib.h>
616
              #include <unistd.h>
651
		#include <unistd.h>
617
652
618
              int main ()
653
		int main ()
619
              {
654
		{
620
              #if defined(_SC_KERNEL_BITS)
655
		#if defined(_SC_KERNEL_BITS)
621
                  long bits = sysconf(_SC_KERNEL_BITS);
656
		    long bits = sysconf(_SC_KERNEL_BITS);
622
              #endif
657
		#endif
623
                  long cpu  = sysconf (_SC_CPU_VERSION);
658
		    long cpu  = sysconf (_SC_CPU_VERSION);
624
659
625
                  switch (cpu)
660
		    switch (cpu)
626
              	{
661
			{
627
              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
662
			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
628
              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
663
			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
629
              	case CPU_PA_RISC2_0:
664
			case CPU_PA_RISC2_0:
630
              #if defined(_SC_KERNEL_BITS)
665
		#if defined(_SC_KERNEL_BITS)
631
              	    switch (bits)
666
			    switch (bits)
632
              		{
667
				{
633
              		case 64: puts ("hppa2.0w"); break;
668
				case 64: puts ("hppa2.0w"); break;
634
              		case 32: puts ("hppa2.0n"); break;
669
				case 32: puts ("hppa2.0n"); break;
635
              		default: puts ("hppa2.0"); break;
670
				default: puts ("hppa2.0"); break;
636
              		} break;
671
				} break;
637
              #else  /* !defined(_SC_KERNEL_BITS) */
672
		#else  /* !defined(_SC_KERNEL_BITS) */
638
              	    puts ("hppa2.0"); break;
673
			    puts ("hppa2.0"); break;
639
              #endif
674
		#endif
640
              	default: puts ("hppa1.0"); break;
675
			default: puts ("hppa1.0"); break;
641
              	}
676
			}
642
                  exit (0);
677
		    exit (0);
643
              }
678
		}
644
EOF
679
EOF
645
		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
680
		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646
		    test -z "$HP_ARCH" && HP_ARCH=hppa
681
		    test -z "$HP_ARCH" && HP_ARCH=hppa
Lines 731-752 Link Here
731
	exit ;;
766
	exit ;;
732
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
767
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
733
	echo c1-convex-bsd
768
	echo c1-convex-bsd
734
        exit ;;
769
	exit ;;
735
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
770
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
736
	if getsysinfo -f scalar_acc
771
	if getsysinfo -f scalar_acc
737
	then echo c32-convex-bsd
772
	then echo c32-convex-bsd
738
	else echo c2-convex-bsd
773
	else echo c2-convex-bsd
739
	fi
774
	fi
740
        exit ;;
775
	exit ;;
741
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
776
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
742
	echo c34-convex-bsd
777
	echo c34-convex-bsd
743
        exit ;;
778
	exit ;;
744
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
779
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
745
	echo c38-convex-bsd
780
	echo c38-convex-bsd
746
        exit ;;
781
	exit ;;
747
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
782
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
748
	echo c4-convex-bsd
783
	echo c4-convex-bsd
749
        exit ;;
784
	exit ;;
750
    CRAY*Y-MP:*:*:*)
785
    CRAY*Y-MP:*:*:*)
751
	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
786
	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752
	exit ;;
787
	exit ;;
Lines 770-783 Link Here
770
	exit ;;
805
	exit ;;
771
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
806
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
772
	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
807
	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
773
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
808
	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
774
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
809
	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
775
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
810
	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776
        exit ;;
811
	exit ;;
777
    5000:UNIX_System_V:4.*:*)
812
    5000:UNIX_System_V:4.*:*)
778
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
813
	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
814
	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
815
	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781
	exit ;;
816
	exit ;;
782
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
817
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
783
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
818
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
Lines 789-818 Link Here
789
	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
824
	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790
	exit ;;
825
	exit ;;
791
    *:FreeBSD:*:*)
826
    *:FreeBSD:*:*)
792
	case ${UNAME_MACHINE} in
827
	UNAME_PROCESSOR=`/usr/bin/uname -p`
793
	    pc98)
828
	case ${UNAME_PROCESSOR} in
794
		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795
	    amd64)
829
	    amd64)
796
		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
830
		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797
	    *)
831
	    *)
798
		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
832
		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799
	esac
833
	esac
800
	exit ;;
834
	exit ;;
801
    i*:CYGWIN*:*)
835
    i*:CYGWIN*:*)
802
	echo ${UNAME_MACHINE}-pc-cygwin
836
	echo ${UNAME_MACHINE}-pc-cygwin
803
	exit ;;
837
	exit ;;
838
    *:MINGW64*:*)
839
	echo ${UNAME_MACHINE}-pc-mingw64
840
	exit ;;
804
    *:MINGW*:*)
841
    *:MINGW*:*)
805
	echo ${UNAME_MACHINE}-pc-mingw32
842
	echo ${UNAME_MACHINE}-pc-mingw32
806
	exit ;;
843
	exit ;;
844
    *:MSYS*:*)
845
	echo ${UNAME_MACHINE}-pc-msys
846
	exit ;;
807
    i*:windows32*:*)
847
    i*:windows32*:*)
808
    	# uname -m includes "-pc" on this system.
848
	# uname -m includes "-pc" on this system.
809
    	echo ${UNAME_MACHINE}-mingw32
849
	echo ${UNAME_MACHINE}-mingw32
810
	exit ;;
850
	exit ;;
811
    i*:PW*:*)
851
    i*:PW*:*)
812
	echo ${UNAME_MACHINE}-pc-pw32
852
	echo ${UNAME_MACHINE}-pc-pw32
813
	exit ;;
853
	exit ;;
814
    *:Interix*:*)
854
    *:Interix*:*)
815
    	case ${UNAME_MACHINE} in
855
	case ${UNAME_MACHINE} in
816
	    x86)
856
	    x86)
817
		echo i586-pc-interix${UNAME_RELEASE}
857
		echo i586-pc-interix${UNAME_RELEASE}
818
		exit ;;
858
		exit ;;
Lines 849-863 Link Here
849
	exit ;;
889
	exit ;;
850
    *:GNU:*:*)
890
    *:GNU:*:*)
851
	# the GNU system
891
	# the GNU system
852
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
892
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
853
	exit ;;
893
	exit ;;
854
    *:GNU/*:*:*)
894
    *:GNU/*:*:*)
855
	# other systems with GNU libc and userland
895
	# other systems with GNU libc and userland
856
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
896
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
857
	exit ;;
897
	exit ;;
858
    i*86:Minix:*:*)
898
    i*86:Minix:*:*)
859
	echo ${UNAME_MACHINE}-pc-minix
899
	echo ${UNAME_MACHINE}-pc-minix
860
	exit ;;
900
	exit ;;
901
    aarch64:Linux:*:*)
902
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
903
	exit ;;
904
    aarch64_be:Linux:*:*)
905
	UNAME_MACHINE=aarch64_be
906
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
907
	exit ;;
861
    alpha:Linux:*:*)
908
    alpha:Linux:*:*)
862
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863
	  EV5)   UNAME_MACHINE=alphaev5 ;;
910
	  EV5)   UNAME_MACHINE=alphaev5 ;;
Lines 867-918 Link Here
867
	  EV6)   UNAME_MACHINE=alphaev6 ;;
914
	  EV6)   UNAME_MACHINE=alphaev6 ;;
868
	  EV67)  UNAME_MACHINE=alphaev67 ;;
915
	  EV67)  UNAME_MACHINE=alphaev67 ;;
869
	  EV68*) UNAME_MACHINE=alphaev68 ;;
916
	  EV68*) UNAME_MACHINE=alphaev68 ;;
870
        esac
917
	esac
871
	objdump --private-headers /bin/sh | grep -q ld.so.1
918
	objdump --private-headers /bin/sh | grep -q ld.so.1
872
	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
919
	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
873
	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
920
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
874
	exit ;;
921
	exit ;;
922
    arc:Linux:*:* | arceb:Linux:*:*)
923
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
924
	exit ;;
875
    arm*:Linux:*:*)
925
    arm*:Linux:*:*)
876
	eval $set_cc_for_build
926
	eval $set_cc_for_build
877
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878
	    | grep -q __ARM_EABI__
928
	    | grep -q __ARM_EABI__
879
	then
929
	then
880
	    echo ${UNAME_MACHINE}-unknown-linux-gnu
930
	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
881
	else
931
	else
882
	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
932
	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
933
		| grep -q __ARM_PCS_VFP
934
	    then
935
		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
936
	    else
937
		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
938
	    fi
883
	fi
939
	fi
884
	exit ;;
940
	exit ;;
885
    avr32*:Linux:*:*)
941
    avr32*:Linux:*:*)
886
	echo ${UNAME_MACHINE}-unknown-linux-gnu
942
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
887
	exit ;;
943
	exit ;;
888
    cris:Linux:*:*)
944
    cris:Linux:*:*)
889
	echo cris-axis-linux-gnu
945
	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
890
	exit ;;
946
	exit ;;
891
    crisv32:Linux:*:*)
947
    crisv32:Linux:*:*)
892
	echo crisv32-axis-linux-gnu
948
	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
893
	exit ;;
949
	exit ;;
950
    e2k:Linux:*:*)
951
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
952
	exit ;;
894
    frv:Linux:*:*)
953
    frv:Linux:*:*)
895
    	echo frv-unknown-linux-gnu
954
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
896
	exit ;;
955
	exit ;;
956
    hexagon:Linux:*:*)
957
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
958
	exit ;;
897
    i*86:Linux:*:*)
959
    i*86:Linux:*:*)
898
	LIBC=gnu
960
	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
899
	eval $set_cc_for_build
900
	sed 's/^	//' << EOF >$dummy.c
901
	#ifdef __dietlibc__
902
	LIBC=dietlibc
903
	#endif
904
EOF
905
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906
	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907
	exit ;;
961
	exit ;;
908
    ia64:Linux:*:*)
962
    ia64:Linux:*:*)
909
	echo ${UNAME_MACHINE}-unknown-linux-gnu
963
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
910
	exit ;;
964
	exit ;;
911
    m32r*:Linux:*:*)
965
    m32r*:Linux:*:*)
912
	echo ${UNAME_MACHINE}-unknown-linux-gnu
966
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
913
	exit ;;
967
	exit ;;
914
    m68*:Linux:*:*)
968
    m68*:Linux:*:*)
915
	echo ${UNAME_MACHINE}-unknown-linux-gnu
969
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916
	exit ;;
970
	exit ;;
917
    mips:Linux:*:* | mips64:Linux:*:*)
971
    mips:Linux:*:* | mips64:Linux:*:*)
918
	eval $set_cc_for_build
972
	eval $set_cc_for_build
Lines 931-981 Link Here
931
	#endif
985
	#endif
932
EOF
986
EOF
933
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
987
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
934
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
988
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
935
	;;
989
	;;
936
    or32:Linux:*:*)
990
    openrisc*:Linux:*:*)
937
	echo or32-unknown-linux-gnu
991
	echo or1k-unknown-linux-${LIBC}
938
	exit ;;
992
	exit ;;
993
    or32:Linux:*:* | or1k*:Linux:*:*)
994
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
995
	exit ;;
939
    padre:Linux:*:*)
996
    padre:Linux:*:*)
940
	echo sparc-unknown-linux-gnu
997
	echo sparc-unknown-linux-${LIBC}
941
	exit ;;
998
	exit ;;
942
    parisc64:Linux:*:* | hppa64:Linux:*:*)
999
    parisc64:Linux:*:* | hppa64:Linux:*:*)
943
	echo hppa64-unknown-linux-gnu
1000
	echo hppa64-unknown-linux-${LIBC}
944
	exit ;;
1001
	exit ;;
945
    parisc:Linux:*:* | hppa:Linux:*:*)
1002
    parisc:Linux:*:* | hppa:Linux:*:*)
946
	# Look for CPU level
1003
	# Look for CPU level
947
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1004
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
948
	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
1005
	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
949
	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
1006
	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
950
	  *)    echo hppa-unknown-linux-gnu ;;
1007
	  *)    echo hppa-unknown-linux-${LIBC} ;;
951
	esac
1008
	esac
952
	exit ;;
1009
	exit ;;
953
    ppc64:Linux:*:*)
1010
    ppc64:Linux:*:*)
954
	echo powerpc64-unknown-linux-gnu
1011
	echo powerpc64-unknown-linux-${LIBC}
955
	exit ;;
1012
	exit ;;
956
    ppc:Linux:*:*)
1013
    ppc:Linux:*:*)
957
	echo powerpc-unknown-linux-gnu
1014
	echo powerpc-unknown-linux-${LIBC}
958
	exit ;;
1015
	exit ;;
1016
    ppc64le:Linux:*:*)
1017
	echo powerpc64le-unknown-linux-${LIBC}
1018
	exit ;;
1019
    ppcle:Linux:*:*)
1020
	echo powerpcle-unknown-linux-${LIBC}
1021
	exit ;;
959
    s390:Linux:*:* | s390x:Linux:*:*)
1022
    s390:Linux:*:* | s390x:Linux:*:*)
960
	echo ${UNAME_MACHINE}-ibm-linux
1023
	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
961
	exit ;;
1024
	exit ;;
962
    sh64*:Linux:*:*)
1025
    sh64*:Linux:*:*)
963
    	echo ${UNAME_MACHINE}-unknown-linux-gnu
1026
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
964
	exit ;;
1027
	exit ;;
965
    sh*:Linux:*:*)
1028
    sh*:Linux:*:*)
966
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1029
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
967
	exit ;;
1030
	exit ;;
968
    sparc:Linux:*:* | sparc64:Linux:*:*)
1031
    sparc:Linux:*:* | sparc64:Linux:*:*)
969
	echo ${UNAME_MACHINE}-unknown-linux-gnu
1032
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
970
	exit ;;
1033
	exit ;;
1034
    tile*:Linux:*:*)
1035
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1036
	exit ;;
971
    vax:Linux:*:*)
1037
    vax:Linux:*:*)
972
	echo ${UNAME_MACHINE}-dec-linux-gnu
1038
	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
973
	exit ;;
1039
	exit ;;
974
    x86_64:Linux:*:*)
1040
    x86_64:Linux:*:*)
975
	echo x86_64-unknown-linux-gnu
1041
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
976
	exit ;;
1042
	exit ;;
977
    xtensa*:Linux:*:*)
1043
    xtensa*:Linux:*:*)
978
    	echo ${UNAME_MACHINE}-unknown-linux-gnu
1044
	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
979
	exit ;;
1045
	exit ;;
980
    i*86:DYNIX/ptx:4*:*)
1046
    i*86:DYNIX/ptx:4*:*)
981
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1047
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
Lines 984-994 Link Here
984
	echo i386-sequent-sysv4
1050
	echo i386-sequent-sysv4
985
	exit ;;
1051
	exit ;;
986
    i*86:UNIX_SV:4.2MP:2.*)
1052
    i*86:UNIX_SV:4.2MP:2.*)
987
        # Unixware is an offshoot of SVR4, but it has its own version
1053
	# Unixware is an offshoot of SVR4, but it has its own version
988
        # number series starting with 2...
1054
	# number series starting with 2...
989
        # I am not positive that other SVR4 systems won't match this,
1055
	# I am not positive that other SVR4 systems won't match this,
990
	# I just have to hope.  -- rms.
1056
	# I just have to hope.  -- rms.
991
        # Use sysv4.2uw... so that sysv4* matches it.
1057
	# Use sysv4.2uw... so that sysv4* matches it.
992
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1058
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
993
	exit ;;
1059
	exit ;;
994
    i*86:OS/2:*:*)
1060
    i*86:OS/2:*:*)
Lines 1020-1026 Link Here
1020
	fi
1086
	fi
1021
	exit ;;
1087
	exit ;;
1022
    i*86:*:5:[678]*)
1088
    i*86:*:5:[678]*)
1023
    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1089
	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1024
	case `/bin/uname -X | grep "^Machine"` in
1090
	case `/bin/uname -X | grep "^Machine"` in
1025
	    *486*)	     UNAME_MACHINE=i486 ;;
1091
	    *486*)	     UNAME_MACHINE=i486 ;;
1026
	    *Pentium)	     UNAME_MACHINE=i586 ;;
1092
	    *Pentium)	     UNAME_MACHINE=i586 ;;
Lines 1048-1060 Link Here
1048
	exit ;;
1114
	exit ;;
1049
    pc:*:*:*)
1115
    pc:*:*:*)
1050
	# Left here for compatibility:
1116
	# Left here for compatibility:
1051
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1117
	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1052
        # the processor, so we play safe by assuming i586.
1118
	# the processor, so we play safe by assuming i586.
1053
	# Note: whatever this is, it MUST be the same as what config.sub
1119
	# Note: whatever this is, it MUST be the same as what config.sub
1054
	# prints for the "djgpp" host, or else GDB configury will decide that
1120
	# prints for the "djgpp" host, or else GDB configury will decide that
1055
	# this is a cross-build.
1121
	# this is a cross-build.
1056
	echo i586-pc-msdosdjgpp
1122
	echo i586-pc-msdosdjgpp
1057
        exit ;;
1123
	exit ;;
1058
    Intel:Mach:3*:*)
1124
    Intel:Mach:3*:*)
1059
	echo i386-pc-mach3
1125
	echo i386-pc-mach3
1060
	exit ;;
1126
	exit ;;
Lines 1089-1096 Link Here
1089
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1155
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1090
	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1156
	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1091
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1157
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1092
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1158
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1093
          && { echo i486-ncr-sysv4; exit; } ;;
1159
	  && { echo i486-ncr-sysv4; exit; } ;;
1094
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1160
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1095
	OS_REL='.3'
1161
	OS_REL='.3'
1096
	test -r /etc/.relid \
1162
	test -r /etc/.relid \
Lines 1133-1142 Link Here
1133
		echo ns32k-sni-sysv
1199
		echo ns32k-sni-sysv
1134
	fi
1200
	fi
1135
	exit ;;
1201
	exit ;;
1136
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1202
    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1137
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1203
			# says <Richard.M.Bartel@ccMail.Census.GOV>
1138
        echo i586-unisys-sysv4
1204
	echo i586-unisys-sysv4
1139
        exit ;;
1205
	exit ;;
1140
    *:UNIX_System_V:4*:FTX*)
1206
    *:UNIX_System_V:4*:FTX*)
1141
	# From Gerald Hewes <hewes@openmarket.com>.
1207
	# From Gerald Hewes <hewes@openmarket.com>.
1142
	# How about differentiating between stratus architectures? -djm
1208
	# How about differentiating between stratus architectures? -djm
Lines 1162-1172 Link Here
1162
	exit ;;
1228
	exit ;;
1163
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1229
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1164
	if [ -d /usr/nec ]; then
1230
	if [ -d /usr/nec ]; then
1165
	        echo mips-nec-sysv${UNAME_RELEASE}
1231
		echo mips-nec-sysv${UNAME_RELEASE}
1166
	else
1232
	else
1167
	        echo mips-unknown-sysv${UNAME_RELEASE}
1233
		echo mips-unknown-sysv${UNAME_RELEASE}
1168
	fi
1234
	fi
1169
        exit ;;
1235
	exit ;;
1170
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1236
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1171
	echo powerpc-be-beos
1237
	echo powerpc-be-beos
1172
	exit ;;
1238
	exit ;;
Lines 1179-1184 Link Here
1179
    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1245
    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1180
	echo i586-pc-haiku
1246
	echo i586-pc-haiku
1181
	exit ;;
1247
	exit ;;
1248
    x86_64:Haiku:*:*)
1249
	echo x86_64-unknown-haiku
1250
	exit ;;
1182
    SX-4:SUPER-UX:*:*)
1251
    SX-4:SUPER-UX:*:*)
1183
	echo sx4-nec-superux${UNAME_RELEASE}
1252
	echo sx4-nec-superux${UNAME_RELEASE}
1184
	exit ;;
1253
	exit ;;
Lines 1205-1223 Link Here
1205
	exit ;;
1274
	exit ;;
1206
    *:Darwin:*:*)
1275
    *:Darwin:*:*)
1207
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1276
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1208
	case $UNAME_PROCESSOR in
1277
	eval $set_cc_for_build
1209
	    i386)
1278
	if test "$UNAME_PROCESSOR" = unknown ; then
1210
		eval $set_cc_for_build
1279
	    UNAME_PROCESSOR=powerpc
1211
		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1280
	fi
1212
		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1281
	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1213
		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1282
	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1214
		      grep IS_64BIT_ARCH >/dev/null
1283
		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1215
		  then
1284
		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1216
		      UNAME_PROCESSOR="x86_64"
1285
		    grep IS_64BIT_ARCH >/dev/null
1217
		  fi
1286
		then
1218
		fi ;;
1287
		    case $UNAME_PROCESSOR in
1219
	    unknown) UNAME_PROCESSOR=powerpc ;;
1288
			i386) UNAME_PROCESSOR=x86_64 ;;
1220
	esac
1289
			powerpc) UNAME_PROCESSOR=powerpc64 ;;
1290
		    esac
1291
		fi
1292
	    fi
1293
	elif test "$UNAME_PROCESSOR" = i386 ; then
1294
	    # Avoid executing cc on OS X 10.9, as it ships with a stub
1295
	    # that puts up a graphical alert prompting to install
1296
	    # developer tools.  Any system running Mac OS X 10.7 or
1297
	    # later (Darwin 11 and later) is required to have a 64-bit
1298
	    # processor. This is not true of the ARM version of Darwin
1299
	    # that Apple uses in portable devices.
1300
	    UNAME_PROCESSOR=x86_64
1301
	fi
1221
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1302
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1222
	exit ;;
1303
	exit ;;
1223
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1304
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
Lines 1231-1237 Link Here
1231
    *:QNX:*:4*)
1312
    *:QNX:*:4*)
1232
	echo i386-pc-qnx
1313
	echo i386-pc-qnx
1233
	exit ;;
1314
	exit ;;
1234
    NSE-?:NONSTOP_KERNEL:*:*)
1315
    NEO-?:NONSTOP_KERNEL:*:*)
1316
	echo neo-tandem-nsk${UNAME_RELEASE}
1317
	exit ;;
1318
    NSE-*:NONSTOP_KERNEL:*:*)
1235
	echo nse-tandem-nsk${UNAME_RELEASE}
1319
	echo nse-tandem-nsk${UNAME_RELEASE}
1236
	exit ;;
1320
	exit ;;
1237
    NSR-?:NONSTOP_KERNEL:*:*)
1321
    NSR-?:NONSTOP_KERNEL:*:*)
Lines 1276-1288 Link Here
1276
	echo pdp10-unknown-its
1360
	echo pdp10-unknown-its
1277
	exit ;;
1361
	exit ;;
1278
    SEI:*:*:SEIUX)
1362
    SEI:*:*:SEIUX)
1279
        echo mips-sei-seiux${UNAME_RELEASE}
1363
	echo mips-sei-seiux${UNAME_RELEASE}
1280
	exit ;;
1364
	exit ;;
1281
    *:DragonFly:*:*)
1365
    *:DragonFly:*:*)
1282
	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1366
	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1283
	exit ;;
1367
	exit ;;
1284
    *:*VMS:*:*)
1368
    *:*VMS:*:*)
1285
    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1369
	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1286
	case "${UNAME_MACHINE}" in
1370
	case "${UNAME_MACHINE}" in
1287
	    A*) echo alpha-dec-vms ; exit ;;
1371
	    A*) echo alpha-dec-vms ; exit ;;
1288
	    I*) echo ia64-dec-vms ; exit ;;
1372
	    I*) echo ia64-dec-vms ; exit ;;
Lines 1300-1458 Link Here
1300
    i*86:AROS:*:*)
1384
    i*86:AROS:*:*)
1301
	echo ${UNAME_MACHINE}-pc-aros
1385
	echo ${UNAME_MACHINE}-pc-aros
1302
	exit ;;
1386
	exit ;;
1387
    x86_64:VMkernel:*:*)
1388
	echo ${UNAME_MACHINE}-unknown-esx
1389
	exit ;;
1303
esac
1390
esac
1304
1391
1305
#echo '(No uname command or uname output not recognized.)' 1>&2
1306
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1307
1308
eval $set_cc_for_build
1309
cat >$dummy.c <<EOF
1310
#ifdef _SEQUENT_
1311
# include <sys/types.h>
1312
# include <sys/utsname.h>
1313
#endif
1314
main ()
1315
{
1316
#if defined (sony)
1317
#if defined (MIPSEB)
1318
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1319
     I don't know....  */
1320
  printf ("mips-sony-bsd\n"); exit (0);
1321
#else
1322
#include <sys/param.h>
1323
  printf ("m68k-sony-newsos%s\n",
1324
#ifdef NEWSOS4
1325
          "4"
1326
#else
1327
	  ""
1328
#endif
1329
         ); exit (0);
1330
#endif
1331
#endif
1332
1333
#if defined (__arm) && defined (__acorn) && defined (__unix)
1334
  printf ("arm-acorn-riscix\n"); exit (0);
1335
#endif
1336
1337
#if defined (hp300) && !defined (hpux)
1338
  printf ("m68k-hp-bsd\n"); exit (0);
1339
#endif
1340
1341
#if defined (NeXT)
1342
#if !defined (__ARCHITECTURE__)
1343
#define __ARCHITECTURE__ "m68k"
1344
#endif
1345
  int version;
1346
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1347
  if (version < 4)
1348
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1349
  else
1350
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1351
  exit (0);
1352
#endif
1353
1354
#if defined (MULTIMAX) || defined (n16)
1355
#if defined (UMAXV)
1356
  printf ("ns32k-encore-sysv\n"); exit (0);
1357
#else
1358
#if defined (CMU)
1359
  printf ("ns32k-encore-mach\n"); exit (0);
1360
#else
1361
  printf ("ns32k-encore-bsd\n"); exit (0);
1362
#endif
1363
#endif
1364
#endif
1365
1366
#if defined (__386BSD__)
1367
  printf ("i386-pc-bsd\n"); exit (0);
1368
#endif
1369
1370
#if defined (sequent)
1371
#if defined (i386)
1372
  printf ("i386-sequent-dynix\n"); exit (0);
1373
#endif
1374
#if defined (ns32000)
1375
  printf ("ns32k-sequent-dynix\n"); exit (0);
1376
#endif
1377
#endif
1378
1379
#if defined (_SEQUENT_)
1380
    struct utsname un;
1381
1382
    uname(&un);
1383
1384
    if (strncmp(un.version, "V2", 2) == 0) {
1385
	printf ("i386-sequent-ptx2\n"); exit (0);
1386
    }
1387
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1388
	printf ("i386-sequent-ptx1\n"); exit (0);
1389
    }
1390
    printf ("i386-sequent-ptx\n"); exit (0);
1391
1392
#endif
1393
1394
#if defined (vax)
1395
# if !defined (ultrix)
1396
#  include <sys/param.h>
1397
#  if defined (BSD)
1398
#   if BSD == 43
1399
      printf ("vax-dec-bsd4.3\n"); exit (0);
1400
#   else
1401
#    if BSD == 199006
1402
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1403
#    else
1404
      printf ("vax-dec-bsd\n"); exit (0);
1405
#    endif
1406
#   endif
1407
#  else
1408
    printf ("vax-dec-bsd\n"); exit (0);
1409
#  endif
1410
# else
1411
    printf ("vax-dec-ultrix\n"); exit (0);
1412
# endif
1413
#endif
1414
1415
#if defined (alliant) && defined (i860)
1416
  printf ("i860-alliant-bsd\n"); exit (0);
1417
#endif
1418
1419
  exit (1);
1420
}
1421
EOF
1422
1423
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1424
	{ echo "$SYSTEM_NAME"; exit; }
1425
1426
# Apollos put the system type in the environment.
1427
1428
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1429
1430
# Convex versions that predate uname can use getsysinfo(1)
1431
1432
if [ -x /usr/convex/getsysinfo ]
1433
then
1434
    case `getsysinfo -f cpu_type` in
1435
    c1*)
1436
	echo c1-convex-bsd
1437
	exit ;;
1438
    c2*)
1439
	if getsysinfo -f scalar_acc
1440
	then echo c32-convex-bsd
1441
	else echo c2-convex-bsd
1442
	fi
1443
	exit ;;
1444
    c34*)
1445
	echo c34-convex-bsd
1446
	exit ;;
1447
    c38*)
1448
	echo c38-convex-bsd
1449
	exit ;;
1450
    c4*)
1451
	echo c4-convex-bsd
1452
	exit ;;
1453
    esac
1454
fi
1455
1456
cat >&2 <<EOF
1392
cat >&2 <<EOF
1457
$0: unable to guess system type
1393
$0: unable to guess system type
1458
1394
(-)contrib/tcsh/config.h.in (-1 / +4 lines)
Lines 1-4 Link Here
1
/* config.h.in.  Generated from configure.in by autoheader.  */
1
/* config.h.in.  Generated from configure.ac by autoheader.  */
2
2
3
/* Define to the type of elements in the array set by `getgroups'. Usually
3
/* Define to the type of elements in the array set by `getgroups'. Usually
4
   this is either `int' or `gid_t'. */
4
   this is either `int' or `gid_t'. */
Lines 69-74 Link Here
69
/* Define to 1 if you have the `mallinfo' function. */
69
/* Define to 1 if you have the `mallinfo' function. */
70
#undef HAVE_MALLINFO
70
#undef HAVE_MALLINFO
71
71
72
/* Define to 1 if you have the `mblen' function. */
73
#undef HAVE_MBLEN
74
72
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
75
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
73
#undef HAVE_MBRTOWC
76
#undef HAVE_MBRTOWC
74
77
(-)contrib/tcsh/config.sub (-100 / +180 lines)
Lines 1-38 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# Configuration validation subroutine script.
2
# Configuration validation subroutine script.
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
#   Copyright 1992-2013 Free Software Foundation, Inc.
4
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5
#   Free Software Foundation, Inc.
6
4
7
timestamp='2009-12-31'
5
timestamp='2013-04-24'
8
6
9
# This file is (in principle) common to ALL GNU software.
7
# This file is free software; you can redistribute it and/or modify it
10
# The presence of a machine in this file suggests that SOME GNU software
8
# under the terms of the GNU General Public License as published by
11
# can handle that machine.  It does not imply ALL GNU software can.
9
# the Free Software Foundation; either version 3 of the License, or
12
#
13
# This file is free software; you can redistribute it and/or modify
14
# it under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 2 of the License, or
16
# (at your option) any later version.
10
# (at your option) any later version.
17
#
11
#
18
# This program is distributed in the hope that it will be useful,
12
# This program is distributed in the hope that it will be useful, but
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
# GNU General Public License for more details.
15
# General Public License for more details.
22
#
16
#
23
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
18
# along with this program; if not, see <http://www.gnu.org/licenses/>.
25
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26
# 02110-1301, USA.
27
#
19
#
28
# As a special exception to the GNU General Public License, if you
20
# As a special exception to the GNU General Public License, if you
29
# distribute this file as part of a program that contains a
21
# distribute this file as part of a program that contains a
30
# configuration script generated by Autoconf, you may include it under
22
# configuration script generated by Autoconf, you may include it under
31
# the same distribution terms that you use for the rest of that program.
23
# the same distribution terms that you use for the rest of that
24
# program.  This Exception is an additional permission under section 7
25
# of the GNU General Public License, version 3 ("GPLv3").
32
26
33
27
34
# Please send patches to <config-patches@gnu.org>.  Submit a context
28
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
35
# diff and a properly formatted GNU ChangeLog entry.
36
#
29
#
37
# Configuration subroutine to validate and canonicalize a configuration type.
30
# Configuration subroutine to validate and canonicalize a configuration type.
38
# Supply the specified configuration type as an argument.
31
# Supply the specified configuration type as an argument.
Lines 75-83 Link Here
75
version="\
68
version="\
76
GNU config.sub ($timestamp)
69
GNU config.sub ($timestamp)
77
70
78
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
71
Copyright 1992-2013 Free Software Foundation, Inc.
79
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80
Software Foundation, Inc.
81
72
82
This is free software; see the source for copying conditions.  There is NO
73
This is free software; see the source for copying conditions.  There is NO
83
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
74
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Lines 124-136 Link Here
124
# Here we must recognize all the valid KERNEL-OS combinations.
115
# Here we must recognize all the valid KERNEL-OS combinations.
125
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126
case $maybe_os in
117
case $maybe_os in
127
  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
118
  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128
  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
119
  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
120
  knetbsd*-gnu* | netbsd*-gnu* | \
129
  kopensolaris*-gnu* | \
121
  kopensolaris*-gnu* | \
130
  storm-chaos* | os2-emx* | rtmk-nova*)
122
  storm-chaos* | os2-emx* | rtmk-nova*)
131
    os=-$maybe_os
123
    os=-$maybe_os
132
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
133
    ;;
125
    ;;
126
  android-linux)
127
    os=-linux-android
128
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
129
    ;;
134
  *)
130
  *)
135
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
136
    if [ $basic_machine != $1 ]
132
    if [ $basic_machine != $1 ]
Lines 153-164 Link Here
153
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
154
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
155
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
156
	-apple | -axis | -knuth | -cray | -microblaze)
152
	-apple | -axis | -knuth | -cray | -microblaze*)
157
		os=
153
		os=
158
		basic_machine=$1
154
		basic_machine=$1
159
		;;
155
		;;
160
        -bluegene*)
156
	-bluegene*)
161
	        os=-cnk
157
		os=-cnk
162
		;;
158
		;;
163
	-sim | -cisco | -oki | -wec | -winbond)
159
	-sim | -cisco | -oki | -wec | -winbond)
164
		os=
160
		os=
Lines 174-183 Link Here
174
		os=-chorusos
170
		os=-chorusos
175
		basic_machine=$1
171
		basic_machine=$1
176
		;;
172
		;;
177
 	-chorusrdb)
173
	-chorusrdb)
178
 		os=-chorusrdb
174
		os=-chorusrdb
179
		basic_machine=$1
175
		basic_machine=$1
180
 		;;
176
		;;
181
	-hiux*)
177
	-hiux*)
182
		os=-hiuxwe2
178
		os=-hiuxwe2
183
		;;
179
		;;
Lines 222-227 Link Here
222
	-isc*)
218
	-isc*)
223
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
224
		;;
220
		;;
221
	-lynx*178)
222
		os=-lynxos178
223
		;;
224
	-lynx*5)
225
		os=-lynxos5
226
		;;
225
	-lynx*)
227
	-lynx*)
226
		os=-lynxos
228
		os=-lynxos
227
		;;
229
		;;
Lines 246-265 Link Here
246
	# Some are omitted here because they have special meanings below.
248
	# Some are omitted here because they have special meanings below.
247
	1750a | 580 \
249
	1750a | 580 \
248
	| a29k \
250
	| a29k \
251
	| aarch64 | aarch64_be \
249
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
250
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
251
	| am33_2.0 \
254
	| am33_2.0 \
252
	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
255
	| arc | arceb \
256
	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
257
	| avr | avr32 \
258
	| be32 | be64 \
253
	| bfin \
259
	| bfin \
254
	| c4x | clipper \
260
	| c4x | clipper \
255
	| d10v | d30v | dlx | dsp16xx \
261
	| d10v | d30v | dlx | dsp16xx \
262
	| epiphany \
256
	| fido | fr30 | frv \
263
	| fido | fr30 | frv \
257
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
265
	| hexagon \
258
	| i370 | i860 | i960 | ia64 \
266
	| i370 | i860 | i960 | ia64 \
259
	| ip2k | iq2000 \
267
	| ip2k | iq2000 \
268
	| le32 | le64 \
260
	| lm32 \
269
	| lm32 \
261
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
270
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
262
	| maxq | mb | microblaze | mcore | mep | metag \
271
	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
263
	| mips | mipsbe | mipseb | mipsel | mipsle \
272
	| mips | mipsbe | mipseb | mipsel | mipsle \
264
	| mips16 \
273
	| mips16 \
265
	| mips64 | mips64el \
274
	| mips64 | mips64el \
Lines 277-310 Link Here
277
	| mipsisa64r2 | mipsisa64r2el \
286
	| mipsisa64r2 | mipsisa64r2el \
278
	| mipsisa64sb1 | mipsisa64sb1el \
287
	| mipsisa64sb1 | mipsisa64sb1el \
279
	| mipsisa64sr71k | mipsisa64sr71kel \
288
	| mipsisa64sr71k | mipsisa64sr71kel \
289
	| mipsr5900 | mipsr5900el \
280
	| mipstx39 | mipstx39el \
290
	| mipstx39 | mipstx39el \
281
	| mn10200 | mn10300 \
291
	| mn10200 | mn10300 \
282
	| moxie \
292
	| moxie \
283
	| mt \
293
	| mt \
284
	| msp430 \
294
	| msp430 \
285
	| nios | nios2 \
295
	| nds32 | nds32le | nds32be \
296
	| nios | nios2 | nios2eb | nios2el \
286
	| ns16k | ns32k \
297
	| ns16k | ns32k \
287
	| or32 \
298
	| open8 \
299
	| or1k | or32 \
288
	| pdp10 | pdp11 | pj | pjl \
300
	| pdp10 | pdp11 | pj | pjl \
289
	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
301
	| powerpc | powerpc64 | powerpc64le | powerpcle \
290
	| pyramid \
302
	| pyramid \
291
	| rx \
303
	| rl78 | rx \
292
	| score \
304
	| score \
293
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
305
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
294
	| sh64 | sh64le \
306
	| sh64 | sh64le \
295
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
307
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
296
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
308
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
297
	| spu | strongarm \
309
	| spu \
298
	| tahoe | thumb | tic4x | tic80 | tron \
310
	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
299
	| ubicom32 \
311
	| ubicom32 \
300
	| v850 | v850e \
312
	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
301
	| we32k \
313
	| we32k \
302
	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
314
	| x86 | xc16x | xstormy16 | xtensa \
303
	| z8k | z80)
315
	| z8k | z80)
304
		basic_machine=$basic_machine-unknown
316
		basic_machine=$basic_machine-unknown
305
		;;
317
		;;
306
	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
318
	c54x)
307
		# Motorola 68HC11/12.
319
		basic_machine=tic54x-unknown
320
		;;
321
	c55x)
322
		basic_machine=tic55x-unknown
323
		;;
324
	c6x)
325
		basic_machine=tic6x-unknown
326
		;;
327
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
308
		basic_machine=$basic_machine-unknown
328
		basic_machine=$basic_machine-unknown
309
		os=-none
329
		os=-none
310
		;;
330
		;;
Lines 314-319 Link Here
314
		basic_machine=mt-unknown
334
		basic_machine=mt-unknown
315
		;;
335
		;;
316
336
337
	strongarm | thumb | xscale)
338
		basic_machine=arm-unknown
339
		;;
340
	xgate)
341
		basic_machine=$basic_machine-unknown
342
		os=-none
343
		;;
344
	xscaleeb)
345
		basic_machine=armeb-unknown
346
		;;
347
348
	xscaleel)
349
		basic_machine=armel-unknown
350
		;;
351
317
	# We use `pc' rather than `unknown'
352
	# We use `pc' rather than `unknown'
318
	# because (1) that's what they normally are, and
353
	# because (1) that's what they normally are, and
319
	# (2) the word "unknown" tends to confuse beginning users.
354
	# (2) the word "unknown" tends to confuse beginning users.
Lines 328-340 Link Here
328
	# Recognize the basic CPU types with company name.
363
	# Recognize the basic CPU types with company name.
329
	580-* \
364
	580-* \
330
	| a29k-* \
365
	| a29k-* \
366
	| aarch64-* | aarch64_be-* \
331
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
367
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
332
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
368
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
333
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
369
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
334
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
370
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
335
	| avr-* | avr32-* \
371
	| avr-* | avr32-* \
372
	| be32-* | be64-* \
336
	| bfin-* | bs2000-* \
373
	| bfin-* | bs2000-* \
337
	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
374
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
338
	| clipper-* | craynv-* | cydra-* \
375
	| clipper-* | craynv-* | cydra-* \
339
	| d10v-* | d30v-* | dlx-* \
376
	| d10v-* | d30v-* | dlx-* \
340
	| elxsi-* \
377
	| elxsi-* \
Lines 341-352 Link Here
341
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
378
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
342
	| h8300-* | h8500-* \
379
	| h8300-* | h8500-* \
343
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
380
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
381
	| hexagon-* \
344
	| i*86-* | i860-* | i960-* | ia64-* \
382
	| i*86-* | i860-* | i960-* | ia64-* \
345
	| ip2k-* | iq2000-* \
383
	| ip2k-* | iq2000-* \
384
	| le32-* | le64-* \
346
	| lm32-* \
385
	| lm32-* \
347
	| m32c-* | m32r-* | m32rle-* \
386
	| m32c-* | m32r-* | m32rle-* \
348
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
387
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
349
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
388
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
389
	| microblaze-* | microblazeel-* \
350
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
390
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
351
	| mips16-* \
391
	| mips16-* \
352
	| mips64-* | mips64el-* \
392
	| mips64-* | mips64el-* \
Lines 364-392 Link Here
364
	| mipsisa64r2-* | mipsisa64r2el-* \
404
	| mipsisa64r2-* | mipsisa64r2el-* \
365
	| mipsisa64sb1-* | mipsisa64sb1el-* \
405
	| mipsisa64sb1-* | mipsisa64sb1el-* \
366
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
406
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
407
	| mipsr5900-* | mipsr5900el-* \
367
	| mipstx39-* | mipstx39el-* \
408
	| mipstx39-* | mipstx39el-* \
368
	| mmix-* \
409
	| mmix-* \
369
	| mt-* \
410
	| mt-* \
370
	| msp430-* \
411
	| msp430-* \
371
	| nios-* | nios2-* \
412
	| nds32-* | nds32le-* | nds32be-* \
413
	| nios-* | nios2-* | nios2eb-* | nios2el-* \
372
	| none-* | np1-* | ns16k-* | ns32k-* \
414
	| none-* | np1-* | ns16k-* | ns32k-* \
415
	| open8-* \
373
	| orion-* \
416
	| orion-* \
374
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
417
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
375
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
418
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
376
	| pyramid-* \
419
	| pyramid-* \
377
	| romp-* | rs6000-* | rx-* \
420
	| rl78-* | romp-* | rs6000-* | rx-* \
378
	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
421
	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
379
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
422
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
380
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
423
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
381
	| sparclite-* \
424
	| sparclite-* \
382
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
425
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
383
	| tahoe-* | thumb-* \
426
	| tahoe-* \
384
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
427
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
428
	| tile*-* \
385
	| tron-* \
429
	| tron-* \
386
	| ubicom32-* \
430
	| ubicom32-* \
387
	| v850-* | v850e-* | vax-* \
431
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
432
	| vax-* \
388
	| we32k-* \
433
	| we32k-* \
389
	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
434
	| x86-* | x86_64-* | xc16x-* | xps100-* \
390
	| xstormy16-* | xtensa*-* \
435
	| xstormy16-* | xtensa*-* \
391
	| ymp-* \
436
	| ymp-* \
392
	| z8k-* | z80-*)
437
	| z8k-* | z80-*)
Lines 411-417 Link Here
411
		basic_machine=a29k-amd
456
		basic_machine=a29k-amd
412
		os=-udi
457
		os=-udi
413
		;;
458
		;;
414
    	abacus)
459
	abacus)
415
		basic_machine=abacus-unknown
460
		basic_machine=abacus-unknown
416
		;;
461
		;;
417
	adobe68k)
462
	adobe68k)
Lines 481-491 Link Here
481
		basic_machine=powerpc-ibm
526
		basic_machine=powerpc-ibm
482
		os=-cnk
527
		os=-cnk
483
		;;
528
		;;
529
	c54x-*)
530
		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
531
		;;
532
	c55x-*)
533
		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
534
		;;
535
	c6x-*)
536
		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
537
		;;
484
	c90)
538
	c90)
485
		basic_machine=c90-cray
539
		basic_machine=c90-cray
486
		os=-unicos
540
		os=-unicos
487
		;;
541
		;;
488
        cegcc)
542
	cegcc)
489
		basic_machine=arm-unknown
543
		basic_machine=arm-unknown
490
		os=-cegcc
544
		os=-cegcc
491
		;;
545
		;;
Lines 517-523 Link Here
517
		basic_machine=craynv-cray
571
		basic_machine=craynv-cray
518
		os=-unicosmp
572
		os=-unicosmp
519
		;;
573
		;;
520
	cr16)
574
	cr16 | cr16-*)
521
		basic_machine=cr16-unknown
575
		basic_machine=cr16-unknown
522
		os=-elf
576
		os=-elf
523
		;;
577
		;;
Lines 675-681 Link Here
675
	i370-ibm* | ibm*)
729
	i370-ibm* | ibm*)
676
		basic_machine=i370-ibm
730
		basic_machine=i370-ibm
677
		;;
731
		;;
678
# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
679
	i*86v32)
732
	i*86v32)
680
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
733
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
681
		os=-sysv32
734
		os=-sysv32
Lines 733-741 Link Here
733
		basic_machine=ns32k-utek
786
		basic_machine=ns32k-utek
734
		os=-sysv
787
		os=-sysv
735
		;;
788
		;;
736
        microblaze)
789
	microblaze*)
737
		basic_machine=microblaze-xilinx
790
		basic_machine=microblaze-xilinx
738
		;;
791
		;;
792
	mingw64)
793
		basic_machine=x86_64-pc
794
		os=-mingw64
795
		;;
739
	mingw32)
796
	mingw32)
740
		basic_machine=i386-pc
797
		basic_machine=i386-pc
741
		os=-mingw32
798
		os=-mingw32
Lines 772-781 Link Here
772
	ms1-*)
829
	ms1-*)
773
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
830
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
774
		;;
831
		;;
832
	msys)
833
		basic_machine=i386-pc
834
		os=-msys
835
		;;
775
	mvs)
836
	mvs)
776
		basic_machine=i370-ibm
837
		basic_machine=i370-ibm
777
		os=-mvs
838
		os=-mvs
778
		;;
839
		;;
840
	nacl)
841
		basic_machine=le32-unknown
842
		os=-nacl
843
		;;
779
	ncr3000)
844
	ncr3000)
780
		basic_machine=i486-ncr
845
		basic_machine=i486-ncr
781
		os=-sysv4
846
		os=-sysv4
Lines 840-845 Link Here
840
	np1)
905
	np1)
841
		basic_machine=np1-gould
906
		basic_machine=np1-gould
842
		;;
907
		;;
908
	neo-tandem)
909
		basic_machine=neo-tandem
910
		;;
911
	nse-tandem)
912
		basic_machine=nse-tandem
913
		;;
843
	nsr-tandem)
914
	nsr-tandem)
844
		basic_machine=nsr-tandem
915
		basic_machine=nsr-tandem
845
		;;
916
		;;
Lines 922-930 Link Here
922
		;;
993
		;;
923
	power)	basic_machine=power-ibm
994
	power)	basic_machine=power-ibm
924
		;;
995
		;;
925
	ppc)	basic_machine=powerpc-unknown
996
	ppc | ppcbe)	basic_machine=powerpc-unknown
926
		;;
997
		;;
927
	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
998
	ppc-* | ppcbe-*)
999
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
928
		;;
1000
		;;
929
	ppcle | powerpclittle | ppc-le | powerpc-little)
1001
	ppcle | powerpclittle | ppc-le | powerpc-little)
930
		basic_machine=powerpcle-unknown
1002
		basic_machine=powerpcle-unknown
Lines 949-955 Link Here
949
		basic_machine=i586-unknown
1021
		basic_machine=i586-unknown
950
		os=-pw32
1022
		os=-pw32
951
		;;
1023
		;;
952
	rdos)
1024
	rdos | rdos64)
1025
		basic_machine=x86_64-pc
1026
		os=-rdos
1027
		;;
1028
	rdos32)
953
		basic_machine=i386-pc
1029
		basic_machine=i386-pc
954
		os=-rdos
1030
		os=-rdos
955
		;;
1031
		;;
Lines 1018-1023 Link Here
1018
		basic_machine=i860-stratus
1094
		basic_machine=i860-stratus
1019
		os=-sysv4
1095
		os=-sysv4
1020
		;;
1096
		;;
1097
	strongarm-* | thumb-*)
1098
		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1099
		;;
1021
	sun2)
1100
	sun2)
1022
		basic_machine=m68000-sun
1101
		basic_machine=m68000-sun
1023
		;;
1102
		;;
Lines 1074-1093 Link Here
1074
		basic_machine=t90-cray
1153
		basic_machine=t90-cray
1075
		os=-unicos
1154
		os=-unicos
1076
		;;
1155
		;;
1077
	tic54x | c54x*)
1078
		basic_machine=tic54x-unknown
1079
		os=-coff
1080
		;;
1081
	tic55x | c55x*)
1082
		basic_machine=tic55x-unknown
1083
		os=-coff
1084
		;;
1085
	tic6x | c6x*)
1086
		basic_machine=tic6x-unknown
1087
		os=-coff
1088
		;;
1089
	tile*)
1156
	tile*)
1090
		basic_machine=tile-unknown
1157
		basic_machine=$basic_machine-unknown
1091
		os=-linux-gnu
1158
		os=-linux-gnu
1092
		;;
1159
		;;
1093
	tx39)
1160
	tx39)
Lines 1157-1162 Link Here
1157
	xps | xps100)
1224
	xps | xps100)
1158
		basic_machine=xps100-honeywell
1225
		basic_machine=xps100-honeywell
1159
		;;
1226
		;;
1227
	xscale-* | xscalee[bl]-*)
1228
		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1229
		;;
1160
	ymp)
1230
	ymp)
1161
		basic_machine=ymp-cray
1231
		basic_machine=ymp-cray
1162
		os=-unicos
1232
		os=-unicos
Lines 1254-1264 Link Here
1254
if [ x"$os" != x"" ]
1324
if [ x"$os" != x"" ]
1255
then
1325
then
1256
case $os in
1326
case $os in
1257
        # First match some system type aliases
1327
	# First match some system type aliases
1258
        # that might get confused with valid system types.
1328
	# that might get confused with valid system types.
1259
	# -solaris* is a basic system type, with this one exception.
1329
	# -solaris* is a basic system type, with this one exception.
1260
        -auroraux)
1330
	-auroraux)
1261
	        os=-auroraux
1331
		os=-auroraux
1262
		;;
1332
		;;
1263
	-solaris1 | -solaris1.*)
1333
	-solaris1 | -solaris1.*)
1264
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1334
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
Lines 1282-1301 Link Here
1282
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1352
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1283
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1353
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1284
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1354
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1285
	      | -sym* | -kopensolaris* \
1355
	      | -sym* | -kopensolaris* | -plan9* \
1286
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1356
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1287
	      | -aos* | -aros* \
1357
	      | -aos* | -aros* \
1288
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1358
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1289
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1359
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1290
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1360
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1291
	      | -openbsd* | -solidbsd* \
1361
	      | -bitrig* | -openbsd* | -solidbsd* \
1292
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1362
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1293
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1363
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1294
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1364
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1295
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1365
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1296
	      | -chorusos* | -chorusrdb* | -cegcc* \
1366
	      | -chorusos* | -chorusrdb* | -cegcc* \
1297
	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1367
	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1298
	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1368
	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1369
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1299
	      | -uxpv* | -beos* | -mpeix* | -udk* \
1370
	      | -uxpv* | -beos* | -mpeix* | -udk* \
1300
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1371
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1301
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1372
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
Lines 1342-1348 Link Here
1342
	-opened*)
1413
	-opened*)
1343
		os=-openedition
1414
		os=-openedition
1344
		;;
1415
		;;
1345
        -os400*)
1416
	-os400*)
1346
		os=-os400
1417
		os=-os400
1347
		;;
1418
		;;
1348
	-wince*)
1419
	-wince*)
Lines 1391-1397 Link Here
1391
	-sinix*)
1462
	-sinix*)
1392
		os=-sysv4
1463
		os=-sysv4
1393
		;;
1464
		;;
1394
        -tpf*)
1465
	-tpf*)
1395
		os=-tpf
1466
		os=-tpf
1396
		;;
1467
		;;
1397
	-triton*)
1468
	-triton*)
Lines 1427-1435 Link Here
1427
	-aros*)
1498
	-aros*)
1428
		os=-aros
1499
		os=-aros
1429
		;;
1500
		;;
1430
	-kaos*)
1431
		os=-kaos
1432
		;;
1433
	-zvmoe)
1501
	-zvmoe)
1434
		os=-zvmoe
1502
		os=-zvmoe
1435
		;;
1503
		;;
Lines 1436-1443 Link Here
1436
	-dicos*)
1504
	-dicos*)
1437
		os=-dicos
1505
		os=-dicos
1438
		;;
1506
		;;
1439
        -nacl*)
1507
	-nacl*)
1440
	        ;;
1508
		;;
1441
	-none)
1509
	-none)
1442
		;;
1510
		;;
1443
	*)
1511
	*)
Lines 1460-1469 Link Here
1460
# system, and we'll never get to this point.
1528
# system, and we'll never get to this point.
1461
1529
1462
case $basic_machine in
1530
case $basic_machine in
1463
        score-*)
1531
	score-*)
1464
		os=-elf
1532
		os=-elf
1465
		;;
1533
		;;
1466
        spu-*)
1534
	spu-*)
1467
		os=-elf
1535
		os=-elf
1468
		;;
1536
		;;
1469
	*-acorn)
1537
	*-acorn)
Lines 1475-1483 Link Here
1475
	arm*-semi)
1543
	arm*-semi)
1476
		os=-aout
1544
		os=-aout
1477
		;;
1545
		;;
1478
        c4x-* | tic4x-*)
1546
	c4x-* | tic4x-*)
1479
        	os=-coff
1547
		os=-coff
1480
		;;
1548
		;;
1549
	hexagon-*)
1550
		os=-elf
1551
		;;
1552
	tic54x-*)
1553
		os=-coff
1554
		;;
1555
	tic55x-*)
1556
		os=-coff
1557
		;;
1558
	tic6x-*)
1559
		os=-coff
1560
		;;
1481
	# This must come before the *-dec entry.
1561
	# This must come before the *-dec entry.
1482
	pdp10-*)
1562
	pdp10-*)
1483
		os=-tops20
1563
		os=-tops20
Lines 1496-1509 Link Here
1496
		;;
1576
		;;
1497
	m68000-sun)
1577
	m68000-sun)
1498
		os=-sunos3
1578
		os=-sunos3
1499
		# This also exists in the configure program, but was not the
1500
		# default.
1501
		# os=-sunos4
1502
		;;
1579
		;;
1503
	m68*-cisco)
1580
	m68*-cisco)
1504
		os=-aout
1581
		os=-aout
1505
		;;
1582
		;;
1506
        mep-*)
1583
	mep-*)
1507
		os=-elf
1584
		os=-elf
1508
		;;
1585
		;;
1509
	mips*-cisco)
1586
	mips*-cisco)
Lines 1512-1517 Link Here
1512
	mips*-*)
1589
	mips*-*)
1513
		os=-elf
1590
		os=-elf
1514
		;;
1591
		;;
1592
	or1k-*)
1593
		os=-elf
1594
		;;
1515
	or32-*)
1595
	or32-*)
1516
		os=-coff
1596
		os=-coff
1517
		;;
1597
		;;
Lines 1530-1536 Link Here
1530
	*-ibm)
1610
	*-ibm)
1531
		os=-aix
1611
		os=-aix
1532
		;;
1612
		;;
1533
    	*-knuth)
1613
	*-knuth)
1534
		os=-mmixware
1614
		os=-mmixware
1535
		;;
1615
		;;
1536
	*-wec)
1616
	*-wec)
(-)contrib/tcsh/config_f.h (-3 / +7 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.47 2011/02/05 20:34:55 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.52 2016/04/16 15:44:18 christos Exp $ */
2
/*
2
/*
3
 * config_f.h -- configure various defines for tcsh
3
 * config_f.h -- configure various defines for tcsh
4
 *
4
 *
Lines 38-43 Link Here
38
#ifndef _h_config_f
38
#ifndef _h_config_f
39
#define _h_config_f
39
#define _h_config_f
40
40
41
#ifdef HAVE_FEATURES_H
42
#include <features.h>		/* for __GLIBC__ */
43
#endif
44
41
/*
45
/*
42
 * SHORT_STRINGS Use at least 16 bit characters instead of 8 bit chars
46
 * SHORT_STRINGS Use at least 16 bit characters instead of 8 bit chars
43
 * 	         This fixes up quoting problems and eases implementation
47
 * 	         This fixes up quoting problems and eases implementation
Lines 50-56 Link Here
50
 * WIDE_STRINGS	Represent strings using wide characters
54
 * WIDE_STRINGS	Represent strings using wide characters
51
 *		Allows proper function in multibyte encodings like UTF-8
55
 *		Allows proper function in multibyte encodings like UTF-8
52
 */
56
 */
53
#if defined (SHORT_STRINGS) && defined (NLS) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
57
#if defined (SHORT_STRINGS) && defined (NLS) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX) && SIZEOF_WCHAR_T > 1
54
# define WIDE_STRINGS
58
# define WIDE_STRINGS
55
# if SIZEOF_WCHAR_T < 4
59
# if SIZEOF_WCHAR_T < 4
56
#  define UTF16_STRINGS
60
#  define UTF16_STRINGS
Lines 135-141 Link Here
135
 *		This can be much slower and no memory statistics will be
139
 *		This can be much slower and no memory statistics will be
136
 *		provided.
140
 *		provided.
137
 */
141
 */
138
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__)
142
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__) || defined (__ANDROID__)
139
# define SYSMALLOC
143
# define SYSMALLOC
140
#else
144
#else
141
# undef SYSMALLOC
145
# undef SYSMALLOC
(-)contrib/tcsh/configure (-170 / +248 lines)
Lines 1-13 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# Guess values for system-dependent variables and create Makefiles.
2
# Guess values for system-dependent variables and create Makefiles.
3
# Generated by GNU Autoconf 2.68 for tcsh 6.18.01.
3
# Generated by GNU Autoconf 2.69 for tcsh 6.20.00.
4
#
4
#
5
# Report bugs to <http://bugs.gw.com/>.
5
# Report bugs to <http://bugs.gw.com/>.
6
#
6
#
7
#
7
#
8
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
8
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
10
# Foundation, Inc.
11
#
9
#
12
#
10
#
13
# This configure script is free software; the Free Software Foundation
11
# This configure script is free software; the Free Software Foundation
Lines 136-141 Link Here
136
# CDPATH.
134
# CDPATH.
137
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
135
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138
136
137
# Use a proper internal environment variable to ensure we don't fall
138
  # into an infinite loop, continuously re-executing ourselves.
139
  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
140
    _as_can_reexec=no; export _as_can_reexec;
141
    # We cannot yet assume a decent shell, so we have to provide a
142
# neutralization value for shells without unset; and this also
143
# works around shells that cannot unset nonexistent variables.
144
# Preserve -v and -x to the replacement shell.
145
BASH_ENV=/dev/null
146
ENV=/dev/null
147
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
148
case $- in # ((((
149
  *v*x* | *x*v* ) as_opts=-vx ;;
150
  *v* ) as_opts=-v ;;
151
  *x* ) as_opts=-x ;;
152
  * ) as_opts= ;;
153
esac
154
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
155
# Admittedly, this is quite paranoid, since all the known shells bail
156
# out after a failed `exec'.
157
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
158
as_fn_exit 255
159
  fi
160
  # We don't want this to propagate to other subprocesses.
161
          { _as_can_reexec=; unset _as_can_reexec;}
139
if test "x$CONFIG_SHELL" = x; then
162
if test "x$CONFIG_SHELL" = x; then
140
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
163
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
141
  emulate sh
164
  emulate sh
Lines 169-175 Link Here
169
else
192
else
170
  exitcode=1; echo positional parameters were not saved.
193
  exitcode=1; echo positional parameters were not saved.
171
fi
194
fi
172
test x\$exitcode = x0 || exit 1"
195
test x\$exitcode = x0 || exit 1
196
test -x / || exit 1"
173
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
197
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
174
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
198
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
175
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
199
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
Lines 214-234 Link Here
214
238
215
239
216
      if test "x$CONFIG_SHELL" != x; then :
240
      if test "x$CONFIG_SHELL" != x; then :
217
  # We cannot yet assume a decent shell, so we have to provide a
241
  export CONFIG_SHELL
218
	# neutralization value for shells without unset; and this also
242
             # We cannot yet assume a decent shell, so we have to provide a
219
	# works around shells that cannot unset nonexistent variables.
243
# neutralization value for shells without unset; and this also
220
	# Preserve -v and -x to the replacement shell.
244
# works around shells that cannot unset nonexistent variables.
221
	BASH_ENV=/dev/null
245
# Preserve -v and -x to the replacement shell.
222
	ENV=/dev/null
246
BASH_ENV=/dev/null
223
	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
247
ENV=/dev/null
224
	export CONFIG_SHELL
248
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
225
	case $- in # ((((
249
case $- in # ((((
226
	  *v*x* | *x*v* ) as_opts=-vx ;;
250
  *v*x* | *x*v* ) as_opts=-vx ;;
227
	  *v* ) as_opts=-v ;;
251
  *v* ) as_opts=-v ;;
228
	  *x* ) as_opts=-x ;;
252
  *x* ) as_opts=-x ;;
229
	  * ) as_opts= ;;
253
  * ) as_opts= ;;
230
	esac
254
esac
231
	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
255
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
256
# Admittedly, this is quite paranoid, since all the known shells bail
257
# out after a failed `exec'.
258
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
259
exit 255
232
fi
260
fi
233
261
234
    if test x$as_have_required = xno; then :
262
    if test x$as_have_required = xno; then :
Lines 331-336 Link Here
331
359
332
360
333
} # as_fn_mkdir_p
361
} # as_fn_mkdir_p
362
363
# as_fn_executable_p FILE
364
# -----------------------
365
# Test if FILE is an executable regular file.
366
as_fn_executable_p ()
367
{
368
  test -f "$1" && test -x "$1"
369
} # as_fn_executable_p
334
# as_fn_append VAR VALUE
370
# as_fn_append VAR VALUE
335
# ----------------------
371
# ----------------------
336
# Append the text in VALUE to the end of the definition contained in VAR. Take
372
# Append the text in VALUE to the end of the definition contained in VAR. Take
Lines 452-457 Link Here
452
  chmod +x "$as_me.lineno" ||
488
  chmod +x "$as_me.lineno" ||
453
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
489
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
454
490
491
  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
492
  # already done that, so ensure we don't try to do so again and fall
493
  # in an infinite loop.  This has already happened in practice.
494
  _as_can_reexec=no; export _as_can_reexec
455
  # Don't try to exec as it changes $[0], causing all sort of problems
495
  # Don't try to exec as it changes $[0], causing all sort of problems
456
  # (the dirname of $[0] is not the place where we might find the
496
  # (the dirname of $[0] is not the place where we might find the
457
  # original and so on.  Autoconf is especially sensitive to this).
497
  # original and so on.  Autoconf is especially sensitive to this).
Lines 486-501 Link Here
486
    # ... but there are two gotchas:
526
    # ... but there are two gotchas:
487
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
527
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
488
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
528
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
489
    # In both cases, we have to default to `cp -p'.
529
    # In both cases, we have to default to `cp -pR'.
490
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
530
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
491
      as_ln_s='cp -p'
531
      as_ln_s='cp -pR'
492
  elif ln conf$$.file conf$$ 2>/dev/null; then
532
  elif ln conf$$.file conf$$ 2>/dev/null; then
493
    as_ln_s=ln
533
    as_ln_s=ln
494
  else
534
  else
495
    as_ln_s='cp -p'
535
    as_ln_s='cp -pR'
496
  fi
536
  fi
497
else
537
else
498
  as_ln_s='cp -p'
538
  as_ln_s='cp -pR'
499
fi
539
fi
500
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
540
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
501
rmdir conf$$.dir 2>/dev/null
541
rmdir conf$$.dir 2>/dev/null
Lines 507-534 Link Here
507
  as_mkdir_p=false
547
  as_mkdir_p=false
508
fi
548
fi
509
549
510
if test -x / >/dev/null 2>&1; then
550
as_test_x='test -x'
511
  as_test_x='test -x'
551
as_executable_p=as_fn_executable_p
512
else
513
  if ls -dL / >/dev/null 2>&1; then
514
    as_ls_L_option=L
515
  else
516
    as_ls_L_option=
517
  fi
518
  as_test_x='
519
    eval sh -c '\''
520
      if test -d "$1"; then
521
	test -d "$1/.";
522
      else
523
	case $1 in #(
524
	-*)set "./$1";;
525
	esac;
526
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
527
	???[sx]*):;;*)false;;esac;fi
528
    '\'' sh
529
  '
530
fi
531
as_executable_p=$as_test_x
532
552
533
# Sed expression to map a string onto a valid CPP name.
553
# Sed expression to map a string onto a valid CPP name.
534
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
554
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
Lines 560-567 Link Here
560
# Identity of this package.
580
# Identity of this package.
561
PACKAGE_NAME='tcsh'
581
PACKAGE_NAME='tcsh'
562
PACKAGE_TARNAME='tcsh'
582
PACKAGE_TARNAME='tcsh'
563
PACKAGE_VERSION='6.18.01'
583
PACKAGE_VERSION='6.20.00'
564
PACKAGE_STRING='tcsh 6.18.01'
584
PACKAGE_STRING='tcsh 6.20.00'
565
PACKAGE_BUGREPORT='http://bugs.gw.com/'
585
PACKAGE_BUGREPORT='http://bugs.gw.com/'
566
PACKAGE_URL=''
586
PACKAGE_URL=''
567
587
Lines 1145-1152 Link Here
1145
if test "x$host_alias" != x; then
1165
if test "x$host_alias" != x; then
1146
  if test "x$build_alias" = x; then
1166
  if test "x$build_alias" = x; then
1147
    cross_compiling=maybe
1167
    cross_compiling=maybe
1148
    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1149
    If a cross compiler is detected then cross compile mode will be used" >&2
1150
  elif test "x$build_alias" != "x$host_alias"; then
1168
  elif test "x$build_alias" != "x$host_alias"; then
1151
    cross_compiling=yes
1169
    cross_compiling=yes
1152
  fi
1170
  fi
Lines 1232-1238 Link Here
1232
  # Omit some internal or obsolete options to make the list less imposing.
1250
  # Omit some internal or obsolete options to make the list less imposing.
1233
  # This message is too long to be a string in the A/UX 3.1 sh.
1251
  # This message is too long to be a string in the A/UX 3.1 sh.
1234
  cat <<_ACEOF
1252
  cat <<_ACEOF
1235
\`configure' configures tcsh 6.18.01 to adapt to many kinds of systems.
1253
\`configure' configures tcsh 6.20.00 to adapt to many kinds of systems.
1236
1254
1237
Usage: $0 [OPTION]... [VAR=VALUE]...
1255
Usage: $0 [OPTION]... [VAR=VALUE]...
1238
1256
Lines 1297-1303 Link Here
1297
1315
1298
if test -n "$ac_init_help"; then
1316
if test -n "$ac_init_help"; then
1299
  case $ac_init_help in
1317
  case $ac_init_help in
1300
     short | recursive ) echo "Configuration of tcsh 6.18.01:";;
1318
     short | recursive ) echo "Configuration of tcsh 6.20.00:";;
1301
   esac
1319
   esac
1302
  cat <<\_ACEOF
1320
  cat <<\_ACEOF
1303
1321
Lines 1312-1318 Link Here
1312
Optional Packages:
1330
Optional Packages:
1313
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1331
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1314
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1332
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1315
  --with-gnu-ld           assume the C compiler uses GNU ld default=no
1333
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1316
  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
1334
  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
1317
  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
1335
  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
1318
  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion
1336
  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion
Lines 1393-1402 Link Here
1393
test -n "$ac_init_help" && exit $ac_status
1411
test -n "$ac_init_help" && exit $ac_status
1394
if $ac_init_version; then
1412
if $ac_init_version; then
1395
  cat <<\_ACEOF
1413
  cat <<\_ACEOF
1396
tcsh configure 6.18.01
1414
tcsh configure 6.20.00
1397
generated by GNU Autoconf 2.68
1415
generated by GNU Autoconf 2.69
1398
1416
1399
Copyright (C) 2010 Free Software Foundation, Inc.
1417
Copyright (C) 2012 Free Software Foundation, Inc.
1400
This configure script is free software; the Free Software Foundation
1418
This configure script is free software; the Free Software Foundation
1401
gives unlimited permission to copy, distribute and modify it.
1419
gives unlimited permission to copy, distribute and modify it.
1402
_ACEOF
1420
_ACEOF
Lines 1509-1515 Link Here
1509
	 test ! -s conftest.err
1527
	 test ! -s conftest.err
1510
       } && test -s conftest$ac_exeext && {
1528
       } && test -s conftest$ac_exeext && {
1511
	 test "$cross_compiling" = yes ||
1529
	 test "$cross_compiling" = yes ||
1512
	 $as_test_x conftest$ac_exeext
1530
	 test -x conftest$ac_exeext
1513
       }; then :
1531
       }; then :
1514
  ac_retval=0
1532
  ac_retval=0
1515
else
1533
else
Lines 1709-1715 Link Here
1709
main ()
1727
main ()
1710
{
1728
{
1711
static int test_array [1 - 2 * !(($2) >= 0)];
1729
static int test_array [1 - 2 * !(($2) >= 0)];
1712
test_array [0] = 0
1730
test_array [0] = 0;
1731
return test_array [0];
1713
1732
1714
  ;
1733
  ;
1715
  return 0;
1734
  return 0;
Lines 1725-1731 Link Here
1725
main ()
1744
main ()
1726
{
1745
{
1727
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
1746
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
1728
test_array [0] = 0
1747
test_array [0] = 0;
1748
return test_array [0];
1729
1749
1730
  ;
1750
  ;
1731
  return 0;
1751
  return 0;
Lines 1751-1757 Link Here
1751
main ()
1771
main ()
1752
{
1772
{
1753
static int test_array [1 - 2 * !(($2) < 0)];
1773
static int test_array [1 - 2 * !(($2) < 0)];
1754
test_array [0] = 0
1774
test_array [0] = 0;
1775
return test_array [0];
1755
1776
1756
  ;
1777
  ;
1757
  return 0;
1778
  return 0;
Lines 1767-1773 Link Here
1767
main ()
1788
main ()
1768
{
1789
{
1769
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
1790
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
1770
test_array [0] = 0
1791
test_array [0] = 0;
1792
return test_array [0];
1771
1793
1772
  ;
1794
  ;
1773
  return 0;
1795
  return 0;
Lines 1801-1807 Link Here
1801
main ()
1823
main ()
1802
{
1824
{
1803
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
1825
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
1804
test_array [0] = 0
1826
test_array [0] = 0;
1827
return test_array [0];
1805
1828
1806
  ;
1829
  ;
1807
  return 0;
1830
  return 0;
Lines 1948-1954 Link Here
1948
main ()
1971
main ()
1949
{
1972
{
1950
static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
1973
static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
1951
test_array [0] = 0
1974
test_array [0] = 0;
1975
return test_array [0];
1952
1976
1953
  ;
1977
  ;
1954
  return 0;
1978
  return 0;
Lines 2150-2157 Link Here
2150
This file contains any messages produced by compilers while
2174
This file contains any messages produced by compilers while
2151
running configure, to aid debugging if configure makes a mistake.
2175
running configure, to aid debugging if configure makes a mistake.
2152
2176
2153
It was created by tcsh $as_me 6.18.01, which was
2177
It was created by tcsh $as_me 6.20.00, which was
2154
generated by GNU Autoconf 2.68.  Invocation command line was
2178
generated by GNU Autoconf 2.69.  Invocation command line was
2155
2179
2156
  $ $0 $@
2180
  $ $0 $@
2157
2181
Lines 2571-2577 Link Here
2571
    # by default.
2595
    # by default.
2572
    for ac_prog in ginstall scoinst install; do
2596
    for ac_prog in ginstall scoinst install; do
2573
      for ac_exec_ext in '' $ac_executable_extensions; do
2597
      for ac_exec_ext in '' $ac_executable_extensions; do
2574
	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2598
	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
2575
	  if test $ac_prog = install &&
2599
	  if test $ac_prog = install &&
2576
	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2600
	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2577
	    # AIX install.  It has an incompatible calling convention.
2601
	    # AIX install.  It has an incompatible calling convention.
Lines 2781-2786 Link Here
2781
    tcsh_config_file=sysV88
2805
    tcsh_config_file=sysV88
2782
  ;;
2806
  ;;
2783
2807
2808
  ## Minix systems
2809
  *-*-minix*)
2810
    tcsh_config_file=minix
2811
  ;;
2812
2784
  ## NetBSD systems
2813
  ## NetBSD systems
2785
  *-*-netbsd*)
2814
  *-*-netbsd*)
2786
    tcsh_config_file=bsd4.4
2815
    tcsh_config_file=bsd4.4
Lines 2801-2806 Link Here
2801
    tcsh_config_file=bsd4.4
2830
    tcsh_config_file=bsd4.4
2802
  ;;
2831
  ;;
2803
2832
2833
  ## MirBSD systems
2834
  *-*-mirbsd*)
2835
    tcsh_config_file=bsd4.4
2836
  ;;
2837
2804
  ## OpenBSD systems
2838
  ## OpenBSD systems
2805
  *-*-openbsd*)
2839
  *-*-openbsd*)
2806
    tcsh_config_file=bsd4.4
2840
    tcsh_config_file=bsd4.4
Lines 2975-2981 Link Here
2975
  IFS=$as_save_IFS
3009
  IFS=$as_save_IFS
2976
  test -z "$as_dir" && as_dir=.
3010
  test -z "$as_dir" && as_dir=.
2977
    for ac_exec_ext in '' $ac_executable_extensions; do
3011
    for ac_exec_ext in '' $ac_executable_extensions; do
2978
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3012
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2979
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
3013
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
2980
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3014
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2981
    break 2
3015
    break 2
Lines 3015-3021 Link Here
3015
  IFS=$as_save_IFS
3049
  IFS=$as_save_IFS
3016
  test -z "$as_dir" && as_dir=.
3050
  test -z "$as_dir" && as_dir=.
3017
    for ac_exec_ext in '' $ac_executable_extensions; do
3051
    for ac_exec_ext in '' $ac_executable_extensions; do
3018
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3052
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3019
    ac_cv_prog_ac_ct_CC="gcc"
3053
    ac_cv_prog_ac_ct_CC="gcc"
3020
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3054
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3021
    break 2
3055
    break 2
Lines 3068-3074 Link Here
3068
  IFS=$as_save_IFS
3102
  IFS=$as_save_IFS
3069
  test -z "$as_dir" && as_dir=.
3103
  test -z "$as_dir" && as_dir=.
3070
    for ac_exec_ext in '' $ac_executable_extensions; do
3104
    for ac_exec_ext in '' $ac_executable_extensions; do
3071
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3105
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3072
    ac_cv_prog_CC="${ac_tool_prefix}cc"
3106
    ac_cv_prog_CC="${ac_tool_prefix}cc"
3073
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3107
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3074
    break 2
3108
    break 2
Lines 3109-3115 Link Here
3109
  IFS=$as_save_IFS
3143
  IFS=$as_save_IFS
3110
  test -z "$as_dir" && as_dir=.
3144
  test -z "$as_dir" && as_dir=.
3111
    for ac_exec_ext in '' $ac_executable_extensions; do
3145
    for ac_exec_ext in '' $ac_executable_extensions; do
3112
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3146
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3113
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3147
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3114
       ac_prog_rejected=yes
3148
       ac_prog_rejected=yes
3115
       continue
3149
       continue
Lines 3167-3173 Link Here
3167
  IFS=$as_save_IFS
3201
  IFS=$as_save_IFS
3168
  test -z "$as_dir" && as_dir=.
3202
  test -z "$as_dir" && as_dir=.
3169
    for ac_exec_ext in '' $ac_executable_extensions; do
3203
    for ac_exec_ext in '' $ac_executable_extensions; do
3170
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3204
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3171
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3205
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3172
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3206
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3173
    break 2
3207
    break 2
Lines 3211-3217 Link Here
3211
  IFS=$as_save_IFS
3245
  IFS=$as_save_IFS
3212
  test -z "$as_dir" && as_dir=.
3246
  test -z "$as_dir" && as_dir=.
3213
    for ac_exec_ext in '' $ac_executable_extensions; do
3247
    for ac_exec_ext in '' $ac_executable_extensions; do
3214
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3248
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3215
    ac_cv_prog_ac_ct_CC="$ac_prog"
3249
    ac_cv_prog_ac_ct_CC="$ac_prog"
3216
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3250
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3217
    break 2
3251
    break 2
Lines 3657-3664 Link Here
3657
/* end confdefs.h.  */
3691
/* end confdefs.h.  */
3658
#include <stdarg.h>
3692
#include <stdarg.h>
3659
#include <stdio.h>
3693
#include <stdio.h>
3660
#include <sys/types.h>
3694
struct stat;
3661
#include <sys/stat.h>
3662
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3695
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3663
struct buf { int x; };
3696
struct buf { int x; };
3664
FILE * (*rcsopen) (struct buf *, struct stat *, int);
3697
FILE * (*rcsopen) (struct buf *, struct stat *, int);
Lines 3898-3904 Link Here
3898
    for ac_prog in grep ggrep; do
3931
    for ac_prog in grep ggrep; do
3899
    for ac_exec_ext in '' $ac_executable_extensions; do
3932
    for ac_exec_ext in '' $ac_executable_extensions; do
3900
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3933
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3901
      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
3934
      as_fn_executable_p "$ac_path_GREP" || continue
3902
# Check for GNU ac_path_GREP and select it if it is found.
3935
# Check for GNU ac_path_GREP and select it if it is found.
3903
  # Check for GNU $ac_path_GREP
3936
  # Check for GNU $ac_path_GREP
3904
case `"$ac_path_GREP" --version 2>&1` in
3937
case `"$ac_path_GREP" --version 2>&1` in
Lines 3964-3970 Link Here
3964
    for ac_prog in egrep; do
3997
    for ac_prog in egrep; do
3965
    for ac_exec_ext in '' $ac_executable_extensions; do
3998
    for ac_exec_ext in '' $ac_executable_extensions; do
3966
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
3999
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
3967
      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4000
      as_fn_executable_p "$ac_path_EGREP" || continue
3968
# Check for GNU ac_path_EGREP and select it if it is found.
4001
# Check for GNU ac_path_EGREP and select it if it is found.
3969
  # Check for GNU $ac_path_EGREP
4002
  # Check for GNU $ac_path_EGREP
3970
case `"$ac_path_EGREP" --version 2>&1` in
4003
case `"$ac_path_EGREP" --version 2>&1` in
Lines 4073-4079 Link Here
4073
  IFS=$as_save_IFS
4106
  IFS=$as_save_IFS
4074
  test -z "$as_dir" && as_dir=.
4107
  test -z "$as_dir" && as_dir=.
4075
    for ac_exec_ext in '' $ac_executable_extensions; do
4108
    for ac_exec_ext in '' $ac_executable_extensions; do
4076
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4109
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4077
    ac_cv_path_GENCAT="$as_dir/$ac_word$ac_exec_ext"
4110
    ac_cv_path_GENCAT="$as_dir/$ac_word$ac_exec_ext"
4078
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4111
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4079
    break 2
4112
    break 2
Lines 4108-4113 Link Here
4108
  CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
4141
  CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
4109
fi
4142
fi
4110
4143
4144
case "${host}" in
4145
  *-*-android*)
4146
    CFLAGS="${CFLAGS} -fPIE"
4147
    LDFLAGS="${LDFLAGS} -pie"
4148
    ;;
4149
esac
4150
4111
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
4151
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
4112
$as_echo_n "checking for library containing crypt... " >&6; }
4152
$as_echo_n "checking for library containing crypt... " >&6; }
4113
if ${ac_cv_search_crypt+:} false; then :
4153
if ${ac_cv_search_crypt+:} false; then :
Lines 4274-4279 Link Here
4274
if test "$ac_res" != no; then :
4314
if test "$ac_res" != no; then :
4275
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
4315
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
4276
4316
4317
else
4318
4319
   as_fn_error $? "unable to find the tgetent() function" "$LINENO" 5
4320
4277
fi
4321
fi
4278
4322
4279
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
4323
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
Lines 4461-4466 Link Here
4461
  prefix="$acl_save_prefix"
4505
  prefix="$acl_save_prefix"
4462
4506
4463
4507
4508
4464
# Check whether --with-gnu-ld was given.
4509
# Check whether --with-gnu-ld was given.
4465
if test "${with_gnu_ld+set}" = set; then :
4510
if test "${with_gnu_ld+set}" = set; then :
4466
  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4511
  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
Lines 4471-4491 Link Here
4471
# Prepare PATH_SEPARATOR.
4516
# Prepare PATH_SEPARATOR.
4472
# The user is always right.
4517
# The user is always right.
4473
if test "${PATH_SEPARATOR+set}" != set; then
4518
if test "${PATH_SEPARATOR+set}" != set; then
4474
  echo "#! /bin/sh" >conf$$.sh
4519
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
4475
  echo  "exit 0"   >>conf$$.sh
4520
  # contains only /bin. Note that ksh looks also at the FPATH variable,
4476
  chmod +x conf$$.sh
4521
  # so we have to set that as well for the test.
4477
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
4522
  PATH_SEPARATOR=:
4478
    PATH_SEPARATOR=';'
4523
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4479
  else
4524
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4480
    PATH_SEPARATOR=:
4525
           || PATH_SEPARATOR=';'
4481
  fi
4526
       }
4482
  rm -f conf$$.sh
4483
fi
4527
fi
4528
4484
ac_prog=ld
4529
ac_prog=ld
4485
if test "$GCC" = yes; then
4530
if test "$GCC" = yes; then
4486
  # Check if gcc -print-prog-name=ld gives a path.
4531
  # Check if gcc -print-prog-name=ld gives a path.
4487
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
4532
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4488
$as_echo_n "checking for ld used by GCC... " >&6; }
4533
$as_echo_n "checking for ld used by $CC... " >&6; }
4489
  case $host in
4534
  case $host in
4490
  *-*-mingw*)
4535
  *-*-mingw*)
4491
    # gcc leaves a trailing carriage return which upsets mingw
4536
    # gcc leaves a trailing carriage return which upsets mingw
Lines 4495-4505 Link Here
4495
  esac
4540
  esac
4496
  case $ac_prog in
4541
  case $ac_prog in
4497
    # Accept absolute paths.
4542
    # Accept absolute paths.
4498
    [\\/]* | [A-Za-z]:[\\/]*)
4543
    [\\/]* | ?:[\\/]*)
4499
      re_direlt='/[^/][^/]*/\.\./'
4544
      re_direlt='/[^/][^/]*/\.\./'
4500
      # Canonicalize the path of ld
4545
      # Canonicalize the pathname of ld
4501
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4546
      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
4502
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4547
      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
4503
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4548
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4504
      done
4549
      done
4505
      test -z "$LD" && LD="$ac_prog"
4550
      test -z "$LD" && LD="$ac_prog"
Lines 4524-4546 Link Here
4524
  $as_echo_n "(cached) " >&6
4569
  $as_echo_n "(cached) " >&6
4525
else
4570
else
4526
  if test -z "$LD"; then
4571
  if test -z "$LD"; then
4527
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4572
  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4528
  for ac_dir in $PATH; do
4573
  for ac_dir in $PATH; do
4574
    IFS="$acl_save_ifs"
4529
    test -z "$ac_dir" && ac_dir=.
4575
    test -z "$ac_dir" && ac_dir=.
4530
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4576
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4531
      acl_cv_path_LD="$ac_dir/$ac_prog"
4577
      acl_cv_path_LD="$ac_dir/$ac_prog"
4532
      # Check to see if the program is GNU ld.  I'd rather use --version,
4578
      # Check to see if the program is GNU ld.  I'd rather use --version,
4533
      # but apparently some GNU ld's only accept -v.
4579
      # but apparently some variants of GNU ld only accept -v.
4534
      # Break only if it was the GNU/non-GNU ld that we prefer.
4580
      # Break only if it was the GNU/non-GNU ld that we prefer.
4535
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
4581
      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
4536
      *GNU* | *'with BFD'*)
4582
      *GNU* | *'with BFD'*)
4537
        test "$with_gnu_ld" != no && break ;;
4583
        test "$with_gnu_ld" != no && break
4584
        ;;
4538
      *)
4585
      *)
4539
        test "$with_gnu_ld" != yes && break ;;
4586
        test "$with_gnu_ld" != yes && break
4587
        ;;
4540
      esac
4588
      esac
4541
    fi
4589
    fi
4542
  done
4590
  done
4543
  IFS="$ac_save_ifs"
4591
  IFS="$acl_save_ifs"
4544
else
4592
else
4545
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
4593
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
4546
fi
4594
fi
Lines 4560-4571 Link Here
4560
if ${acl_cv_prog_gnu_ld+:} false; then :
4608
if ${acl_cv_prog_gnu_ld+:} false; then :
4561
  $as_echo_n "(cached) " >&6
4609
  $as_echo_n "(cached) " >&6
4562
else
4610
else
4563
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
4611
  # I'd rather use --version here, but apparently some GNU lds only accept -v.
4564
case `$LD -v 2>&1 </dev/null` in
4612
case `$LD -v 2>&1 </dev/null` in
4565
*GNU* | *'with BFD'*)
4613
*GNU* | *'with BFD'*)
4566
  acl_cv_prog_gnu_ld=yes ;;
4614
  acl_cv_prog_gnu_ld=yes
4615
  ;;
4567
*)
4616
*)
4568
  acl_cv_prog_gnu_ld=no ;;
4617
  acl_cv_prog_gnu_ld=no
4618
  ;;
4569
esac
4619
esac
4570
fi
4620
fi
4571
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
4621
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
Lines 4748-4754 Link Here
4748
      done
4798
      done
4749
      if test -z "$already_handled"; then
4799
      if test -z "$already_handled"; then
4750
        names_already_handled="$names_already_handled $name"
4800
        names_already_handled="$names_already_handled $name"
4751
                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4801
                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
4752
        eval value=\"\$HAVE_LIB$uppername\"
4802
        eval value=\"\$HAVE_LIB$uppername\"
4753
        if test -n "$value"; then
4803
        if test -n "$value"; then
4754
          if test "$value" = yes; then
4804
          if test "$value" = yes; then
Lines 5176-5189 Link Here
5176
    am_cv_lib_iconv=no
5226
    am_cv_lib_iconv=no
5177
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5227
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5178
/* end confdefs.h.  */
5228
/* end confdefs.h.  */
5229
5179
#include <stdlib.h>
5230
#include <stdlib.h>
5180
#include <iconv.h>
5231
#include <iconv.h>
5232
5181
int
5233
int
5182
main ()
5234
main ()
5183
{
5235
{
5184
iconv_t cd = iconv_open("","");
5236
iconv_t cd = iconv_open("","");
5185
       iconv(cd,NULL,NULL,NULL,NULL);
5237
           iconv(cd,NULL,NULL,NULL,NULL);
5186
       iconv_close(cd);
5238
           iconv_close(cd);
5187
  ;
5239
  ;
5188
  return 0;
5240
  return 0;
5189
}
5241
}
Lines 5198-5211 Link Here
5198
      LIBS="$LIBS $LIBICONV"
5250
      LIBS="$LIBS $LIBICONV"
5199
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5251
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5200
/* end confdefs.h.  */
5252
/* end confdefs.h.  */
5253
5201
#include <stdlib.h>
5254
#include <stdlib.h>
5202
#include <iconv.h>
5255
#include <iconv.h>
5256
5203
int
5257
int
5204
main ()
5258
main ()
5205
{
5259
{
5206
iconv_t cd = iconv_open("","");
5260
iconv_t cd = iconv_open("","");
5207
         iconv(cd,NULL,NULL,NULL,NULL);
5261
             iconv(cd,NULL,NULL,NULL,NULL);
5208
         iconv_close(cd);
5262
             iconv_close(cd);
5209
  ;
5263
  ;
5210
  return 0;
5264
  return 0;
5211
}
5265
}
Lines 5229-5243 Link Here
5229
  $as_echo_n "(cached) " >&6
5283
  $as_echo_n "(cached) " >&6
5230
else
5284
else
5231
5285
5232
            am_save_LIBS="$LIBS"
5286
                  am_save_LIBS="$LIBS"
5233
      if test $am_cv_lib_iconv = yes; then
5287
      if test $am_cv_lib_iconv = yes; then
5234
        LIBS="$LIBS $LIBICONV"
5288
        LIBS="$LIBS $LIBICONV"
5235
      fi
5289
      fi
5236
      if test "$cross_compiling" = yes; then :
5290
      am_cv_func_iconv_works=no
5291
      for ac_iconv_const in '' 'const'; do
5292
        if test "$cross_compiling" = yes; then :
5237
  case "$host_os" in
5293
  case "$host_os" in
5238
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
5294
             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
5239
           *)            am_cv_func_iconv_works="guessing yes" ;;
5295
             *)            am_cv_func_iconv_works="guessing yes" ;;
5240
         esac
5296
           esac
5241
else
5297
else
5242
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5298
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5243
/* end confdefs.h.  */
5299
/* end confdefs.h.  */
Lines 5244-5251 Link Here
5244
5300
5245
#include <iconv.h>
5301
#include <iconv.h>
5246
#include <string.h>
5302
#include <string.h>
5247
int main ()
5303
5304
#ifndef ICONV_CONST
5305
# define ICONV_CONST $ac_iconv_const
5306
#endif
5307
5308
int
5309
main ()
5248
{
5310
{
5311
int result = 0;
5249
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
5312
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
5250
     returns.  */
5313
     returns.  */
5251
  {
5314
  {
Lines 5252-5268 Link Here
5252
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
5315
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
5253
    if (cd_utf8_to_88591 != (iconv_t)(-1))
5316
    if (cd_utf8_to_88591 != (iconv_t)(-1))
5254
      {
5317
      {
5255
        static const char input[] = "\342\202\254"; /* EURO SIGN */
5318
        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
5256
        char buf[10];
5319
        char buf[10];
5257
        const char *inptr = input;
5320
        ICONV_CONST char *inptr = input;
5258
        size_t inbytesleft = strlen (input);
5321
        size_t inbytesleft = strlen (input);
5259
        char *outptr = buf;
5322
        char *outptr = buf;
5260
        size_t outbytesleft = sizeof (buf);
5323
        size_t outbytesleft = sizeof (buf);
5261
        size_t res = iconv (cd_utf8_to_88591,
5324
        size_t res = iconv (cd_utf8_to_88591,
5262
                            (char **) &inptr, &inbytesleft,
5325
                            &inptr, &inbytesleft,
5263
                            &outptr, &outbytesleft);
5326
                            &outptr, &outbytesleft);
5264
        if (res == 0)
5327
        if (res == 0)
5265
          return 1;
5328
          result |= 1;
5329
        iconv_close (cd_utf8_to_88591);
5266
      }
5330
      }
5267
  }
5331
  }
5268
  /* Test against Solaris 10 bug: Failures are not distinguishable from
5332
  /* Test against Solaris 10 bug: Failures are not distinguishable from
Lines 5271-5289 Link Here
5271
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
5335
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
5272
    if (cd_ascii_to_88591 != (iconv_t)(-1))
5336
    if (cd_ascii_to_88591 != (iconv_t)(-1))
5273
      {
5337
      {
5274
        static const char input[] = "\263";
5338
        static ICONV_CONST char input[] = "\263";
5275
        char buf[10];
5339
        char buf[10];
5276
        const char *inptr = input;
5340
        ICONV_CONST char *inptr = input;
5277
        size_t inbytesleft = strlen (input);
5341
        size_t inbytesleft = strlen (input);
5278
        char *outptr = buf;
5342
        char *outptr = buf;
5279
        size_t outbytesleft = sizeof (buf);
5343
        size_t outbytesleft = sizeof (buf);
5280
        size_t res = iconv (cd_ascii_to_88591,
5344
        size_t res = iconv (cd_ascii_to_88591,
5281
                            (char **) &inptr, &inbytesleft,
5345
                            &inptr, &inbytesleft,
5282
                            &outptr, &outbytesleft);
5346
                            &outptr, &outbytesleft);
5283
        if (res == 0)
5347
        if (res == 0)
5284
          return 1;
5348
          result |= 2;
5349
        iconv_close (cd_ascii_to_88591);
5285
      }
5350
      }
5286
  }
5351
  }
5352
  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
5353
  {
5354
    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
5355
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5356
      {
5357
        static ICONV_CONST char input[] = "\304";
5358
        static char buf[2] = { (char)0xDE, (char)0xAD };
5359
        ICONV_CONST char *inptr = input;
5360
        size_t inbytesleft = 1;
5361
        char *outptr = buf;
5362
        size_t outbytesleft = 1;
5363
        size_t res = iconv (cd_88591_to_utf8,
5364
                            &inptr, &inbytesleft,
5365
                            &outptr, &outbytesleft);
5366
        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
5367
          result |= 4;
5368
        iconv_close (cd_88591_to_utf8);
5369
      }
5370
  }
5287
#if 0 /* This bug could be worked around by the caller.  */
5371
#if 0 /* This bug could be worked around by the caller.  */
5288
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
5372
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
5289
  {
5373
  {
Lines 5290-5306 Link Here
5290
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
5374
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
5291
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5375
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5292
      {
5376
      {
5293
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
5377
        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
5294
        char buf[50];
5378
        char buf[50];
5295
        const char *inptr = input;
5379
        ICONV_CONST char *inptr = input;
5296
        size_t inbytesleft = strlen (input);
5380
        size_t inbytesleft = strlen (input);
5297
        char *outptr = buf;
5381
        char *outptr = buf;
5298
        size_t outbytesleft = sizeof (buf);
5382
        size_t outbytesleft = sizeof (buf);
5299
        size_t res = iconv (cd_88591_to_utf8,
5383
        size_t res = iconv (cd_88591_to_utf8,
5300
                            (char **) &inptr, &inbytesleft,
5384
                            &inptr, &inbytesleft,
5301
                            &outptr, &outbytesleft);
5385
                            &outptr, &outbytesleft);
5302
        if ((int)res > 0)
5386
        if ((int)res > 0)
5303
          return 1;
5387
          result |= 8;
5388
        iconv_close (cd_88591_to_utf8);
5304
      }
5389
      }
5305
  }
5390
  }
5306
#endif
5391
#endif
Lines 5314-5332 Link Here
5314
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
5399
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
5315
      /* Try HP-UX names.  */
5400
      /* Try HP-UX names.  */
5316
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
5401
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
5317
    return 1;
5402
    result |= 16;
5403
  return result;
5404
5405
  ;
5318
  return 0;
5406
  return 0;
5319
}
5407
}
5320
_ACEOF
5408
_ACEOF
5321
if ac_fn_c_try_run "$LINENO"; then :
5409
if ac_fn_c_try_run "$LINENO"; then :
5322
  am_cv_func_iconv_works=yes
5410
  am_cv_func_iconv_works=yes
5323
else
5324
  am_cv_func_iconv_works=no
5325
fi
5411
fi
5326
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5412
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5327
  conftest.$ac_objext conftest.beam conftest.$ac_ext
5413
  conftest.$ac_objext conftest.beam conftest.$ac_ext
5328
fi
5414
fi
5329
5415
5416
        test "$am_cv_func_iconv_works" = no || break
5417
      done
5330
      LIBS="$am_save_LIBS"
5418
      LIBS="$am_save_LIBS"
5331
5419
5332
fi
5420
fi
Lines 5373-5379 Link Here
5373
#ifdef __cplusplus
5461
#ifdef __cplusplus
5374
"C"
5462
"C"
5375
#endif
5463
#endif
5376
#if defined(__STDC__) || defined(__cplusplus)
5464
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
5377
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5465
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5378
#else
5466
#else
5379
size_t iconv();
5467
size_t iconv();
Lines 5406-5411 Link Here
5406
#define ICONV_CONST $am_cv_proto_iconv_arg1
5494
#define ICONV_CONST $am_cv_proto_iconv_arg1
5407
_ACEOF
5495
_ACEOF
5408
5496
5497
5409
  fi
5498
  fi
5410
5499
5411
5500
Lines 6303-6313 Link Here
6303
int
6392
int
6304
main ()
6393
main ()
6305
{
6394
{
6306
/* FIXME: Include the comments suggested by Paul. */
6395
6307
#ifndef __cplusplus
6396
#ifndef __cplusplus
6308
  /* Ultrix mips cc rejects this.  */
6397
  /* Ultrix mips cc rejects this sort of thing.  */
6309
  typedef int charset[2];
6398
  typedef int charset[2];
6310
  const charset cs;
6399
  const charset cs = { 0, 0 };
6311
  /* SunOS 4.1.1 cc rejects this.  */
6400
  /* SunOS 4.1.1 cc rejects this.  */
6312
  char const *const *pcpcc;
6401
  char const *const *pcpcc;
6313
  char **ppc;
6402
  char **ppc;
Lines 6324-6331 Link Here
6324
  ++pcpcc;
6413
  ++pcpcc;
6325
  ppc = (char**) pcpcc;
6414
  ppc = (char**) pcpcc;
6326
  pcpcc = (char const *const *) ppc;
6415
  pcpcc = (char const *const *) ppc;
6327
  { /* SCO 3.2v4 cc rejects this.  */
6416
  { /* SCO 3.2v4 cc rejects this sort of thing.  */
6328
    char *t;
6417
    char tx;
6418
    char *t = &tx;
6329
    char const *s = 0 ? (char *) 0 : (char const *) 0;
6419
    char const *s = 0 ? (char *) 0 : (char const *) 0;
6330
6420
6331
    *t++ = 0;
6421
    *t++ = 0;
Lines 6341-6350 Link Here
6341
    iptr p = 0;
6431
    iptr p = 0;
6342
    ++p;
6432
    ++p;
6343
  }
6433
  }
6344
  { /* AIX XL C 1.02.0.0 rejects this saying
6434
  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
6345
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
6435
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
6346
    struct s { int j; const int *ap[3]; };
6436
    struct s { int j; const int *ap[3]; } bx;
6347
    struct s *b; b->j = 5;
6437
    struct s *b = &bx; b->j = 5;
6348
  }
6438
  }
6349
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6439
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6350
    const int foo = 10;
6440
    const int foo = 10;
Lines 6486-6492 Link Here
6486
  have_catgets=no
6576
  have_catgets=no
6487
fi
6577
fi
6488
6578
6489
for ac_func in dup2 getauthid getcwd gethostname getpwent 	getutent getutxent mallinfo memmove memset mkstemp nice 	nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth
6579
for ac_func in dup2 getauthid getcwd gethostname getpwent 	getutent getutxent mallinfo mblen memmove memset mkstemp nice 	nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth
6490
do :
6580
do :
6491
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6581
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6492
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
6582
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Lines 7161-7176 Link Here
7161
    # ... but there are two gotchas:
7251
    # ... but there are two gotchas:
7162
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
7252
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
7163
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
7253
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
7164
    # In both cases, we have to default to `cp -p'.
7254
    # In both cases, we have to default to `cp -pR'.
7165
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
7255
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
7166
      as_ln_s='cp -p'
7256
      as_ln_s='cp -pR'
7167
  elif ln conf$$.file conf$$ 2>/dev/null; then
7257
  elif ln conf$$.file conf$$ 2>/dev/null; then
7168
    as_ln_s=ln
7258
    as_ln_s=ln
7169
  else
7259
  else
7170
    as_ln_s='cp -p'
7260
    as_ln_s='cp -pR'
7171
  fi
7261
  fi
7172
else
7262
else
7173
  as_ln_s='cp -p'
7263
  as_ln_s='cp -pR'
7174
fi
7264
fi
7175
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
7265
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
7176
rmdir conf$$.dir 2>/dev/null
7266
rmdir conf$$.dir 2>/dev/null
Lines 7230-7258 Link Here
7230
  as_mkdir_p=false
7320
  as_mkdir_p=false
7231
fi
7321
fi
7232
7322
7233
if test -x / >/dev/null 2>&1; then
7234
  as_test_x='test -x'
7235
else
7236
  if ls -dL / >/dev/null 2>&1; then
7237
    as_ls_L_option=L
7238
  else
7239
    as_ls_L_option=
7240
  fi
7241
  as_test_x='
7242
    eval sh -c '\''
7243
      if test -d "$1"; then
7244
	test -d "$1/.";
7245
      else
7246
	case $1 in #(
7247
	-*)set "./$1";;
7248
	esac;
7249
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
7250
	???[sx]*):;;*)false;;esac;fi
7251
    '\'' sh
7252
  '
7253
fi
7254
as_executable_p=$as_test_x
7255
7323
7324
# as_fn_executable_p FILE
7325
# -----------------------
7326
# Test if FILE is an executable regular file.
7327
as_fn_executable_p ()
7328
{
7329
  test -f "$1" && test -x "$1"
7330
} # as_fn_executable_p
7331
as_test_x='test -x'
7332
as_executable_p=as_fn_executable_p
7333
7256
# Sed expression to map a string onto a valid CPP name.
7334
# Sed expression to map a string onto a valid CPP name.
7257
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
7335
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
7258
7336
Lines 7272-7279 Link Here
7272
# report actual input values of CONFIG_FILES etc. instead of their
7350
# report actual input values of CONFIG_FILES etc. instead of their
7273
# values after options handling.
7351
# values after options handling.
7274
ac_log="
7352
ac_log="
7275
This file was extended by tcsh $as_me 6.18.01, which was
7353
This file was extended by tcsh $as_me 6.20.00, which was
7276
generated by GNU Autoconf 2.68.  Invocation command line was
7354
generated by GNU Autoconf 2.69.  Invocation command line was
7277
7355
7278
  CONFIG_FILES    = $CONFIG_FILES
7356
  CONFIG_FILES    = $CONFIG_FILES
7279
  CONFIG_HEADERS  = $CONFIG_HEADERS
7357
  CONFIG_HEADERS  = $CONFIG_HEADERS
Lines 7338-7348 Link Here
7338
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7416
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7339
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
7417
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
7340
ac_cs_version="\\
7418
ac_cs_version="\\
7341
tcsh config.status 6.18.01
7419
tcsh config.status 6.20.00
7342
configured by $0, generated by GNU Autoconf 2.68,
7420
configured by $0, generated by GNU Autoconf 2.69,
7343
  with options \\"\$ac_cs_config\\"
7421
  with options \\"\$ac_cs_config\\"
7344
7422
7345
Copyright (C) 2010 Free Software Foundation, Inc.
7423
Copyright (C) 2012 Free Software Foundation, Inc.
7346
This config.status script is free software; the Free Software Foundation
7424
This config.status script is free software; the Free Software Foundation
7347
gives unlimited permission to copy, distribute and modify it."
7425
gives unlimited permission to copy, distribute and modify it."
7348
7426
Lines 7431-7437 Link Here
7431
_ACEOF
7509
_ACEOF
7432
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7510
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7433
if \$ac_cs_recheck; then
7511
if \$ac_cs_recheck; then
7434
  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
7512
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
7435
  shift
7513
  shift
7436
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
7514
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
7437
  CONFIG_SHELL='$SHELL'
7515
  CONFIG_SHELL='$SHELL'
Lines 8027-8033 Link Here
8027
    "./atconfig":C) cat >./atconfig <<ATEOF
8105
    "./atconfig":C) cat >./atconfig <<ATEOF
8028
# Configurable variable values for building test suites.
8106
# Configurable variable values for building test suites.
8029
# Generated by $0.
8107
# Generated by $0.
8030
# Copyright (C) 2010 Free Software Foundation, Inc.
8108
# Copyright (C) 2012 Free Software Foundation, Inc.
8031
8109
8032
# The test suite will define top_srcdir=$at_top_srcdir/../.. etc.
8110
# The test suite will define top_srcdir=$at_top_srcdir/../.. etc.
8033
at_testdir='.'
8111
at_testdir='.'
(-)contrib/tcsh/configure.ac (+505 lines)
Line 0 Link Here
1
dnl Autoconf script for tcsh
2
dnl To rebuild the `configure' script from this, execute the command
3
dnl 	autoconf
4
dnl in the directory containing this script.
5
dnl
6
dnl You'll also need a version of config.guess from a gnu package
7
dnl
8
dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
9
dnl
10
dnl $tcsh: configure.ac,v 3.10 2016/11/24 15:04:52 christos Exp $
11
12
AC_PREREQ([2.59])dnl Minimum Autoconf version required.
13
AC_INIT([tcsh], [6.20.00], [http://bugs.gw.com/])
14
AC_CONFIG_MACRO_DIR([m4])
15
AC_CONFIG_SRCDIR([tc.vers.c])
16
AC_CONFIG_HEADERS([config.h])
17
AC_CONFIG_TESTDIR([.], [.])
18
19
AC_PROG_INSTALL
20
AC_CANONICAL_HOST
21
22
AC_MSG_CHECKING([cached host tuple])
23
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
24
     test x"$ac_cv_host_system_type" != x"$host"; }; then
25
  AC_MSG_RESULT([different])
26
  AC_MSG_ERROR([remove config.cache and re-run configure])
27
else
28
  AC_MSG_RESULT(ok)
29
fi
30
ac_cv_host_system_type="$host"
31
32
33
changequote(, )dnl
34
35
case "${host}" in
36
37
  ## Alpha (DEC) machines.
38
  alpha*-dec-osf* )
39
    tcsh_config_file=decosf1
40
  ;;
41
42
  ## Ultrix
43
  *-dec-ultrix* )
44
    tcsh_config_file=ultrix
45
  ;;
46
47
  ## DGUX
48
  *-dg-dguxR4* )
49
    tcsh_config_file=dgux5.4
50
  ;;
51
  m88k-dg-dgux5.4R* )
52
    tcsh_config_file=dgux5.4
53
  ;;
54
55
  ## HP/UX
56
  *-hp-hpux7* )
57
    tcsh_config_file=hpux7
58
  ;;
59
  *-hp-hpux[89]* )
60
    tcsh_config_file=hpux8
61
  ;;
62
  *-hp-hpux1[0-9]* )
63
    tcsh_config_file=hpux11
64
  ;;
65
66
  ## IBM AIX systems
67
  *-ibm-aix*)
68
    tcsh_config_file=aix
69
  ;;
70
71
  ## SX-4
72
  sx4-nec-*)
73
    CC='cc -h0,ansi,novector,float0'
74
    LDFLAGS='-Gsmall'
75
    tcsh_config_file=superux8
76
  ;;
77
78
  ## IBM OS/390 systems
79
  *-ibm-os390*)
80
    CC='c89'
81
    tcsh_config_file=os390
82
  ;;
83
84
  ## Android
85
  *-*-android*)
86
    tcsh_config_file=android
87
  ;;
88
89
  ## Linux
90
  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
91
    tcsh_config_file=linux
92
  ;;
93
94
  ## Motorola systems
95
  m68k-motorola-sysv* )
96
    tcsh_config_file=sysV68
97
  ;;
98
  m88k-motorola-sysv3* )
99
    tcsh_config_file=sysV88
100
  ;;
101
102
  ## Minix systems
103
  *-*-minix*)
104
    tcsh_config_file=minix
105
  ;;
106
107
  ## NetBSD systems
108
  *-*-netbsd*)
109
    tcsh_config_file=bsd4.4
110
  ;;
111
112
  ## FreeBSD systems
113
  *-*-freebsd*)
114
    tcsh_config_file=bsd4.4
115
  ;;
116
117
  ## MidnightBSD systems
118
  *-*-midnightbsd*)
119
    tcsh_config_file=bsd4.4
120
  ;;
121
  
122
  ## DragonFlyBSD systems
123
  *-*-dragonfly*)
124
    tcsh_config_file=bsd4.4
125
  ;;
126
127
  ## MirBSD systems
128
  *-*-mirbsd*)
129
    tcsh_config_file=bsd4.4
130
  ;;
131
132
  ## OpenBSD systems
133
  *-*-openbsd*)
134
    tcsh_config_file=bsd4.4
135
  ;;
136
137
  ## BSDI systems
138
  *-*-bsdi*)
139
    tcsh_config_file=bsd4.4
140
  ;;
141
142
  ## Mac OS X Server
143
  *-*-rhapsody* )
144
    tcsh_config_file=bsd4.4
145
  ;;
146
147
  ## Mac OS X Server
148
  *-*-darwin* )
149
    tcsh_config_file=bsd4.4
150
  ;;
151
152
  ## DragonFly systems
153
  *-*-dragonfly*)
154
    tcsh_config_file=bsd4.4
155
  ;;
156
157
  ## Silicon Graphics machines
158
  *-sgi-iri* )
159
    tcsh_config_file=irix
160
    case "${host_os}" in
161
      irix[34]*) # Irix-3.x - Irix 4.x
162
        NON_GNU_DFLAGS='-D__STDC__'
163
        LIBS='-lsun -lbsd -lc_s'
164
      ;;
165
      irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
166
        LIBS='-lbsd'
167
      ;;
168
      irix6.[2-9]*) # Irix 6.2 and later
169
	tcsh_config_file=irix62
170
      ;;
171
    esac
172
  ;;
173
174
  ## Suns
175
  *-sun-sunos3* )
176
    tcsh_config_file=sunos35
177
  ;;
178
  *-sun-sunos4.0* )
179
    tcsh_config_file=sunos40
180
  ;;
181
  *-sun-sunos4.1.[12]* )
182
    tcsh_config_file=sunos41
183
  ;;
184
  *-sun-sunos4.1.[3456]* )
185
    tcsh_config_file=sunos413
186
  ;;
187
  *-*-solaris2.[01] ) # Should handle sparc or x86
188
    tcsh_config_file=sol2
189
  ;;
190
  *-sun-solaris2.2 ) # Sparc only release
191
    tcsh_config_file=sol22
192
  ;;
193
  *-sun-solaris2.3 ) # Sparc only release
194
    tcsh_config_file=sol23
195
  ;;
196
  *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
197
    tcsh_config_file=sol24
198
  ;;
199
  *-*-solaris2.[678] ) # Should handle sparc, x86 and powerpc
200
    tcsh_config_file=sol26
201
  ;;
202
  *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
203
    tcsh_config_file=sol29
204
  ;;
205
206
  ## Dell SVR4
207
  *-dell-sysv4* )
208
    tcsh_config_file=sysv4
209
    DFLAGS="$DFLAGS -DDELL"
210
  ;;
211
212
  ## SVR4 (Generic and otherwise)
213
  *-*-sysv4* )
214
    tcsh_config_file=sysv4
215
  ;;
216
217
  ## Tektronix systems
218
  m68k-tektronix-bsd* )
219
    tcsh_config_file=bsd
220
    NON_GNU_DFLAGS='-DBSD -DUTek'
221
  ;;
222
  m88k-tektronix-sysv3* )
223
    tcsh_config_file=tekXD88
224
  ;;
225
226
  ## SCO
227
  *-sco3.2v5*) 
228
    tcsh_config_file=sco32v5
229
  ;;
230
  *-sco3.2v4*)
231
    tcsh_config_file=sco32v4
232
  ;;
233
  *-sco3.2v2*)
234
    tcsh_config_file=sco32v2
235
  ;;
236
237
  ## Siemens BS2000 Mainframe
238
  bs2000-siemens-*)
239
    tcsh_config_file=bs2000
240
  ;;
241
242
  ## Convex
243
  *-convex*)
244
    tcsh_config_file=convex
245
  ;;
246
247
  ## Cray
248
  *-cray-unicos*)
249
    tcsh_config_file=cray
250
  ;;
251
252
  ## Red Hat Cygwin
253
  *-cygwin)
254
    tcsh_config_file=cygwin
255
  ;;
256
257
  ## mips-compaq-nonstopux
258
  *-*-nonstopux)
259
    tcsh_config_file=sysv4
260
  ;;
261
262
  ## Apollo Domain/OS
263
  *-apollo-*)
264
    tcsh_config_file=apollo
265
  ;;
266
267
  ## QNX6
268
  *-qnx6*)
269
    tcsh_config_file=qnx6
270
  ;;
271
272
  * )
273
  changequote([, ])dnl
274
  AC_MSG_ERROR([Tcsh can't guess the configuration file name
275
for `${host}' systems.
276
Check tcsh's `Ported' file for manual configuration instructions.])
277
  changequote(, )dnl
278
  ;;
279
280
esac
281
282
echo "Tcsh will use configuration file \`$tcsh_config_file'."
283
changequote([, ])dnl
284
cp ${srcdir}/config/${tcsh_config_file} config_p.h
285
AH_BOTTOM(
286
[#include "config_p.h"
287
#include "config_f.h"])
288
289
dnl Checks for programs
290
AC_PROG_CC
291
AC_PROG_CPP
292
AC_PROG_GCC_TRADITIONAL
293
294
AC_PATH_PROG([GENCAT], [gencat]) 
295
296
dnl Require build CC to create gethost helper when cross building
297
if test "x${cross_compiling}" = xyes ; then
298
  CC_FOR_GETHOST="cc"
299
else
300
  CC_FOR_GETHOST="\$(CC)"
301
fi
302
AC_SUBST(CC_FOR_GETHOST)
303
304
if test "x$GCC" != xyes ; then
305
  DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
306
  CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
307
fi
308
309
dnl More recent Android requires PIEs
310
case "${host}" in
311
  *-*-android*)
312
    CFLAGS="${CFLAGS} -fPIE"
313
    LDFLAGS="${LDFLAGS} -pie"
314
    ;;
315
esac
316
317
dnl Checks for libraries
318
AC_SEARCH_LIBS(crypt, crypt)
319
AC_SEARCH_LIBS(getspnam, sec)
320
AC_SEARCH_LIBS([tgetent], [termlib termcap curses ncurses], [], [
321
   AC_MSG_ERROR([unable to find the tgetent() function])
322
])
323
AC_SEARCH_LIBS(gethostbyname, nsl)
324
AC_SEARCH_LIBS(connect, socket)
325
AC_SEARCH_LIBS(catgets, catgets)
326
AM_ICONV
327
328
dnl Checks for header files
329
AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl
330
		 [shadow.h stdint.h utmp.h utmpx.h])
331
AC_CHECK_HEADERS([wchar.h],
332
	[AC_CHECK_SIZEOF([wchar_t], [], [dnl
333
#include <stdio.h>
334
#include <wchar.h>])
335
	AC_CHECK_HEADERS([wctype.h])])
336
AC_HEADER_DIRENT
337
AC_HEADER_STAT
338
AC_HEADER_STDC
339
340
dnl Checks for types
341
AC_CHECK_TYPES([long long])
342
AC_TYPE_GETGROUPS
343
AC_TYPE_MODE_T
344
AC_TYPE_SIZE_T
345
AC_TYPE_UID_T
346
AC_TYPE_UINT32_T
347
348
AC_DEFUN([AC_TYPE_SSIZE_T], [
349
AC_CHECK_TYPE(ssize_t,,
350
AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
351
[
352
#include <sys/types.h>
353
])
354
])
355
AC_TYPE_SSIZE_T
356
357
AC_DEFUN([AC_TYPE_SOCKLEN_T], [
358
AC_CHECK_TYPE(socklen_t,,
359
AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
360
[
361
#include <sys/types.h>
362
#include <sys/socket.h>
363
])
364
])
365
AC_TYPE_SOCKLEN_T
366
367
368
dnl Checks for structures
369
AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
370
[#ifdef HAVE_DIRENT_H
371
# include <dirent.h>
372
#else
373
# ifdef HAVE_NDIR_H
374
#  include <ndir.h>
375
# else
376
#  include <sys/dir.h>
377
# endif
378
# define dirent direct
379
#endif])
380
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
381
		  struct utmp.ut_xtime, struct utmpx.ut_host,
382
		  struct utmpx.ut_user, struct utmpx.ut_tv,
383
		  struct utmpx.ut_xtime], , ,
384
[#include <sys/types.h>
385
#ifdef HAVE_UTMPX_H
386
#include <utmpx.h>
387
#define utmp utmpx
388
#elif defined HAVE_UTMP_H
389
#include <utmp.h>
390
#endif])
391
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
392
[#include <sys/types.h>
393
#include <sys/socket.h>])
394
395
dnl Checks for compiler characteristics
396
AC_C_CONST
397
AC_C_VOLATILE
398
399
dnl checks for library functions
400
AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
401
[#include "config_p.h"
402
AC_INCLUDES_DEFAULT([])
403
#ifdef HAVE_CRYPT_H
404
#include <crypt.h>
405
#endif
406
])
407
AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
408
AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no])
409
AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl
410
	[getutent getutxent mallinfo mblen memmove memset mkstemp nice] dnl
411
	[nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth])
412
AC_FUNC_GETPGRP
413
AC_FUNC_MBRTOWC
414
if test "x${cross_compiling}" != xyes ; then
415
  AC_FUNC_SETPGRP
416
else
417
  ac_cv_func_setpgrp_void=yes
418
fi
419
AC_FUNC_STRCOLL
420
421
dnl This is not good enough; we need sockaddr_storage too.
422
dnl See whether we can use IPv6 related functions
423
dnl AC_DEFUN([IPv6_CHECK_FUNC], [
424
dnl changequote(, )dnl
425
dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
426
dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
427
dnl changequote([, ])dnl
428
dnl AC_CHECK_FUNC($1, [dnl
429
dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
430
dnl   ac_cv_lib_inet6_$1=no], [dnl
431
dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
432
dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
433
dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
434
dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
435
dnl 	break
436
dnl       fi
437
dnl     done])dnl
438
dnl   AC_MSG_RESULT($ipv6_cv_dir)
439
dnl   if test $ipv6_cv_dir = no; then
440
dnl     ac_cv_lib_inet6_$1=no
441
dnl   else
442
dnl     if test x$ipv6_libinet6 = x; then
443
dnl       ipv6_libinet6=no
444
dnl       SAVELDFLAGS="$LDFLAGS"
445
dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
446
dnl     fi
447
dnl     AC_CHECK_LIB(inet6, $1, [dnl
448
dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
449
dnl       if test $ipv6_libinet6 = no; then
450
dnl 	ipv6_libinet6=yes
451
dnl 	LIBS="$LIBS -linet6"
452
dnl       fi],)dnl
453
dnl     if test $ipv6_libinet6 = no; then
454
dnl       LDFLAGS="$SAVELDFLAGS"
455
dnl     fi
456
dnl   fi])dnl
457
dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
458
dnl then
459
dnl   ipv6_cv_$1=yes
460
dnl   ifelse([$2], , :, [$2])
461
dnl else
462
dnl   ipv6_cv_$1=no
463
dnl   ifelse([$3], , :, [$3])
464
dnl fi])
465
dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
466
467
AC_SUBST(DFLAGS)
468
469
dnl Checks for system services
470
if test "$have_setlocale" != no; then
471
  AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
472
	        [], [enable_nls=yes])
473
  if test "x$enable_nls" != xno; then
474
    AC_DEFINE([NLS], [1], [Support NLS.])
475
  fi
476
fi
477
478
if test "x$enable_nls" != xno -a "$have_catgets" != no -a -n "$GENCAT" ; then
479
  AC_ARG_ENABLE([nls-catalogs], AS_HELP_STRING([--disable-nls-catalogs], [Disable NLS catalog support]),
480
	        [], [enable_nls_catalogs=yes])
481
  if test "x$enable_nls_catalogs" != xno; then
482
    BUILD_CATALOGS="yes"
483
    AC_DEFINE([NLS_CATALOGS], [1], [Support NLS catalogs.])
484
  fi
485
fi
486
487
AC_ARG_WITH(hesiod,
488
  [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
489
  [hesiod="$withval"], [hesiod=no])
490
if test "$hesiod" != no; then
491
  HESLIB="-lhesiod"
492
  AC_CHECK_FUNC(res_send, :,
493
    AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
494
  HESDEF=-DHESIOD
495
  if test "$hesiod" != yes; then
496
    HESDEF="$HESDEF -I$hesiod/include"
497
    HESLIB="-L$hesiod/lib $HESLIB"
498
  fi
499
fi
500
AC_SUBST(HESDEF)
501
AC_SUBST(HESLIB)
502
AC_SUBST(BUILD_CATALOGS)
503
504
AC_CONFIG_FILES([Makefile nls/Makefile])
505
AC_OUTPUT
(-)contrib/tcsh/configure.in (-485 lines)
Lines 1-485 Link Here
1
dnl Autoconf script for tcsh
2
dnl To rebuild the `configure' script from this, execute the command
3
dnl 	autoconf
4
dnl in the directory containing this script.
5
dnl
6
dnl You'll also need a version of config.guess from a gnu package
7
dnl
8
dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
9
dnl
10
dnl $tcsh: configure.in,v 3.99 2012/02/13 16:33:50 christos Exp $
11
12
AC_PREREQ([2.59])dnl Minimum Autoconf version required.
13
AC_INIT([tcsh], [6.18.01], [http://bugs.gw.com/])
14
AC_CONFIG_MACRO_DIR([m4])
15
AC_CONFIG_SRCDIR([tc.vers.c])
16
AC_CONFIG_HEADERS([config.h])
17
AC_CONFIG_TESTDIR([.], [.])
18
19
AC_PROG_INSTALL
20
AC_CANONICAL_HOST
21
22
AC_MSG_CHECKING([cached host tuple])
23
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
24
     test x"$ac_cv_host_system_type" != x"$host"; }; then
25
  AC_MSG_RESULT([different])
26
  AC_MSG_ERROR([remove config.cache and re-run configure])
27
else
28
  AC_MSG_RESULT(ok)
29
fi
30
ac_cv_host_system_type="$host"
31
32
33
changequote(, )dnl
34
35
case "${host}" in
36
37
  ## Alpha (DEC) machines.
38
  alpha*-dec-osf* )
39
    tcsh_config_file=decosf1
40
  ;;
41
42
  ## Ultrix
43
  *-dec-ultrix* )
44
    tcsh_config_file=ultrix
45
  ;;
46
47
  ## DGUX
48
  *-dg-dguxR4* )
49
    tcsh_config_file=dgux5.4
50
  ;;
51
  m88k-dg-dgux5.4R* )
52
    tcsh_config_file=dgux5.4
53
  ;;
54
55
  ## HP/UX
56
  *-hp-hpux7* )
57
    tcsh_config_file=hpux7
58
  ;;
59
  *-hp-hpux[89]* )
60
    tcsh_config_file=hpux8
61
  ;;
62
  *-hp-hpux1[0-9]* )
63
    tcsh_config_file=hpux11
64
  ;;
65
66
  ## IBM AIX systems
67
  *-ibm-aix*)
68
    tcsh_config_file=aix
69
  ;;
70
71
  ## SX-4
72
  sx4-nec-*)
73
    CC='cc -h0,ansi,novector,float0'
74
    LDFLAGS='-Gsmall'
75
    tcsh_config_file=superux8
76
  ;;
77
78
  ## IBM OS/390 systems
79
  *-ibm-os390*)
80
    CC='c89'
81
    tcsh_config_file=os390
82
  ;;
83
84
  ## Android
85
  *-*-android*)
86
    tcsh_config_file=android
87
  ;;
88
89
  ## Linux
90
  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
91
    tcsh_config_file=linux
92
  ;;
93
94
  ## Motorola systems
95
  m68k-motorola-sysv* )
96
    tcsh_config_file=sysV68
97
  ;;
98
  m88k-motorola-sysv3* )
99
    tcsh_config_file=sysV88
100
  ;;
101
102
  ## NetBSD systems
103
  *-*-netbsd*)
104
    tcsh_config_file=bsd4.4
105
  ;;
106
107
  ## FreeBSD systems
108
  *-*-freebsd*)
109
    tcsh_config_file=bsd4.4
110
  ;;
111
112
  ## MidnightBSD systems
113
  *-*-midnightbsd*)
114
    tcsh_config_file=bsd4.4
115
  ;;
116
  
117
  ## DragonFlyBSD systems
118
  *-*-dragonfly*)
119
    tcsh_config_file=bsd4.4
120
  ;;
121
122
  ## OpenBSD systems
123
  *-*-openbsd*)
124
    tcsh_config_file=bsd4.4
125
  ;;
126
127
  ## BSDI systems
128
  *-*-bsdi*)
129
    tcsh_config_file=bsd4.4
130
  ;;
131
132
  ## Mac OS X Server
133
  *-*-rhapsody* )
134
    tcsh_config_file=bsd4.4
135
  ;;
136
137
  ## Mac OS X Server
138
  *-*-darwin* )
139
    tcsh_config_file=bsd4.4
140
  ;;
141
142
  ## DragonFly systems
143
  *-*-dragonfly*)
144
    tcsh_config_file=bsd4.4
145
  ;;
146
147
  ## Silicon Graphics machines
148
  *-sgi-iri* )
149
    tcsh_config_file=irix
150
    case "${host_os}" in
151
      irix[34]*) # Irix-3.x - Irix 4.x
152
        NON_GNU_DFLAGS='-D__STDC__'
153
        LIBS='-lsun -lbsd -lc_s'
154
      ;;
155
      irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
156
        LIBS='-lbsd'
157
      ;;
158
      irix6.[2-9]*) # Irix 6.2 and later
159
	tcsh_config_file=irix62
160
      ;;
161
    esac
162
  ;;
163
164
  ## Suns
165
  *-sun-sunos3* )
166
    tcsh_config_file=sunos35
167
  ;;
168
  *-sun-sunos4.0* )
169
    tcsh_config_file=sunos40
170
  ;;
171
  *-sun-sunos4.1.[12]* )
172
    tcsh_config_file=sunos41
173
  ;;
174
  *-sun-sunos4.1.[3456]* )
175
    tcsh_config_file=sunos413
176
  ;;
177
  *-*-solaris2.[01] ) # Should handle sparc or x86
178
    tcsh_config_file=sol2
179
  ;;
180
  *-sun-solaris2.2 ) # Sparc only release
181
    tcsh_config_file=sol22
182
  ;;
183
  *-sun-solaris2.3 ) # Sparc only release
184
    tcsh_config_file=sol23
185
  ;;
186
  *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
187
    tcsh_config_file=sol24
188
  ;;
189
  *-*-solaris2.[678] ) # Should handle sparc, x86 and powerpc
190
    tcsh_config_file=sol26
191
  ;;
192
  *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
193
    tcsh_config_file=sol29
194
  ;;
195
196
  ## Dell SVR4
197
  *-dell-sysv4* )
198
    tcsh_config_file=sysv4
199
    DFLAGS="$DFLAGS -DDELL"
200
  ;;
201
202
  ## SVR4 (Generic and otherwise)
203
  *-*-sysv4* )
204
    tcsh_config_file=sysv4
205
  ;;
206
207
  ## Tektronix systems
208
  m68k-tektronix-bsd* )
209
    tcsh_config_file=bsd
210
    NON_GNU_DFLAGS='-DBSD -DUTek'
211
  ;;
212
  m88k-tektronix-sysv3* )
213
    tcsh_config_file=tekXD88
214
  ;;
215
216
  ## SCO
217
  *-sco3.2v5*) 
218
    tcsh_config_file=sco32v5
219
  ;;
220
  *-sco3.2v4*)
221
    tcsh_config_file=sco32v4
222
  ;;
223
  *-sco3.2v2*)
224
    tcsh_config_file=sco32v2
225
  ;;
226
227
  ## Siemens BS2000 Mainframe
228
  bs2000-siemens-*)
229
    tcsh_config_file=bs2000
230
  ;;
231
232
  ## Convex
233
  *-convex*)
234
    tcsh_config_file=convex
235
  ;;
236
237
  ## Cray
238
  *-cray-unicos*)
239
    tcsh_config_file=cray
240
  ;;
241
242
  ## Red Hat Cygwin
243
  *-cygwin)
244
    tcsh_config_file=cygwin
245
  ;;
246
247
  ## mips-compaq-nonstopux
248
  *-*-nonstopux)
249
    tcsh_config_file=sysv4
250
  ;;
251
252
  ## Apollo Domain/OS
253
  *-apollo-*)
254
    tcsh_config_file=apollo
255
  ;;
256
257
  ## QNX6
258
  *-qnx6*)
259
    tcsh_config_file=qnx6
260
  ;;
261
262
  * )
263
  changequote([, ])dnl
264
  AC_MSG_ERROR([Tcsh can't guess the configuration file name
265
for `${host}' systems.
266
Check tcsh's `Ported' file for manual configuration instructions.])
267
  changequote(, )dnl
268
  ;;
269
270
esac
271
272
echo "Tcsh will use configuration file \`$tcsh_config_file'."
273
changequote([, ])dnl
274
cp ${srcdir}/config/${tcsh_config_file} config_p.h
275
AH_BOTTOM(
276
[#include "config_p.h"
277
#include "config_f.h"])
278
279
dnl Checks for programs
280
AC_PROG_CC
281
AC_PROG_CPP
282
AC_PROG_GCC_TRADITIONAL
283
284
AC_PATH_PROG([GENCAT], [gencat]) 
285
286
dnl Require build CC to create gethost helper when cross building
287
if test "x${cross_compiling}" = xyes ; then
288
  CC_FOR_GETHOST="cc"
289
else
290
  CC_FOR_GETHOST="\$(CC)"
291
fi
292
AC_SUBST(CC_FOR_GETHOST)
293
294
if test "x$GCC" != xyes ; then
295
  DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
296
  CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
297
fi
298
299
dnl Checks for libraries
300
AC_SEARCH_LIBS(crypt, crypt)
301
AC_SEARCH_LIBS(getspnam, sec)
302
AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
303
AC_SEARCH_LIBS(gethostbyname, nsl)
304
AC_SEARCH_LIBS(connect, socket)
305
AC_SEARCH_LIBS(catgets, catgets)
306
AM_ICONV
307
308
dnl Checks for header files
309
AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl
310
		 [shadow.h stdint.h utmp.h utmpx.h])
311
AC_CHECK_HEADERS([wchar.h],
312
	[AC_CHECK_SIZEOF([wchar_t], [], [dnl
313
#include <stdio.h>
314
#include <wchar.h>])
315
	AC_CHECK_HEADERS([wctype.h])])
316
AC_HEADER_DIRENT
317
AC_HEADER_STAT
318
AC_HEADER_STDC
319
320
dnl Checks for types
321
AC_CHECK_TYPES([long long])
322
AC_TYPE_GETGROUPS
323
AC_TYPE_MODE_T
324
AC_TYPE_SIZE_T
325
AC_TYPE_UID_T
326
AC_TYPE_UINT32_T
327
328
AC_DEFUN([AC_TYPE_SSIZE_T], [
329
AC_CHECK_TYPE(ssize_t,,
330
AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
331
[
332
#include <sys/types.h>
333
])
334
])
335
AC_TYPE_SSIZE_T
336
337
AC_DEFUN([AC_TYPE_SOCKLEN_T], [
338
AC_CHECK_TYPE(socklen_t,,
339
AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
340
[
341
#include <sys/types.h>
342
#include <sys/socket.h>
343
])
344
])
345
AC_TYPE_SOCKLEN_T
346
347
348
dnl Checks for structures
349
AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
350
[#ifdef HAVE_DIRENT_H
351
# include <dirent.h>
352
#else
353
# ifdef HAVE_NDIR_H
354
#  include <ndir.h>
355
# else
356
#  include <sys/dir.h>
357
# endif
358
# define dirent direct
359
#endif])
360
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
361
		  struct utmp.ut_xtime, struct utmpx.ut_host,
362
		  struct utmpx.ut_user, struct utmpx.ut_tv,
363
		  struct utmpx.ut_xtime], , ,
364
[#include <sys/types.h>
365
#ifdef HAVE_UTMPX_H
366
#include <utmpx.h>
367
#define utmp utmpx
368
#elif defined HAVE_UTMP_H
369
#include <utmp.h>
370
#endif])
371
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
372
[#include <sys/types.h>
373
#include <sys/socket.h>])
374
375
dnl Checks for compiler characteristics
376
AC_C_CONST
377
AC_C_VOLATILE
378
379
dnl checks for library functions
380
AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
381
[#include "config_p.h"
382
AC_INCLUDES_DEFAULT([])
383
#ifdef HAVE_CRYPT_H
384
#include <crypt.h>
385
#endif
386
])
387
AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
388
AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no])
389
AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl
390
	[getutent getutxent mallinfo memmove memset mkstemp nice] dnl
391
	[nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth])
392
AC_FUNC_GETPGRP
393
AC_FUNC_MBRTOWC
394
if test "x${cross_compiling}" != xyes ; then
395
  AC_FUNC_SETPGRP
396
else
397
  ac_cv_func_setpgrp_void=yes
398
fi
399
AC_FUNC_STRCOLL
400
401
dnl This is not good enough; we need sockaddr_storage too.
402
dnl See whether we can use IPv6 related functions
403
dnl AC_DEFUN([IPv6_CHECK_FUNC], [
404
dnl changequote(, )dnl
405
dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
406
dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
407
dnl changequote([, ])dnl
408
dnl AC_CHECK_FUNC($1, [dnl
409
dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
410
dnl   ac_cv_lib_inet6_$1=no], [dnl
411
dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
412
dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
413
dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
414
dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
415
dnl 	break
416
dnl       fi
417
dnl     done])dnl
418
dnl   AC_MSG_RESULT($ipv6_cv_dir)
419
dnl   if test $ipv6_cv_dir = no; then
420
dnl     ac_cv_lib_inet6_$1=no
421
dnl   else
422
dnl     if test x$ipv6_libinet6 = x; then
423
dnl       ipv6_libinet6=no
424
dnl       SAVELDFLAGS="$LDFLAGS"
425
dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
426
dnl     fi
427
dnl     AC_CHECK_LIB(inet6, $1, [dnl
428
dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
429
dnl       if test $ipv6_libinet6 = no; then
430
dnl 	ipv6_libinet6=yes
431
dnl 	LIBS="$LIBS -linet6"
432
dnl       fi],)dnl
433
dnl     if test $ipv6_libinet6 = no; then
434
dnl       LDFLAGS="$SAVELDFLAGS"
435
dnl     fi
436
dnl   fi])dnl
437
dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
438
dnl then
439
dnl   ipv6_cv_$1=yes
440
dnl   ifelse([$2], , :, [$2])
441
dnl else
442
dnl   ipv6_cv_$1=no
443
dnl   ifelse([$3], , :, [$3])
444
dnl fi])
445
dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
446
447
AC_SUBST(DFLAGS)
448
449
dnl Checks for system services
450
if test "$have_setlocale" != no; then
451
  AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
452
	        [], [enable_nls=yes])
453
  if test "x$enable_nls" != xno; then
454
    AC_DEFINE([NLS], [1], [Support NLS.])
455
  fi
456
fi
457
458
if test "x$enable_nls" != xno -a "$have_catgets" != no -a -n "$GENCAT" ; then
459
  AC_ARG_ENABLE([nls-catalogs], AS_HELP_STRING([--disable-nls-catalogs], [Disable NLS catalog support]),
460
	        [], [enable_nls_catalogs=yes])
461
  if test "x$enable_nls_catalogs" != xno; then
462
    BUILD_CATALOGS="yes"
463
    AC_DEFINE([NLS_CATALOGS], [1], [Support NLS catalogs.])
464
  fi
465
fi
466
467
AC_ARG_WITH(hesiod,
468
  [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
469
  [hesiod="$withval"], [hesiod=no])
470
if test "$hesiod" != no; then
471
  HESLIB="-lhesiod"
472
  AC_CHECK_FUNC(res_send, :,
473
    AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
474
  HESDEF=-DHESIOD
475
  if test "$hesiod" != yes; then
476
    HESDEF="$HESDEF -I$hesiod/include"
477
    HESLIB="-L$hesiod/lib $HESLIB"
478
  fi
479
fi
480
AC_SUBST(HESDEF)
481
AC_SUBST(HESLIB)
482
AC_SUBST(BUILD_CATALOGS)
483
484
AC_CONFIG_FILES([Makefile nls/Makefile])
485
AC_OUTPUT
(-)contrib/tcsh/dotlock.c (+180 lines)
Line 0 Link Here
1
/*	$NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp $	*/
2
3
/*
4
 * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 * 1. Redistributions of source code must retain the above copyright
10
 *    notice, this list of conditions and the following disclaimer.
11
 * 2. Redistributions in binary form must reproduce the above copyright
12
 *    notice, this list of conditions and the following disclaimer in the
13
 *    documentation and/or other materials provided with the distribution.
14
 *
15
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
#include "sh.h"
27
RCSID("$tcsh: dotlock.c,v 3.4 2015/11/03 21:04:13 christos Exp $")
28
29
#include <stdio.h>
30
#ifndef O_SYNC
31
#define O_SYNC	0
32
#endif
33
34
#include "dotlock.h"
35
36
static int create_exclusive(const char *);
37
/*
38
 * Create a unique file. O_EXCL does not really work over NFS so we follow
39
 * the following trick: [Inspired by  S.R. van den Berg]
40
 *
41
 * - make a mostly unique filename and try to create it.
42
 * - link the unique filename to our target
43
 * - get the link count of the target
44
 * - unlink the mostly unique filename
45
 * - if the link count was 2, then we are ok; else we've failed.
46
 */
47
static int
48
create_exclusive(const char *fname)
49
{
50
	char path[MAXPATHLEN], hostname[MAXHOSTNAMELEN + 1];
51
	const char *ptr;
52
	struct timeval tv;
53
	pid_t pid;
54
	size_t ntries, cookie;
55
	int fd, serrno;
56
	struct stat st;
57
58
	(void)gettimeofday(&tv, NULL);
59
	(void)gethostname(hostname, sizeof(hostname));
60
	hostname[sizeof(hostname) - 1] = '\0';
61
	pid = getpid();
62
63
	cookie = pid ^ tv.tv_usec;
64
65
	/*
66
	 * We generate a semi-unique filename, from hostname.(pid ^ usec)
67
	 */
68
	if ((ptr = strrchr(fname, '/')) == NULL)
69
		ptr = fname;
70
	else
71
		ptr++;
72
73
	(void)snprintf(path, sizeof(path), "%.*s.%s.%lx",
74
	    (int)(ptr - fname), fname, hostname, (u_long)cookie);
75
76
	/*
77
	 * We try to create the unique filename.
78
	 */
79
	for (ntries = 0; ntries < 5; ntries++) {
80
		fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC, 0);
81
		if (fd != -1) {
82
			(void)close(fd);
83
			break;
84
		}
85
		else if (errno == EEXIST)
86
			continue;
87
		else
88
			return -1;
89
	}
90
91
	/*
92
	 * We link the path to the name
93
	 */
94
	if (link(path, fname) == -1)
95
		goto bad;
96
97
	/*
98
	 * Note that we stat our own exclusively created name, not the
99
	 * destination, since the destination can be affected by others.
100
	 */
101
	if (stat(path, &st) == -1)
102
		goto bad;
103
104
	(void)unlink(path);
105
106
	/*
107
	 * If the number of links was two (one for the unique file and one
108
	 * for the lock), we've won the race
109
	 */
110
	if (st.st_nlink != 2) {
111
		errno = EEXIST;
112
		return -1;
113
	}
114
	return 0;
115
116
bad:
117
	serrno = errno;
118
	(void)unlink(path);
119
	errno = serrno;
120
	return -1;
121
}
122
123
/*
124
 * fname -- Pathname to lock
125
 * pollinterval -- Interval (miliseconds) to check for lock, -1 return
126
 */
127
int
128
dot_lock(const char *fname, int pollinterval)
129
{
130
	char path[MAXPATHLEN];
131
	sigset_t nset, oset;
132
	int retval;
133
134
	(void)sigemptyset(&nset);
135
	(void)sigaddset(&nset, SIGHUP);
136
	(void)sigaddset(&nset, SIGINT);
137
	(void)sigaddset(&nset, SIGQUIT);
138
	(void)sigaddset(&nset, SIGTERM);
139
	(void)sigaddset(&nset, SIGTTIN);
140
	(void)sigaddset(&nset, SIGTTOU);
141
	(void)sigaddset(&nset, SIGTSTP);
142
	(void)sigaddset(&nset, SIGCHLD);
143
144
	(void)snprintf(path, sizeof(path), "%s.lock", fname);
145
146
	retval = -1;
147
	for (;;) {
148
		handle_pending_signals();
149
		(void)sigprocmask(SIG_BLOCK, &nset, &oset);
150
		if (create_exclusive(path) != -1) {
151
			(void)sigprocmask(SIG_SETMASK, &oset, NULL);
152
			retval = 0;
153
			break;
154
		}
155
		else
156
			(void)sigprocmask(SIG_SETMASK, &oset, NULL);
157
158
		if (errno != EEXIST)
159
			break;
160
161
		if (pollinterval) {
162
			if (pollinterval == -1) {
163
				errno = EEXIST;
164
				break;
165
			}
166
			(void)usleep((unsigned int)pollinterval * 1000);
167
		}
168
	}
169
	handle_pending_signals();
170
	return retval;
171
}
172
173
void
174
dot_unlock(const char *fname)
175
{
176
	char path[MAXPATHLEN];
177
178
	(void)snprintf(path, sizeof(path), "%s.lock", fname);
179
	(void)unlink(path);
180
}
(-)contrib/tcsh/dotlock.h (+35 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
 */
24
25
#ifndef _DOTLOCK_H_
26
#define _DOTLOCK_H_ 1
27
28
/*
29
 * fname -- Pathname to lock
30
 * pollinterval -- Interval (miliseconds) to check for lock, -1 return
31
 */
32
int dot_lock(const char *fname, int pollinterval);
33
void dot_unlock(const char *fname);
34
35
#endif /* #ifndef _DOTLOCK_H_ */
(-)contrib/tcsh/ed.chared.c (-18 / +27 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.98 2010/05/08 00:37:39 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $ */
2
/*
2
/*
3
 * ed.chared.c: Character editing functions.
3
 * ed.chared.c: Character editing functions.
4
 */
4
 */
Lines 72-78 Link Here
72
72
73
#include "sh.h"
73
#include "sh.h"
74
74
75
RCSID("$tcsh: ed.chared.c,v 3.98 2010/05/08 00:37:39 christos Exp $")
75
RCSID("$tcsh: ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $")
76
76
77
#include "ed.h"
77
#include "ed.h"
78
#include "tw.h"
78
#include "tw.h"
Lines 93-99 Link Here
93
 * from: Gert-Jan Vons <vons@cesar.crbca1.sinet.slb.com>
93
 * from: Gert-Jan Vons <vons@cesar.crbca1.sinet.slb.com>
94
 */
94
 */
95
#define C_CLASS_WHITE	1
95
#define C_CLASS_WHITE	1
96
#define C_CLASS_ALNUM	2
96
#define C_CLASS_WORD	2
97
#define C_CLASS_OTHER	3
97
#define C_CLASS_OTHER	3
98
98
99
static Char *InsertPos = InputBuf; /* Where insertion starts */
99
static Char *InsertPos = InputBuf; /* Where insertion starts */
Lines 290-296 Link Here
290
/*
290
/*
291
 * c_to_class() returns the class of the given character.
291
 * c_to_class() returns the class of the given character.
292
 *
292
 *
293
 * This is used to make the c_prev_word() and c_next_word() functions
293
 * This is used to make the c_prev_word(), c_next_word() and c_eword() functions
294
 * work like vi's, which classify characters. A word is a sequence of
294
 * work like vi's, which classify characters. A word is a sequence of
295
 * characters belonging to the same class, classes being defined as
295
 * characters belonging to the same class, classes being defined as
296
 * follows:
296
 * follows:
Lines 305-312 Link Here
305
    if (Isspace(ch))
305
    if (Isspace(ch))
306
        return C_CLASS_WHITE;
306
        return C_CLASS_WHITE;
307
307
308
    if (Isdigit(ch) || Isalpha(ch) || ch == '_')
308
    if (isword(ch))
309
        return C_CLASS_ALNUM;
309
        return C_CLASS_WORD;
310
310
311
    return C_CLASS_OTHER;
311
    return C_CLASS_OTHER;
312
}
312
}
Lines 828-842 Link Here
828
    p++;
828
    p++;
829
829
830
    while (n--) {
830
    while (n--) {
831
	while ((p < high) && Isspace(*p)) 
831
        int  c_class;
832
	    p++;
833
832
834
	if (isword(*p))
833
        if (p >= high)
835
	    while ((p < high) && isword(*p)) 
834
            break;
836
		p++;
835
837
	else
836
        /* scan until end of current word (may be all whitespace!) */
838
	    while ((p < high) && !(Isspace(*p) || isword(*p)))
837
        c_class = c_to_class(*p);
839
		p++;
838
        while ((p < high) && c_class == c_to_class(*p))
839
            p++;
840
841
        /* if this was a non_whitespace word, we're ready */
842
        if (c_class != C_CLASS_WHITE)
843
            continue;
844
845
        /* otherwise, move to the end of the word just found */
846
        c_class = c_to_class(*p);
847
        while ((p < high) && c_class == c_to_class(*p))
848
            p++;
840
    }
849
    }
841
850
842
    p--;
851
    p--;
Lines 941-947 Link Here
941
950
942
/* Save InputBuf etc in SavedBuf etc for restore after cmd exec */
951
/* Save InputBuf etc in SavedBuf etc for restore after cmd exec */
943
static void
952
static void
944
c_save_inputbuf()
953
c_save_inputbuf(void)
945
{
954
{
946
    SavedBuf.len = 0;
955
    SavedBuf.len = 0;
947
    Strbuf_append(&SavedBuf, InputBuf);
956
    Strbuf_append(&SavedBuf, InputBuf);
Lines 953-959 Link Here
953
}
962
}
954
963
955
CCRETVAL
964
CCRETVAL
956
GetHistLine()
965
GetHistLine(void)
957
{
966
{
958
    struct Hist *hp;
967
    struct Hist *hp;
959
    int     h;
968
    int     h;
Lines 3025-3031 Link Here
3025
3034
3026
/*ARGSUSED*/
3035
/*ARGSUSED*/
3027
CCRETVAL
3036
CCRETVAL
3028
e_capitolcase(Char c)
3037
e_capitalcase(Char c)
3029
{
3038
{
3030
    Char   *cp, *end;
3039
    Char   *cp, *end;
3031
3040
Lines 3387-3393 Link Here
3387
         (void) Cookedmode();
3396
         (void) Cookedmode();
3388
3397
3389
     (void) xwrite(SHIN, "\n", 1);
3398
     (void) xwrite(SHIN, "\n", 1);
3390
     len = one_wctomb(buf, c & CHAR);
3399
     len = one_wctomb(buf, c);
3391
     for (i = 0; i < len; i++)
3400
     for (i = 0; i < len; i++)
3392
	 (void) ioctl(SHIN, TIOCSTI, (ioctl_t) &buf[i]);
3401
	 (void) ioctl(SHIN, TIOCSTI, (ioctl_t) &buf[i]);
3393
3402
(-)contrib/tcsh/ed.decls.h (-2 / +2 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.45 2008/10/17 20:25:00 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.46 2015/08/19 14:29:55 christos Exp $ */
2
/*
2
/*
3
 * ed.decls.h: Editor external definitions
3
 * ed.decls.h: Editor external definitions
4
 */
4
 */
Lines 142-148 Link Here
142
extern	CCRETVAL	v_wordbegnext		(Char);
142
extern	CCRETVAL	v_wordbegnext		(Char);
143
extern	CCRETVAL	e_uppercase		(Char);
143
extern	CCRETVAL	e_uppercase		(Char);
144
extern	CCRETVAL	e_lowercase		(Char);
144
extern	CCRETVAL	e_lowercase		(Char);
145
extern	CCRETVAL	e_capitolcase		(Char);
145
extern	CCRETVAL	e_capitalcase		(Char);
146
extern	CCRETVAL	e_cleardisp		(Char);
146
extern	CCRETVAL	e_cleardisp		(Char);
147
extern	CCRETVAL	e_complete		(Char);
147
extern	CCRETVAL	e_complete		(Char);
148
extern	CCRETVAL	e_correct		(Char);
148
extern	CCRETVAL	e_correct		(Char);
(-)contrib/tcsh/ed.defns.c (-19 / +26 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $ */
2
/*
2
/*
3
 * ed.defns.c: Editor function definitions and initialization
3
 * ed.defns.c: Editor function definitions and initialization
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $")
35
RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
38
Lines 151-157 Link Here
151
#define         F_CASEUPPER     54
151
#define         F_CASEUPPER     54
152
    e_lowercase,
152
    e_lowercase,
153
#define         F_CASELOWER     55
153
#define         F_CASELOWER     55
154
    e_capitolcase,
154
    e_capitalcase,
155
#define         F_CASECAPITAL   56
155
#define         F_CASECAPITAL   56
156
    v_zero,
156
    v_zero,
157
#define		V_ZERO		57
157
#define		V_ZERO		57
Lines 1801-1827 Link Here
1801
void
1801
void
1802
CheckMaps(void)
1802
CheckMaps(void)
1803
{		/* check the size of the key maps */
1803
{		/* check the size of the key maps */
1804
    int     c1 = (NT_NUM_KEYS * sizeof(KEYCMD));
1804
    size_t     c1 = NT_NUM_KEYS * sizeof(KEYCMD);
1805
1805
1806
    if ((sizeof(CcKeyMap)) != c1)
1806
    if (sizeof(CcKeyMap) != c1)
1807
	xprintf("CcKeyMap should be %d entries, but is %d.\r\n",
1807
	xprintf("CcKeyMap should be %u entries, but is %zu.\r\n",
1808
		NT_NUM_KEYS, sizeof(CcKeyMap) / sizeof(KEYCMD)));
1808
		NT_NUM_KEYS, sizeof(CcKeyMap) / sizeof(KEYCMD));
1809
1809
1810
    if ((sizeof(CcAltMap)) != c1)
1810
    if (sizeof(CcAltMap) != c1)
1811
	xprintf("CcAltMap should be %d entries, but is %d.\r\n",
1811
	xprintf("CcAltMap should be %u entries, but is %zu.\r\n",
1812
		NT_NUM_KEYS, (sizeof(CcAltMap) / sizeof(KEYCMD)));
1812
		NT_NUM_KEYS, sizeof(CcAltMap) / sizeof(KEYCMD));
1813
1813
1814
    if ((sizeof(CcEmacsMap)) != c1)
1814
    if (sizeof(CcEmacsMap) != c1)
1815
	xprintf("CcEmacsMap should be %d entries, but is %d.\r\n",
1815
	xprintf("CcEmacsMap should be %u entries, but is %zu.\r\n",
1816
		NT_NUM_KEYS, (sizeof(CcEmacsMap) / sizeof(KEYCMD)));
1816
		NT_NUM_KEYS, sizeof(CcEmacsMap) / sizeof(KEYCMD));
1817
1817
1818
    if ((sizeof(CcViMap)) != c1)
1818
    if (sizeof(CcViMap) != c1)
1819
	xprintf("CcViMap should be %d entries, but is %d.\r\n",
1819
	xprintf("CcViMap should be %u entries, but is %zu.\r\n",
1820
		NT_NUM_KEYS, (sizeof(CcViMap) / sizeof(KEYCMD)));
1820
		NT_NUM_KEYS, sizeof(CcViMap) / sizeof(KEYCMD));
1821
1821
1822
    if ((sizeof(CcViCmdMap)) != c1)
1822
    if (sizeof(CcViCmdMap) != c1)
1823
	xprintf("CcViCmdMap should be %d entries, but is %d.\r\n",
1823
	xprintf("CcViCmdMap should be %u entries, but is %zu.\r\n",
1824
		NT_NUM_KEYS, (sizeof(CcViCmdMap) / sizeof(KEYCMD)));
1824
		NT_NUM_KEYS, sizeof(CcViCmdMap) / sizeof(KEYCMD));
1825
}
1825
}
1826
1826
1827
#endif
1827
#endif
Lines 1889-1894 Link Here
1889
    int i;
1889
    int i;
1890
1890
1891
    VImode = 1;
1891
    VImode = 1;
1892
    setNS(STRvimode);
1893
    update_wordchars();
1894
1892
    ResetXmap();
1895
    ResetXmap();
1893
    for (i = 0; i < NT_NUM_KEYS; i++) {
1896
    for (i = 0; i < NT_NUM_KEYS; i++) {
1894
	CcKeyMap[i] = CcViMap[i];
1897
	CcKeyMap[i] = CcViMap[i];
Lines 1910-1915 Link Here
1910
    cstr.len = 2;
1913
    cstr.len = 2;
1911
1914
1912
    VImode = 0;
1915
    VImode = 0;
1916
    if (adrof(STRvimode))
1917
	unsetv(STRvimode);
1918
    update_wordchars();
1919
1913
    ResetXmap();
1920
    ResetXmap();
1914
    for (i = 0; i < NT_NUM_KEYS; i++) {
1921
    for (i = 0; i < NT_NUM_KEYS; i++) {
1915
	CcKeyMap[i] = CcEmacsMap[i];
1922
	CcKeyMap[i] = CcEmacsMap[i];
(-)contrib/tcsh/ed.inputl.c (-14 / +10 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.71 2010/12/22 17:26:04 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $ */
2
/*
2
/*
3
 * ed.inputl.c: Input line handling.
3
 * ed.inputl.c: Input line handling.
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: ed.inputl.c,v 3.71 2010/12/22 17:26:04 christos Exp $")
35
RCSID("$tcsh: ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "ed.defns.h"		/* for the function names */
38
#include "ed.defns.h"		/* for the function names */
Lines 683-689 Link Here
683
#ifdef DSPMBYTE
683
#ifdef DSPMBYTE
684
	     _enable_mbdisp &&
684
	     _enable_mbdisp &&
685
#else
685
#else
686
	     MB_CUR_MAX == 1 &&
686
	     MB_LEN_MAX == 1 &&
687
#endif
687
#endif
688
	     !adrof(STRnokanji) && (*ch & META)) {
688
	     !adrof(STRnokanji) && (*ch & META)) {
689
	    MetaNext = 0;
689
	    MetaNext = 0;
Lines 800-816 Link Here
800
		return -1;
800
		return -1;
801
	    }
801
	    }
802
	}
802
	}
803
	if (AsciiOnly) {
803
	cbp++;
804
	    *cp = (unsigned char)*cbuf;
804
	if (normal_mbtowc(cp, cbuf, cbp) == -1) {
805
	} else {
805
	    reset_mbtowc();
806
	    cbp++;
806
	    if (cbp < MB_CUR_MAX)
807
	    if (normal_mbtowc(cp, cbuf, cbp) == -1) {
807
		continue; /* Maybe a partial character */
808
		reset_mbtowc();
808
	    /* And drop the following bytes, if any */
809
		if (cbp < MB_CUR_MAX)
809
	    *cp = (unsigned char)*cbuf | INVALID_BYTE;
810
		    continue; /* Maybe a partial character */
811
		/* And drop the following bytes, if any */
812
		*cp = (unsigned char)*cbuf | INVALID_BYTE;
813
	    }
814
	}
810
	}
815
	break;
811
	break;
816
    }
812
    }
(-)contrib/tcsh/ed.refresh.c (-15 / +45 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.47 2011/02/27 00:14:51 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $ */
2
/*
2
/*
3
 * ed.refresh.c: Lower level screen refreshing functions
3
 * ed.refresh.c: Lower level screen refreshing functions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: ed.refresh.c,v 3.47 2011/02/27 00:14:51 christos Exp $")
35
RCSID("$tcsh: ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
/* #define DEBUG_UPDATE */
38
/* #define DEBUG_UPDATE */
Lines 46-52 Link Here
46
static int rprompt_h, rprompt_v;
46
static int rprompt_h, rprompt_v;
47
47
48
static	int	MakeLiteral		(Char *, int, Char);
48
static	int	MakeLiteral		(Char *, int, Char);
49
static	int	Draw 			(Char *, int);
49
static	int	Draw 			(Char *, int, int);
50
static	void	Vdraw 			(Char, int);
50
static	void	Vdraw 			(Char, int);
51
static	void	RefreshPromptpart	(Char *);
51
static	void	RefreshPromptpart	(Char *);
52
static	void	update_line 		(Char *, Char *, int);
52
static	void	update_line 		(Char *, Char *, int);
Lines 159-173 Link Here
159
    return i | LITERAL;
159
    return i | LITERAL;
160
}
160
}
161
161
162
/* draw char at cp, expand tabs, ctl chars */
162
static int
163
static int
163
Draw(Char *cp, int nocomb)	/* draw char at cp, expand tabs, ctl chars */
164
Draw(Char *cp, int nocomb, int drawPrompt)
164
{
165
{
165
    int w, i, lv, lh;
166
    int w, i, lv, lh;
166
    Char c, attr;
167
    Char c, attr;
167
168
169
#ifdef WIDE_STRINGS
170
    if (!drawPrompt) {			/* draw command-line */
171
	attr = 0;
172
	c = *cp;
173
    } else {				/* draw prompt */
174
	/* prompt with attributes(UNDER,BOLD,STANDOUT) */
175
	if (*cp & (UNDER | BOLD | STANDOUT)) {		/* *cp >= STANDOUT */
176
177
	    /* example)
178
	     * We can't distinguish whether (*cp=)0x02ffffff is
179
	     * U+02FFFFFF or U+00FFFFFF|STANDOUT.
180
	     * We handle as U+00FFFFFF|STANDOUT, only when drawing prompt. */
181
	    attr = (*cp & ATTRIBUTES);
182
	    /* ~(UNDER | BOLD | STANDOUT) = 0xf1ffffff */
183
	    c = *cp & ~(UNDER | BOLD | STANDOUT);
184
185
	    /* if c is ctrl code, we handle *cp as havnig no attributes */
186
	    if ((c < 0x20 && c >= 0) || c == 0x7f) {
187
		attr = 0;
188
		c = *cp;
189
	    }
190
	} else {			/* prompt without attributes */
191
	    attr = 0;
192
	    c = *cp;
193
	}
194
    }
195
#else
168
    attr = *cp & ~CHAR;
196
    attr = *cp & ~CHAR;
169
    c = *cp & CHAR;
197
    c = *cp & CHAR;
170
    w = NLSClassify(c, nocomb);
198
#endif
199
    w = NLSClassify(c, nocomb, drawPrompt);
171
    switch (w) {
200
    switch (w) {
172
	case NLSCLASS_NL:
201
	case NLSCLASS_NL:
173
	    Vdraw('\0', 0);		/* assure end of line	 */
202
	    Vdraw('\0', 0);		/* assure end of line	 */
Lines 201-210 Link Here
201
	case NLSCLASS_ILLEGAL2:
230
	case NLSCLASS_ILLEGAL2:
202
	case NLSCLASS_ILLEGAL3:
231
	case NLSCLASS_ILLEGAL3:
203
	case NLSCLASS_ILLEGAL4:
232
	case NLSCLASS_ILLEGAL4:
204
	    Vdraw('\\' | attr, 1);
233
	case NLSCLASS_ILLEGAL5:
205
	    Vdraw('U' | attr, 1);
234
	    Vdraw('\\', 1);
206
	    Vdraw('+' | attr, 1);
235
	    Vdraw('U', 1);
207
	    for (i = 8 * NLSCLASS_ILLEGAL_SIZE(w) - 4; i >= 0; i -= 4)
236
	    Vdraw('+', 1);
237
	    for (i = 16 + 4 * (-w-5); i >= 0; i -= 4)
208
		Vdraw("0123456789ABCDEF"[(c >> i) & 15] | attr, 1);
238
		Vdraw("0123456789ABCDEF"[(c >> i) & 15] | attr, 1);
209
	    break;
239
	    break;
210
	case 0:
240
	case 0:
Lines 302-308 Link Here
302
	    }
332
	    }
303
	}
333
	}
304
	else
334
	else
305
	    cp += Draw(cp, cp == buf);
335
	    cp += Draw(cp, cp == buf, 1);
306
    }
336
    }
307
}
337
}
308
338
Lines 354-360 Link Here
354
	    cur_v = vcursor_v;
384
	    cur_v = vcursor_v;
355
	    Cursor = cp;
385
	    Cursor = cp;
356
	}
386
	}
357
	cp += Draw(cp, cp == InputBuf);
387
	cp += Draw(cp, cp == InputBuf, 0);
358
    }
388
    }
359
389
360
    if (cur_h == -1) {		/* if I haven't been set yet, I'm at the end */
390
    if (cur_h == -1) {		/* if I haven't been set yet, I'm at the end */
Lines 1126-1132 Link Here
1126
	    cp++;
1156
	    cp++;
1127
	    continue;
1157
	    continue;
1128
	}
1158
	}
1129
	w = NLSClassify(*cp & CHAR, cp == Prompt);
1159
	w = NLSClassify(*cp & CHAR, cp == Prompt, 0);
1130
	cp++;
1160
	cp++;
1131
	switch(w) {
1161
	switch(w) {
1132
	    case NLSCLASS_NL:
1162
	    case NLSCLASS_NL:
Lines 1158-1164 Link Here
1158
    }
1188
    }
1159
1189
1160
    for (cp = InputBuf; cp < Cursor;) {	/* do input buffer to Cursor */
1190
    for (cp = InputBuf; cp < Cursor;) {	/* do input buffer to Cursor */
1161
	w = NLSClassify(*cp & CHAR, cp == InputBuf);
1191
	w = NLSClassify(*cp & CHAR, cp == InputBuf, 0);
1162
	cp++;
1192
	cp++;
1163
	switch(w) {
1193
	switch(w) {
1164
	    case NLSCLASS_NL:
1194
	    case NLSCLASS_NL:
Lines 1251-1257 Link Here
1251
    }
1281
    }
1252
    cp = Cursor - l;
1282
    cp = Cursor - l;
1253
    c = *cp & CHAR;
1283
    c = *cp & CHAR;
1254
    w = NLSClassify(c, cp == InputBuf);
1284
    w = NLSClassify(c, cp == InputBuf, 0);
1255
    switch(w) {
1285
    switch(w) {
1256
	case NLSCLASS_CTRL:
1286
	case NLSCLASS_CTRL:
1257
	    PutPlusOne('^', 1);
1287
	    PutPlusOne('^', 1);
Lines 1299-1305 Link Here
1299
    CursorV = 0;		/* clear the display buffer */
1329
    CursorV = 0;		/* clear the display buffer */
1300
    CursorH = 0;
1330
    CursorH = 0;
1301
    for (i = 0; i < TermV; i++)
1331
    for (i = 0; i < TermV; i++)
1302
	(void) memset(Display[i], 0, TermH * sizeof(Display[0][0]));
1332
	(void) memset(Display[i], 0, (TermH + 1) * sizeof(Display[0][0]));
1303
    OldvcV = 0;
1333
    OldvcV = 0;
1304
    litlen = 0;
1334
    litlen = 0;
1305
}
1335
}
(-)contrib/tcsh/ed.screen.c (-16 / +20 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.78 2011/02/27 00:14:38 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $ */
2
/*
2
/*
3
 * ed.screen.c: Editor/termcap-curses interface
3
 * ed.screen.c: Editor/termcap-curses interface
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: ed.screen.c,v 3.78 2011/02/27 00:14:38 christos Exp $")
35
RCSID("$tcsh: ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tc.h"
38
#include "tc.h"
Lines 994-1000 Link Here
994
int highlighting = 0;
994
int highlighting = 0;
995
995
996
void
996
void
997
StartHighlight()
997
StartHighlight(void)
998
{
998
{
999
    (void) tputs(Str(T_mr), 1, PUTPURE);
999
    (void) tputs(Str(T_mr), 1, PUTPURE);
1000
    highlighting = 1;
1000
    highlighting = 1;
Lines 1001-1007 Link Here
1001
}
1001
}
1002
1002
1003
void
1003
void
1004
StopHighlight()
1004
StopHighlight(void)
1005
{
1005
{
1006
    (void) tputs(Str(T_me), 1, PUTPURE);
1006
    (void) tputs(Str(T_me), 1, PUTPURE);
1007
    highlighting = 0;
1007
    highlighting = 0;
Lines 1437-1443 Link Here
1437
    if (i <= 0) {
1437
    if (i <= 0) {
1438
	if (i == -1) {
1438
	if (i == -1) {
1439
#if (SYSVREL == 0) || defined(IRIS3D)
1439
#if (SYSVREL == 0) || defined(IRIS3D)
1440
	    xprintf(CGETS(7, 20, "%s: Cannot open /etc/termcap.\n"), progname);
1440
	    xprintf(CGETS(7, 20,
1441
		"%s: The terminal database could not be opened.\n"), progname);
1441
	}
1442
	}
1442
	else if (i == 0) {
1443
	else if (i == 0) {
1443
#endif /* SYSVREL */
1444
#endif /* SYSVREL */
Lines 1563-1575 Link Here
1563
#endif /* SIG_WINDOW */
1564
#endif /* SIG_WINDOW */
1564
1565
1565
#ifdef KNOWsize
1566
#ifdef KNOWsize
1566
static void
1567
static int
1567
UpdateVal(const Char *tag, int value, Char *termcap, Char *backup)
1568
UpdateVal(const Char *tag, int value, Char *termcap, Char *backup)
1568
{
1569
{
1569
    Char *ptr, *p;
1570
    Char *ptr, *p;
1570
    if ((ptr = Strstr(termcap, tag)) == NULL) {
1571
    if ((ptr = Strstr(termcap, tag)) == NULL) {
1571
	(void)Strcpy(backup, termcap);
1572
	(void)Strcpy(backup, termcap);
1572
	return;
1573
	return 0;
1573
    } else {
1574
    } else {
1574
	size_t len = (ptr - termcap) + Strlen(tag);
1575
	size_t len = (ptr - termcap) + Strlen(tag);
1575
	(void)Strncpy(backup, termcap, len);
1576
	(void)Strncpy(backup, termcap, len);
Lines 1580-1585 Link Here
1580
	ptr = Strchr(ptr, ':');
1581
	ptr = Strchr(ptr, ':');
1581
	if (ptr)
1582
	if (ptr)
1582
	    (void) Strcat(backup, ptr);
1583
	    (void) Strcat(backup, ptr);
1584
	return 1;
1583
    }
1585
    }
1584
}
1586
}
1585
#endif
1587
#endif
Lines 1625-1645 Link Here
1625
	if ((tptr = getenv("TERMCAP")) != NULL) {
1627
	if ((tptr = getenv("TERMCAP")) != NULL) {
1626
	    /* Leave 64 characters slop in case we enlarge the termcap string */
1628
	    /* Leave 64 characters slop in case we enlarge the termcap string */
1627
	    Char    termcap[TC_BUFSIZE+64], backup[TC_BUFSIZE+64], *ptr;
1629
	    Char    termcap[TC_BUFSIZE+64], backup[TC_BUFSIZE+64], *ptr;
1628
	    Char buf[4];
1630
	    int changed;
1629
1631
1630
	    ptr = str2short(tptr);
1632
	    ptr = str2short(tptr);
1631
	    (void) Strncpy(termcap, ptr, TC_BUFSIZE);
1633
	    (void) Strncpy(termcap, ptr, TC_BUFSIZE);
1632
	    termcap[TC_BUFSIZE-1] = '\0';
1634
	    termcap[TC_BUFSIZE-1] = '\0';
1633
1635
1634
	    UpdateVal(STRco, Val(T_co), termcap, backup);
1636
	    changed = UpdateVal(STRco, Val(T_co), termcap, backup);
1635
	    UpdateVal(STRli, Val(T_li), termcap, backup);
1637
	    changed |= UpdateVal(STRli, Val(T_li), termcap, backup);
1636
1638
1637
	    /*
1639
	    if (changed) {
1638
	     * Chop the termcap string at TC_BUFSIZE-1 characters to avoid
1640
		/*
1639
	     * core-dumps in the termcap routines
1641
		 * Chop the termcap string at TC_BUFSIZE-1 characters to avoid
1640
	     */
1642
		 * core-dumps in the termcap routines
1641
	    termcap[TC_BUFSIZE - 1] = '\0';
1643
		 */
1642
	    tsetenv(STRTERMCAP, termcap);
1644
		termcap[TC_BUFSIZE - 1] = '\0';
1645
		tsetenv(STRTERMCAP, termcap);
1646
	    }
1643
	}
1647
	}
1644
    }
1648
    }
1645
#endif /* KNOWsize */
1649
#endif /* KNOWsize */
(-)contrib/tcsh/ed.term.h (-3 / +11 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.18 2007/07/05 14:13:06 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 christos Exp $ */
2
/*
2
/*
3
 * ed.term.h: Local terminal header
3
 * ed.term.h: Local terminal header
4
 */
4
 */
Lines 300-309 Link Here
300
# endif /* masscomp */
300
# endif /* masscomp */
301
#endif /* CBRK */
301
#endif /* CBRK */
302
#ifndef CMIN
302
#ifndef CMIN
303
# define CMIN		CEOF
303
# if VMIN == VEOF
304
#  define CMIN		CEOF
305
# else
306
#  define CMIN		1
307
# endif
304
#endif /* CMIN */
308
#endif /* CMIN */
305
#ifndef CTIME
309
#ifndef CTIME
306
# define CTIME		CEOL
310
# if VTIME == VEOL
311
#  define CTIME		CEOL
312
# else
313
#  define CTIME		0
314
# endif
307
#endif /* CTIME */
315
#endif /* CTIME */
308
316
309
/*
317
/*
(-)contrib/tcsh/ed.xmap.c (-3 / +3 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.37 2009/06/25 21:15:37 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $ */
2
/*
2
/*
3
 * ed.xmap.c: This module contains the procedures for maintaining
3
 * ed.xmap.c: This module contains the procedures for maintaining
4
 *	      the extended-key map.
4
 *	      the extended-key map.
Lines 88-94 Link Here
88
 */
88
 */
89
#include "sh.h"
89
#include "sh.h"
90
90
91
RCSID("$tcsh: ed.xmap.c,v 3.37 2009/06/25 21:15:37 christos Exp $")
91
RCSID("$tcsh: ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $")
92
92
93
#include "ed.h"
93
#include "ed.h"
94
#include "ed.defns.h"
94
#include "ed.defns.h"
Lines 743-749 Link Here
743
	    *b++ = (unsigned char) p;
743
	    *b++ = (unsigned char) p;
744
	}
744
	}
745
	else if (p == ' ' || (Isprint(p) && !Isspace(p)))
745
	else if (p == ' ' || (Isprint(p) && !Isspace(p)))
746
	    b += one_wctomb((char *)b, p & CHAR);
746
	    b += one_wctomb((char *)b, p);
747
	else {
747
	else {
748
	    *b++ = '\\';
748
	    *b++ = '\\';
749
	    *b++ = ((p >> 6) & 7) + '0';
749
	    *b++ = ((p >> 6) & 7) + '0';
(-)contrib/tcsh/gethost.c (-15 / +27 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.15 2012/01/15 17:14:54 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $ */
2
/*
2
/*
3
 * gethost.c: Create version file from prototype
3
 * gethost.c: Create version file from prototype
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: gethost.c,v 1.15 2012/01/15 17:14:54 christos Exp $")
35
RCSID("$tcsh: gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $")
36
36
37
#ifdef SCO
37
#ifdef SCO
38
# define perror __perror
38
# define perror __perror
Lines 150-160 Link Here
150
	char *r;
150
	char *r;
151
151
152
	if (len == 0)
152
	if (len == 0)
153
		len = strlen(b);
153
		len = strlen(b) + 1;
154
	l = strlen(a) + len + 1;
154
	if (a)
155
	    l = strlen(a) + len;
156
	else
157
	    l = len;
155
	if ((r = malloc(l)) == NULL)
158
	if ((r = malloc(l)) == NULL)
156
		abort();
159
		abort();
157
	snprintf(r, l, "%s%.*s", a, (int)len, b);
160
	if (a)
161
	    snprintf(r, l, "%s%.*s", a, (int)len, b);
162
	else
163
	    snprintf(r, l, "%.*s", (int)len, b);
158
	return r;
164
	return r;
159
}
165
}
160
166
Lines 165-183 Link Here
165
	static char *buf;
171
	static char *buf;
166
	size_t len;
172
	size_t len;
167
	const char *ptr, *bptr, *eptr = NULL, *name;
173
	const char *ptr, *bptr, *eptr = NULL, *name;
168
	size_t buflen = 0;
169
174
170
	if (strstr(defs, "#machine(" /* ) */))
175
	if (strstr(defs, "#machine(" /* ) */))
171
		return defs;
176
		return defs;
177
	if (!strstr(defs, def))
178
		return defs;
172
179
173
	free(buf);
180
	free(buf);
174
	buf = strdup("("); /* ) */
181
	buf = NULL;
175
	for (ptr = defs; (bptr = strstr(ptr, def)) != NULL; ptr = eptr + 1) {
182
	for (ptr = defs; (bptr = strstr(ptr, def)) != NULL; ptr = eptr + 1) {
176
		if (ptr != bptr)
183
		if (ptr != bptr)
177
			buf = cat(buf, ptr, bptr - ptr);
184
			buf = cat(buf, ptr, bptr - ptr + 1);
185
		buf = cat(buf, "(", 0); /* ) */
178
		if ((eptr = strchr(ptr + sizeof(def) - 1, ')')) == NULL) {
186
		if ((eptr = strchr(ptr + sizeof(def) - 1, ')')) == NULL) {
179
			(void) fprintf(stderr, "%s: missing close paren `%s'\n",
187
			(void) fprintf(stderr, "%s: missing close paren `%s'\n",
180
			    pname, defs);
188
			    pname, defs);
189
			free(buf);
181
			return defs;
190
			return defs;
182
		}
191
		}
183
		buf = cat(buf, bptr, eptr - bptr + 1);
192
		buf = cat(buf, bptr, eptr - bptr + 1);
Lines 186-204 Link Here
186
		if (len < 1) {
195
		if (len < 1) {
187
			(void) fprintf(stderr, "%s: empty define `%s'\n",
196
			(void) fprintf(stderr, "%s: empty define `%s'\n",
188
			    pname, defs);
197
			    pname, defs);
198
			free(buf);
189
			return defs;
199
			return defs;
190
		}
200
		}
191
		if (*name != '_') {
201
		if (*name != '_' && (*name != 'M' && name[1] != '_')) {
192
			char *undername = malloc(len + 10);
202
			char *undername = malloc(len + 10);
193
			buf = cat(buf, " || defined(", 0);
203
			if (undername == NULL)
204
				abort();
205
			buf = cat(buf, ") || defined(", 0);
194
			snprintf(undername, len + 10, "__%.*s__)", (int)len,
206
			snprintf(undername, len + 10, "__%.*s__)", (int)len,
195
			    name);
207
			    name);
196
			buf = cat(buf, undername, len + 5);
208
			buf = cat(buf, undername, len + 5);
197
			buf = cat(buf, " || defined(", 0);
209
			buf = cat(buf, ") || defined(", 0);
198
			snprintf(undername, len + 10, "__%.*s)", (int)len,
210
			snprintf(undername, len + 10, "__%.*s)", (int)len,
199
			    name);
211
			    name);
200
			buf = cat(buf, undername, len + 3);
212
			buf = cat(buf, undername, len + 3);
201
		}
213
		}
214
		buf = cat(buf, "))", 0);
202
	}
215
	}
203
	if (!eptr) {
216
	if (!eptr) {
204
	    (void) fprintf(stderr, "%s: invalid input `%s'\n", pname, defs);
217
	    (void) fprintf(stderr, "%s: invalid input `%s'\n", pname, defs);
Lines 205-211 Link Here
205
	    return defs;
218
	    return defs;
206
        }
219
        }
207
	buf = cat(buf, eptr + 1, 0);
220
	buf = cat(buf, eptr + 1, 0);
208
	buf = cat(buf, ")", 0);
209
	return buf;
221
	return buf;
210
}
222
}
211
	
223
	
Lines 292-299 Link Here
292
			       pname, fname, lineno);
304
			       pname, fname, lineno);
293
		break;
305
		break;
294
	    }
306
	    }
295
	    (void) fprintf(stdout, "\n#if %s\n# define %s\n#endif\n\n", stmt,
307
	    (void) fprintf(stdout, "\n#if %s\n# define %s\n#endif\n\n",
296
			   defs);
308
		explode(stmt), defs);
297
	    break;
309
	    break;
298
310
299
	case T_NONE:
311
	case T_NONE:
Lines 340-346 Link Here
340
#ifdef LINEDIRECTIVE
352
#ifdef LINEDIRECTIVE
341
		(void) fprintf(stdout, "# %d \"%s\"\n", lineno + 1, fname);
353
		(void) fprintf(stdout, "# %d \"%s\"\n", lineno + 1, fname);
342
#endif /* LINEDIRECTIVE */
354
#endif /* LINEDIRECTIVE */
343
		(void) fprintf(stdout, "#if %s\n", defs);
355
		(void) fprintf(stdout, "#if (%s)\n", explode(defs));
344
		inprocess = 1;
356
		inprocess = 1;
345
	    }
357
	    }
346
	    else {
358
	    else {
(-)contrib/tcsh/glob.c (+6 lines)
Lines 59-64 Link Here
59
#include "sh.h"
59
#include "sh.h"
60
#include "glob.h"
60
#include "glob.h"
61
61
62
#ifndef HAVE_MBLEN
63
#undef mblen
64
#define mblen(_s,_n)	mbrlen((_s),(_n),NULL)
65
#endif
66
62
#undef Char
67
#undef Char
63
#undef QUOTE
68
#undef QUOTE
64
#undef TILDE
69
#undef TILDE
Lines 435-440 Link Here
435
	    dest = copy;
440
	    dest = copy;
436
	    src = pattern;
441
	    src = pattern;
437
	    while (*src != EOS) {
442
	    while (*src != EOS) {
443
		/* Don't interpret quotes. The spec does not say we should do */
438
		if (*src == QUOTE) {
444
		if (*src == QUOTE) {
439
		    if (*++src == EOS)
445
		    if (*++src == EOS)
440
			--src;
446
			--src;
(-)contrib/tcsh/host.defs (-43 / +80 lines)
Lines 1-5 Link Here
1
newcode :
1
newcode :
2
/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.55 2012/01/11 20:20:15 christos Exp $ */
2
/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $ */
3
/*
3
/*
4
 * host.defs: Hosttype/Machtype etc.
4
 * host.defs: Hosttype/Machtype etc.
5
 */
5
 */
Lines 33-50 Link Here
33
 */
33
 */
34
#include "sh.h"
34
#include "sh.h"
35
35
36
RCSID("$tcsh: host.defs,v 1.55 2012/01/11 20:20:15 christos Exp $")
36
RCSID("$tcsh: host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $")
37
37
38
endcode :
38
endcode :
39
39
40
macro	: M_mips64el : (defined(mips64) || defined(__mips64)) && (defined(MIPSEL) || defined(__MIPSEL))
40
macro	: M_mips64el : (defined(mips64) && defined(MIPSEL))
41
macro	: M_mips64eb : (defined(mips64) || defined(__mips64)) && (defined(MIPSEB) || defined(__MIPSEB))
41
macro	: M_mips64eb : (defined(mips64) && defined(MIPSEB))
42
macro	: M_mipsel : (!defined(M_mips64el)) && (defined(mips) || defined(__mips)) && (defined(MIPSEL) || defined(__MIPSEL))
42
macro	: M_mipsel : (!defined(M_mips64el) && defined(mips) && defined(MIPSEL))
43
macro	: M_mipseb : (!defined(M_mips64eb)) && (defined(mips) || defined(__mips)) && (defined(MIPSEB) || defined(__MIPSEB))
43
macro	: M_mipseb : (!defined(M_mips64eb) && defined(mips) && defined(MIPSEB))
44
macro	: M_i386 : (defined(i386) || defined(__i386__))
44
macro	: M_amd64: (defined(amd64) || defined(x86_64))
45
macro	: M_i486 : (defined(i486) || defined(__i486__))
45
macro	: M_i386 : defined(i386)
46
macro	: M_i586 : (defined(i586) || defined(__i586__))
46
macro	: M_i486 : defined(i486)
47
macro	: M_i686 : (defined(i686) || defined(__i686__))
47
macro	: M_i586 : defined(i586)
48
macro	: M_i686 : defined(i686)
48
macro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
49
macro	: M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
49
50
50
newdef	: defined(ns32000)
51
newdef	: defined(ns32000)
Lines 169-175 Link Here
169
endcode :
170
endcode :
170
enddef	:
171
enddef	:
171
172
172
newdef : defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
173
newdef : defined(linux) || defined(CYGWIN) || defined(GNU) || defined(GLIBC)
173
newcode :
174
newcode :
174
# include "tw.h"
175
# include "tw.h"
175
#include <sys/utsname.h>
176
#include <sys/utsname.h>
Lines 240-246 Link Here
240
enddef	:
241
enddef	:
241
242
242
243
243
newdef	: defined(__PARAGON__)
244
newdef	: defined(PARAGON)
244
comment : Intel Paragon running OSF/1
245
comment : Intel Paragon running OSF/1
245
vendor	:						: "intel"
246
vendor	:						: "intel"
246
hosttype:						: "paragon"
247
hosttype:						: "paragon"
Lines 277-283 Link Here
277
enddef	:
278
enddef	:
278
279
279
280
280
newdef	: defined(__hp_osf)
281
newdef	: defined(hp_osf)
281
comment : Hewlett Packard running OSF/1
282
comment : Hewlett Packard running OSF/1
282
vendor	:						: "hp"
283
vendor	:						: "hp"
283
hosttype: defined(pa_risc)				: "hp9000s700-osf1"
284
hosttype: defined(pa_risc)				: "hp9000s700-osf1"
Lines 300-306 Link Here
300
enddef	:
301
enddef	:
301
302
302
303
303
newdef	: defined(hpux) || defined(__hpux)
304
newdef	: defined(hpux)
304
comment : Hewlett Packard running HP/UX
305
comment : Hewlett Packard running HP/UX
305
vendor	:						: "hp"
306
vendor	:						: "hp"
306
hosttype: defined(hp9000s800)				: "hp9000s800"
307
hosttype: defined(hp9000s800)				: "hp9000s800"
Lines 325-338 Link Here
325
enddef	:
326
enddef	:
326
327
327
328
328
newdef	: defined(sun) || defined(__sun__)
329
newdef	: defined(sun)
329
comment : Sun Microsystems series 2 workstation (68010 based)
330
comment : Sun Microsystems series 2 workstation (68010 based)
330
comment : Sun Microsystems series 3 workstation (68020 based)
331
comment : Sun Microsystems series 3 workstation (68020 based)
331
comment : Sun Microsystems 386i workstation (386 based)
332
comment : Sun Microsystems 386i workstation (386 based)
332
comment : Sun Microsystems series 4 workstation (SPARC based)
333
comment : Sun Microsystems series 4 workstation (SPARC based)
333
vendor	:						: "sun"
334
vendor	:						: "sun"
334
hosttype: defined(M_i386) && !defined(__SVR4)		: "sun386i"
335
hosttype: defined(M_i386) && !defined(SVR4)		: "sun386i"
335
hosttype: defined(M_i386) && defined(__SVR4)		: "i86pc"
336
hosttype: defined(M_i386) && defined(SVR4)		: "i86pc"
337
hosttype: defined(M_amd64)				: "i86pc"
336
hosttype: defined(mc68010)				: "sun2"
338
hosttype: defined(mc68010)				: "sun2"
337
hosttype: defined(mc68020)				: "sun3"
339
hosttype: defined(mc68020)				: "sun3"
338
hosttype: defined(sparc)				: "sun4"
340
hosttype: defined(sparc)				: "sun4"
Lines 345-350 Link Here
345
machtype: defined(sparcv9)				: "sparcv9"
347
machtype: defined(sparcv9)				: "sparcv9"
346
machtype: defined(sparc)				: "sparc"
348
machtype: defined(sparc)				: "sparc"
347
machtype: defined(M_i386)				: "i386"
349
machtype: defined(M_i386)				: "i386"
350
machtype: defined(M_amd64)				: "amd64"
348
enddef	:
351
enddef	:
349
352
350
353
Lines 488-494 Link Here
488
enddef	:
491
enddef	:
489
492
490
493
491
newdef	: defined(__gnu_hurd__)
494
newdef	: defined(gnu_hurd)
492
comment : GNU/HURD
495
comment : GNU/HURD
493
vendor	: defined(M_intel)				: "intel"
496
vendor	: defined(M_intel)				: "intel"
494
hosttype: defined(M_i686)				: "i686"
497
hosttype: defined(M_i686)				: "i686"
Lines 503-521 Link Here
503
enddef	:
506
enddef	:
504
507
505
508
506
newdef	: defined(linux) || defined(__GNU__) || defined(__GLIBC__)
509
newdef	: defined(linux) || defined(GNU) || defined(GLIBC)
507
comment : Linus Torvalds's linux
510
comment : Linus Torvalds's linux
508
vendor	: defined(M_intel)				: "intel"
511
vendor	: defined(M_intel)				: "intel"
509
hosttype:						: gethost()
512
hosttype:						: gethost()
510
ostype	:						: getostype()
513
ostype	:						: getostype()
511
machtype:						: getmach()
514
machtype:						: getmach()
512
vendor	: defined(__ANDROID__)				: "linux"
515
vendor	: defined(ANDROID)				: "linux"
513
vendor	: defined(alpha)				: "dec"
516
vendor	: defined(alpha)				: "dec"
514
vendor	: defined(PPC)					: "apple"
517
vendor	: defined(PPC)					: "apple"
515
enddef	:
518
enddef	:
516
519
517
520
518
newdef	: defined(__EMX__)
521
newdef	: defined(EMX)
519
comment : OS/2 EMX [unix emulation under OS/2]
522
comment : OS/2 EMX [unix emulation under OS/2]
520
vendor	: defined(M_intel)				: "intel"
523
vendor	: defined(M_intel)				: "intel"
521
hosttype: defined(M_i386)				: "i386-emx"
524
hosttype: defined(M_i386)				: "i386-emx"
Lines 524-533 Link Here
524
enddef	:
527
enddef	:
525
528
526
529
527
newdef	: defined(__NetBSD__) 
530
newdef	: defined(NetBSD) 
528
comment : NetBSD
531
comment : NetBSD
529
vendor	: defined(algor)				: "algoritmics"
532
vendor	: defined(algor)				: "algoritmics"
530
vendor	: defined(arm32) || defined(__arm__)		: "acorn"
533
vendor	: defined(arm32) || defined(arm)		: "acorn"
531
vendor	: defined(alpha)				: "digital"
534
vendor	: defined(alpha)				: "digital"
532
vendor	: defined(amiga)				: "commodore"
535
vendor	: defined(amiga)				: "commodore"
533
vendor	: defined(atari)				: "atari"
536
vendor	: defined(atari)				: "atari"
Lines 543-555 Link Here
543
vendor	: defined(sparc64)				: "sun"
546
vendor	: defined(sparc64)				: "sun"
544
vendor	: defined(sun3)					: "sun"
547
vendor	: defined(sun3)					: "sun"
545
vendor	: defined(vax)					: "digital"
548
vendor	: defined(vax)					: "digital"
546
vendor	: defined(x86_64)				: "amd"
549
vendor	: defined(M_amd64)				: "amd"
547
hosttype:						: "NetBSD"
550
hosttype:						: "NetBSD"
548
ostype	:						: "NetBSD"
551
ostype	:						: "NetBSD"
549
machtype: defined(alpha)				: "alpha"
552
machtype: defined(alpha)				: "alpha"
550
machtype: defined(algor)				: "algor"
553
machtype: defined(algor)				: "algor"
551
machtype: defined(arm32) || defined(__APCS_32__)	: "arm32"
554
machtype: defined(arm32) || defined(APCS_32)		: "arm32"
552
machtype: defined(arm26) || defined(__APCS_26__)	: "arm26"
555
machtype: defined(arm26) || defined(APCS_26)		: "arm26"
553
machtype: defined(arm)					: "arm"
556
machtype: defined(arm)					: "arm"
554
machtype: defined(sparc)				: "sparc"
557
machtype: defined(sparc)				: "sparc"
555
machtype: defined(sparc64)				: "sparc64"
558
machtype: defined(sparc64)				: "sparc64"
Lines 561-574 Link Here
561
machtype: defined(pc532)				: "pc532"
564
machtype: defined(pc532)				: "pc532"
562
machtype: defined(powerpc)				: "powerpc"
565
machtype: defined(powerpc)				: "powerpc"
563
machtype: defined(vax)					: "vax"
566
machtype: defined(vax)					: "vax"
564
machtype: defined(x86_64)				: "x86_64"
567
machtype: defined(M_amd64)				: "x86_64"
565
enddef	:
568
enddef	:
566
569
570
newdef : defined(OpenBSD)
571
comment        : OpenBSD
572
vendor : defined(alpha)					: "digital"
573
vendor : defined(M_amd64)				: "amd"
574
vendor : defined(arm)					: "arm"
575
vendor : defined(hppa) || defined(hppa64)		: "hp"
576
vendor : defined(M_intel)				: "intel"
577
vendor : defined(m68k)					: "motorola"
578
vendor : defined(m88k)					: "motorola"
579
vendor : defined(mips) && defined(sgi)			: "sgi"
580
vendor : defined(powerpc)				: "motorola"
581
vendor : defined(sh)					: "io-data"
582
vendor : defined(sparc) || defined(sparc64)		: "sun"
583
vendor : defined(vax)					: "digital"
584
hosttype:						: "OpenBSD"
585
ostype :						: "OpenBSD"
586
machtype: defined(alpha)				: "alpha"
587
machtype: defined(M_amd64)				: "amd64"
588
machtype: defined(arm)					: "arm"
589
machtype: defined(hppa)					: "hppa"
590
machtype: defined(hppa64)				: "hppa64"
591
machtype: defined(M_i386)				: "i386"
592
machtype: defined(m68k)					: "m68k"
593
machtype: defined(m88k)					: "m88k"
594
machtype: defined(mips)					: "mips"
595
machtype: defined(sh)					: "sh"
596
machtype: defined(sparc64)				: "sparc64"
597
machtype: defined(sparc)				: "sparc"
598
machtype: defined(powerpc)				: "powerpc"
599
machtype: defined(vax)					: "vax"
600
enddef :
567
601
568
newdef	: defined(__FreeBSD__) 
602
603
newdef	: defined(FreeBSD) 
569
comment : FreeBSD
604
comment : FreeBSD
570
vendor	: defined(alpha)				: "digital"
605
vendor	: defined(alpha)				: "digital"
571
vendor	: defined(arm32) || defined(__arm__)		: "acorn"
606
vendor	: defined(arm32) || defined(arm)		: "acorn"
572
vendor	: defined(M_intel)				: "intel"
607
vendor	: defined(M_intel)				: "intel"
573
vendor	: defined(ia64)					: "intel"
608
vendor	: defined(ia64)					: "intel"
574
vendor	: defined(mips)					: "mips"
609
vendor	: defined(mips)					: "mips"
Lines 575-585 Link Here
575
vendor	: defined(powerpc)				: "motorola"
610
vendor	: defined(powerpc)				: "motorola"
576
vendor	: defined(sparc)				: "sun"
611
vendor	: defined(sparc)				: "sun"
577
vendor	: defined(sparc64)				: "sun"
612
vendor	: defined(sparc64)				: "sun"
578
vendor	: defined(x86_64)				: "amd"
613
vendor	: defined(M_amd64)				: "amd"
579
hosttype:						: "FreeBSD"
614
hosttype:						: "FreeBSD"
580
ostype	:						: "FreeBSD"
615
ostype	:						: "FreeBSD"
581
machtype: defined(alpha)				: "alpha"
616
machtype: defined(alpha)				: "alpha"
582
machtype: defined(arm32) || defined(__APCS_32__)	: "arm32"
617
machtype: defined(arm32) || defined(APCS_32)		: "arm32"
583
machtype: defined(arm)					: "arm"
618
machtype: defined(arm)					: "arm"
584
machtype: defined(ia64)					: "ia64"
619
machtype: defined(ia64)					: "ia64"
585
machtype: defined(M_i386)				: "i386"
620
machtype: defined(M_i386)				: "i386"
Lines 587-597 Link Here
587
machtype: defined(powerpc)				: "powerpc"
622
machtype: defined(powerpc)				: "powerpc"
588
machtype: defined(sparc)				: "sparc"
623
machtype: defined(sparc)				: "sparc"
589
machtype: defined(sparc64)				: "sparc64"
624
machtype: defined(sparc64)				: "sparc64"
590
machtype: defined(x86_64)				: "x86_64"
625
machtype: defined(M_amd64)				: "x86_64"
591
enddef	:
626
enddef	:
592
627
593
628
594
newdef	: defined(__MidnightBSD__)
629
newdef	: defined(MidnightBSD)
595
comment : MidnightBSD
630
comment : MidnightBSD
596
vendor	: defined(M_intel)				: "intel"
631
vendor	: defined(M_intel)				: "intel"
597
hosttype:						: "MidnightBSD"
632
hosttype:						: "MidnightBSD"
Lines 819-831 Link Here
819
enddef	:
854
enddef	:
820
855
821
856
822
newdef	: defined(__APPLE__) && defined(__MACH__)
857
newdef	: defined(APPLE) && defined(MACH)
823
comment : OS X
858
comment : OS X
824
vendor	:						: "apple"
859
vendor	:						: "apple"
825
hosttype: defined(i386)					: "intel-pc"
860
hosttype: defined(i386)					: "intel-pc"
826
hosttype: defined(ppc)					: "powermac"
861
hosttype: defined(ppc)					: "powermac"
862
hosttype: defined(M_amd64)				: "amd"
827
ostype	:						: "darwin"
863
ostype	:						: "darwin"
828
machtype: defined(i386)					: "i386"
864
machtype: defined(i386)					: "i386"
865
machtype: defined(M_amd64)				: "x86_64"
829
machtype: defined(ppc)					: "powerpc"
866
machtype: defined(ppc)					: "powerpc"
830
enddef	:
867
enddef	:
831
868
Lines 855-861 Link Here
855
enddef	:
892
enddef	:
856
893
857
894
858
newdef	: defined(ultrix) || defined(__ultrix)
895
newdef	: defined(ultrix)
859
comment : Digital's Ultrix 
896
comment : Digital's Ultrix 
860
vendor	:						: "dec"
897
vendor	:						: "dec"
861
hosttype: defined(M_mipsel)				: "decstation"
898
hosttype: defined(M_mipsel)				: "decstation"
Lines 917-923 Link Here
917
ostype	:						: "masscomp"
954
ostype	:						: "masscomp"
918
enddef	:
955
enddef	:
919
956
920
newdef	: defined(__MACHTEN__)
957
newdef	: defined(MACHTEN)
921
comment : Machintosh
958
comment : Machintosh
922
vendor	:						: "Tenon"
959
vendor	:						: "Tenon"
923
hosttype:						: "Macintosh"
960
hosttype:						: "Macintosh"
Lines 1040-1046 Link Here
1040
enddef	:
1077
enddef	:
1041
1078
1042
1079
1043
newdef	: defined(__DGUX__)
1080
newdef	: defined(DGUX)
1044
comment : Data-General AViiON running DGUX
1081
comment : Data-General AViiON running DGUX
1045
hosttype:						: "aviion"
1082
hosttype:						: "aviion"
1046
ostype	:						: "dgux"
1083
ostype	:						: "dgux"
Lines 1074-1080 Link Here
1074
enddef	:
1111
enddef	:
1075
1112
1076
1113
1077
newdef	: defined(__clipper__)
1114
newdef	: defined(clipper)
1078
comment : Clipper Chipset (Intergraph)
1115
comment : Clipper Chipset (Intergraph)
1079
vendor	:						: "intergraph"
1116
vendor	:						: "intergraph"
1080
hosttype:						: "clipper"
1117
hosttype:						: "clipper"
Lines 1081-1087 Link Here
1081
machtype:						: "clipper"
1118
machtype:						: "clipper"
1082
enddef	:
1119
enddef	:
1083
1120
1084
newdef : defined(__QNX__)
1121
newdef : defined(QNX)
1085
ostype :						: "qnx"
1122
ostype :						: "qnx"
1086
enddef :
1123
enddef :
1087
1124
Lines 1110-1116 Link Here
1110
machtype:						: "bs2000"
1147
machtype:						: "bs2000"
1111
enddef	:
1148
enddef	:
1112
1149
1113
newdef	: defined(__MVS__)
1150
newdef	: defined(MVS)
1114
comment : ibm uss s/390 (mainframe, EBCDIC)
1151
comment : ibm uss s/390 (mainframe, EBCDIC)
1115
vendor	:						: "ibm"
1152
vendor	:						: "ibm"
1116
hosttype:						: "s390"
1153
hosttype:						: "s390"
Lines 1134-1140 Link Here
1134
machtype: defined(M_i386)				: "i386"
1171
machtype: defined(M_i386)				: "i386"
1135
enddef	:
1172
enddef	:
1136
1173
1137
newdef	: defined(__uxp__) || defined(__uxps__)
1174
newdef	: defined(uxp) || defined(uxps)
1138
comment : FUJITSU DS/90 7000
1175
comment : FUJITSU DS/90 7000
1139
vendor	:						: "fujitsu"
1176
vendor	:						: "fujitsu"
1140
hosttype:						: "ds90"
1177
hosttype:						: "ds90"
Lines 1142-1150 Link Here
1142
machtype:						: "sparc"
1179
machtype:						: "sparc"
1143
enddef	:
1180
enddef	:
1144
1181
1145
newdef	: defined(__CYGWIN__)
1182
newdef	: defined(CYGWIN)
1146
comment : Cygwin
1183
comment : Cygwin
1147
vendor	:						: "intel"
1184
vendor	: defined(M_intel)				: "intel"
1148
hosttype:						: gethost()
1185
hosttype:						: gethost()
1149
ostype	:						: getostype()
1186
ostype	:						: getostype()
1150
machtype:						: getmach()
1187
machtype:						: getmach()
(-)contrib/tcsh/nls/C/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.6 2006/03/02 18:46:45 christos Exp $
1
$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Syntax Error
4
1 Syntax Error
Lines 8-14 Link Here
8
5 No file for $0
8
5 No file for $0
9
6 Incomplete [] modifier
9
6 Incomplete [] modifier
10
7 $ expansion must end before ]
10
7 $ expansion must end before ]
11
8 Bad : modifier in $ (%c)
11
8 Bad : modifier in $ '%c'
12
9 Subscript error
12
9 Subscript error
13
10 Badly formed number
13
10 Badly formed number
14
11 No more words
14
11 No more words
Lines 51-58 Link Here
51
48 Not in while/foreach
51
48 Not in while/foreach
52
49 No more processes
52
49 No more processes
53
50 No match
53
50 No match
54
51 Missing %c
54
51 Missing '%c'
55
52 Unmatched %c
55
52 Unmatched '%c'
56
53 Out of memory
56
53 Out of memory
57
54 Can't make pipe
57
54 Can't make pipe
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Bad substitute
93
90 Bad substitute
94
91 No previous left hand side
94
91 No previous left hand side
95
92 Right hand side too long
95
92 Right hand side too long
96
93 Bad ! modifier: %c
96
93 Bad ! modifier: '%c'
97
94 Modifier failed
97
94 Modifier failed
98
95 Substitution buffer overflow
98
95 Substitution buffer overflow
99
96 Bad ! arg selector
99
96 Bad ! arg selector
Lines 118-124 Link Here
118
115 Out of termcap string space
118
115 Out of termcap string space
119
116 Usage: settc %s [yes|no]
119
116 Usage: settc %s [yes|no]
120
117 Unknown capability `%s'
120
117 Unknown capability `%s'
121
118 Unknown termcap parameter `%%%c'
121
118 Unknown termcap parameter '%%%c'
122
119 Too many arguments for `%s' (%d)
122
119 Too many arguments for `%s' (%d)
123
120 `%s' requires %d arguments
123
120 `%s' requires %d arguments
124
121 Usage: echotc [-v|-s] [<capability> [<args>]]
124
121 Usage: echotc [-v|-s] [<capability> [<args>]]
Lines 137-140 Link Here
137
134 Usage: unlimit [-fh] [limits]
137
134 Usage: unlimit [-fh] [limits]
138
135 $%S is read-only
138
135 $%S is read-only
139
136 No such job
139
136 No such job
140
137 Unknown colorls variable `%c%c'
140
137 Unknown colorls variable '%c%c'
(-)contrib/tcsh/nls/C/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.3 2006/03/02 18:46:45 christos Exp $
1
$ $tcsh: set20,v 1.4 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Invalid key name `%S'\n
4
1 Invalid key name `%S'\n
Lines 19-25 Link Here
19
16     -c   interpret COMMAND as a builtin or external command\n
19
16     -c   interpret COMMAND as a builtin or external command\n
20
17     -v   bind all keys to vi bindings\n
20
17     -v   bind all keys to vi bindings\n
21
18     -e   bind all keys to emacs bindings\n
21
18     -e   bind all keys to emacs bindings\n
22
19     -d   bind all keys to default editor's bindings\n
22
19     -d   bind all keys to default editor's bindings (%s)\n
23
20     -l   list editor commands with descriptions\n
23
20     -l   list editor commands with descriptions\n
24
21     -r   remove KEY's binding\n
24
21     -r   remove KEY's binding\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
(-)contrib/tcsh/nls/C/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.3 2006/03/02 18:46:45 christos Exp $
1
$ $tcsh: set9,v 1.4 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
4
1 AddXkey: Null extended-key not allowed.\n
Lines 8-12 Link Here
8
5 Some extended keys too long for internal print buffer
8
5 Some extended keys too long for internal print buffer
9
6 Enumerate: BUG!! Null ptr passed\n!
9
6 Enumerate: BUG!! Null ptr passed\n!
10
7 no input
10
7 no input
11
8 Something must follow: %c\n
11
8 Something must follow: '%c'\n
12
9 Octal constant does not fit in a char.\n
12
9 Octal constant does not fit in a char.\n
(-)contrib/tcsh/nls/Makefile.in (-15 / +15 lines)
Lines 1-4 Link Here
1
# $tcsh: Makefile.in,v 1.13 2012/01/05 16:54:25 christos Exp $
1
# $tcsh: Makefile.in,v 1.16 2014/07/23 18:18:07 christos Exp $
2
2
3
CATALOGS=	C.cat et.cat finnish.cat french.cat german.cat greek.cat \
3
CATALOGS=	C.cat et.cat finnish.cat french.cat german.cat greek.cat \
4
		italian.cat ja.cat pl.cat russian.cat spanish.cat ukrainian.cat
4
		italian.cat ja.cat pl.cat russian.cat spanish.cat ukrainian.cat
Lines 19-25 Link Here
19
INSTALLED+=${localedir}/C/LC_MESSAGES/tcsh.cat
19
INSTALLED+=${localedir}/C/LC_MESSAGES/tcsh.cat
20
${localedir}/C/LC_MESSAGES/tcsh.cat:	C.cat
20
${localedir}/C/LC_MESSAGES/tcsh.cat:	C.cat
21
	mkdir -p $(@D)
21
	mkdir -p $(@D)
22
	$(INSTALL) $< $@
22
	$(INSTALL) $> $^ $@
23
23
24
C.cat: ${srcdir}/C/charset ${srcdir}/C/*set[0-9]*
24
C.cat: ${srcdir}/C/charset ${srcdir}/C/*set[0-9]*
25
	@${CATGEN} $(GENCAT) $@ $^ $>
25
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 27-33 Link Here
27
INSTALLED+=${localedir}/et/LC_MESSAGES/tcsh.cat
27
INSTALLED+=${localedir}/et/LC_MESSAGES/tcsh.cat
28
${localedir}/et/LC_MESSAGES/tcsh.cat:	et.cat
28
${localedir}/et/LC_MESSAGES/tcsh.cat:	et.cat
29
	mkdir -p $(@D)
29
	mkdir -p $(@D)
30
	$(INSTALL) $< $@
30
	$(INSTALL) $> $^ $@
31
31
32
et.cat: ${srcdir}/et/charset ${srcdir}/et/*set[0-9]*
32
et.cat: ${srcdir}/et/charset ${srcdir}/et/*set[0-9]*
33
	@${CATGEN} $(GENCAT) $@ $^ $>
33
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 35-41 Link Here
35
INSTALLED+=${localedir}/fi/LC_MESSAGES/tcsh.cat
35
INSTALLED+=${localedir}/fi/LC_MESSAGES/tcsh.cat
36
${localedir}/fi/LC_MESSAGES/tcsh.cat:	finnish.cat
36
${localedir}/fi/LC_MESSAGES/tcsh.cat:	finnish.cat
37
	mkdir -p $(@D)
37
	mkdir -p $(@D)
38
	$(INSTALL) $< $@
38
	$(INSTALL) $> $^ $@
39
39
40
finnish.cat: ${srcdir}/finnish/charset ${srcdir}/finnish/*set[0-9]*
40
finnish.cat: ${srcdir}/finnish/charset ${srcdir}/finnish/*set[0-9]*
41
	@${CATGEN} $(GENCAT) $@ $^ $>
41
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 43-49 Link Here
43
INSTALLED+=${localedir}/fr/LC_MESSAGES/tcsh.cat
43
INSTALLED+=${localedir}/fr/LC_MESSAGES/tcsh.cat
44
${localedir}/fr/LC_MESSAGES/tcsh.cat:	french.cat
44
${localedir}/fr/LC_MESSAGES/tcsh.cat:	french.cat
45
	mkdir -p $(@D)
45
	mkdir -p $(@D)
46
	$(INSTALL) $< $@
46
	$(INSTALL) $> $^ $@
47
47
48
french.cat: ${srcdir}/french/charset ${srcdir}/french/*set[0-9]*
48
french.cat: ${srcdir}/french/charset ${srcdir}/french/*set[0-9]*
49
	@${CATGEN} $(GENCAT) $@ $^ $>
49
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 51-57 Link Here
51
INSTALLED+=${localedir}/de/LC_MESSAGES/tcsh.cat
51
INSTALLED+=${localedir}/de/LC_MESSAGES/tcsh.cat
52
${localedir}/de/LC_MESSAGES/tcsh.cat:	german.cat
52
${localedir}/de/LC_MESSAGES/tcsh.cat:	german.cat
53
	mkdir -p $(@D)
53
	mkdir -p $(@D)
54
	$(INSTALL) $< $@
54
	$(INSTALL) $> $^ $@
55
55
56
german.cat: ${srcdir}/german/charset ${srcdir}/german/*set[0-9]*
56
german.cat: ${srcdir}/german/charset ${srcdir}/german/*set[0-9]*
57
	@${CATGEN} $(GENCAT) $@ $^ $>
57
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 59-65 Link Here
59
INSTALLED+=${localedir}/gr/LC_MESSAGES/tcsh.cat
59
INSTALLED+=${localedir}/gr/LC_MESSAGES/tcsh.cat
60
${localedir}/gr/LC_MESSAGES/tcsh.cat:	greek.cat
60
${localedir}/gr/LC_MESSAGES/tcsh.cat:	greek.cat
61
	mkdir -p $(@D)
61
	mkdir -p $(@D)
62
	$(INSTALL) $< $@
62
	$(INSTALL) $> $^ $@
63
63
64
greek.cat: ${srcdir}/greek/charset ${srcdir}/greek/*set[0-9]*
64
greek.cat: ${srcdir}/greek/charset ${srcdir}/greek/*set[0-9]*
65
	@${CATGEN} $(GENCAT) $@ $^ $>
65
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 67-73 Link Here
67
INSTALLED+=${localedir}/it/LC_MESSAGES/tcsh.cat
67
INSTALLED+=${localedir}/it/LC_MESSAGES/tcsh.cat
68
${localedir}/it/LC_MESSAGES/tcsh.cat:	italian.cat
68
${localedir}/it/LC_MESSAGES/tcsh.cat:	italian.cat
69
	mkdir -p $(@D)
69
	mkdir -p $(@D)
70
	$(INSTALL) $< $@
70
	$(INSTALL) $> $^ $@
71
71
72
italian.cat: ${srcdir}/italian/charset ${srcdir}/italian/*set[0-9]*
72
italian.cat: ${srcdir}/italian/charset ${srcdir}/italian/*set[0-9]*
73
	@${CATGEN} $(GENCAT) $@ $^ $>
73
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 75-81 Link Here
75
INSTALLED+=${localedir}/ja/LC_MESSAGES/tcsh.cat
75
INSTALLED+=${localedir}/ja/LC_MESSAGES/tcsh.cat
76
${localedir}/ja/LC_MESSAGES/tcsh.cat:	ja.cat
76
${localedir}/ja/LC_MESSAGES/tcsh.cat:	ja.cat
77
	mkdir -p $(@D)
77
	mkdir -p $(@D)
78
	$(INSTALL) $< $@
78
	$(INSTALL) $> $^ $@
79
79
80
ja.cat: ${srcdir}/ja/charset ${srcdir}/ja/*set[0-9]*
80
ja.cat: ${srcdir}/ja/charset ${srcdir}/ja/*set[0-9]*
81
	@${CATGEN} $(GENCAT) $@ $^ $>
81
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 83-89 Link Here
83
INSTALLED+=${localedir}/pl/LC_MESSAGES/tcsh.cat
83
INSTALLED+=${localedir}/pl/LC_MESSAGES/tcsh.cat
84
${localedir}/pl/LC_MESSAGES/tcsh.cat:	pl.cat
84
${localedir}/pl/LC_MESSAGES/tcsh.cat:	pl.cat
85
	mkdir -p $(@D)
85
	mkdir -p $(@D)
86
	$(INSTALL) $< $@
86
	$(INSTALL) $> $^ $@
87
87
88
pl.cat: ${srcdir}/pl/charset ${srcdir}/pl/*set[0-9]*
88
pl.cat: ${srcdir}/pl/charset ${srcdir}/pl/*set[0-9]*
89
	@${CATGEN} $(GENCAT) $@ $^ $>
89
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 91-97 Link Here
91
INSTALLED+=${localedir}/ru/LC_MESSAGES/tcsh.cat
91
INSTALLED+=${localedir}/ru/LC_MESSAGES/tcsh.cat
92
${localedir}/ru/LC_MESSAGES/tcsh.cat:	russian.cat
92
${localedir}/ru/LC_MESSAGES/tcsh.cat:	russian.cat
93
	mkdir -p $(@D)
93
	mkdir -p $(@D)
94
	$(INSTALL) $< $@
94
	$(INSTALL) $> $^ $@
95
95
96
russian.cat: ${srcdir}/russian/charset ${srcdir}/russian/*set[0-9]*
96
russian.cat: ${srcdir}/russian/charset ${srcdir}/russian/*set[0-9]*
97
	@${CATGEN} $(GENCAT) $@ $^ $>
97
	@${CATGEN} $(GENCAT) $@ $^ $>
Lines 99-113 Link Here
99
INSTALLED+=${localedir}/es/LC_MESSAGES/tcsh.cat
99
INSTALLED+=${localedir}/es/LC_MESSAGES/tcsh.cat
100
${localedir}/es/LC_MESSAGES/tcsh.cat:	spanish.cat
100
${localedir}/es/LC_MESSAGES/tcsh.cat:	spanish.cat
101
	mkdir -p $(@D)
101
	mkdir -p $(@D)
102
	$(INSTALL) $< $@
102
	$(INSTALL) $> $^ $@
103
103
104
spanish.cat: ${srcdir}/spanish/charset ${srcdir}/spanish/*set[0-9]*
104
spanish.cat: ${srcdir}/spanish/charset ${srcdir}/spanish/*set[0-9]*
105
	@${CATGEN} $(GENCAT) $@ $^ $>
105
	@${CATGEN} $(GENCAT) $@ $^ $>
106
106
107
INSTALLED+=${localedir}/ru_UA.koi8u/LC_MESSAGES/tcsh.cat
107
INSTALLED+=${localedir}/ru_UA/LC_MESSAGES/tcsh.cat
108
${localedir}/ru_UA.koi8u/LC_MESSAGES/tcsh.cat:	ukrainian.cat
108
${localedir}/ru_UA/LC_MESSAGES/tcsh.cat:	ukrainian.cat
109
	mkdir -p $(@D)
109
	mkdir -p $(@D)
110
	$(INSTALL) $< $@
110
	$(INSTALL) $> $^ $@
111
111
112
ukrainian.cat: ${srcdir}/ukrainian/charset ${srcdir}/ukrainian/*set[0-9]*
112
ukrainian.cat: ${srcdir}/ukrainian/charset ${srcdir}/ukrainian/*set[0-9]*
113
	@${CATGEN} $(GENCAT) $@ $^ $>
113
	@${CATGEN} $(GENCAT) $@ $^ $>
(-)contrib/tcsh/nls/catgen (-1 / +9 lines)
Lines 3-12 Link Here
3
TMP=/tmp/catgen.$$
3
TMP=/tmp/catgen.$$
4
trap "rm -f $TMP" 0 1 2 3 15
4
trap "rm -f $TMP" 0 1 2 3 15
5
5
6
sortit() {
7
	awk '/^\$set/ {print $2, FILENAME}' "$@" | sort -n | cut -d ' ' -f 2
8
}
9
6
GENCAT="$1"
10
GENCAT="$1"
7
shift
11
shift
8
OUT="$1"
12
OUT="$1"
9
shift
13
shift
10
cat "$@" > "$TMP"
14
CHARSET="$1"
15
shift
16
cat "${CHARSET}" $(sortit "$@") > "$TMP"
17
11
echo "$(basename "$OUT" .cat)"
18
echo "$(basename "$OUT" .cat)"
12
"${GENCAT}" "$OUT" "$TMP"
19
"${GENCAT}" "$OUT" "$TMP"
20
exit 0
(-)contrib/tcsh/nls/et/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.4 2011/02/04 18:19:33 christos Exp $
1
$ $tcsh: set1,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Süntaksi viga
4
1 Süntaksi viga
Lines 8-14 Link Here
8
5 $0 jaoks pole faili
8
5 $0 jaoks pole faili
9
6 Mittetäielik [] muutja
9
6 Mittetäielik [] muutja
10
7 $ laiendus peab lõppema enne ]
10
7 $ laiendus peab lõppema enne ]
11
8 Halb : täiendaja $ (%c)
11
8 Halb : täiendaja $ '%c'
12
9 Viga indeksis
12
9 Viga indeksis
13
10 Vigane number
13
10 Vigane number
14
11 Sõnad on otsas
14
11 Sõnad on otsas
Lines 51-58 Link Here
51
48 Pole while/foreach sees
51
48 Pole while/foreach sees
52
49 Protsessid on otsas
52
49 Protsessid on otsas
53
50 Ei leia
53
50 Ei leia
54
51 Puuduv %c
54
51 Puuduv '%c'
55
52 Ei leia sümbolit %c
55
52 Ei leia sümbolit '%c'
56
53 Mälu on otsas
56
53 Mälu on otsas
57
54 Toru ei saa luua
57
54 Toru ei saa luua
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Vigane asendamine
93
90 Vigane asendamine
94
91 Eelmist vasakut poolt pole
94
91 Eelmist vasakut poolt pole
95
92 Parem pool on liiga pikk
95
92 Parem pool on liiga pikk
96
93 Vigane ! modifikaator: %c
96
93 Vigane ! modifikaator: '%c'
97
94 Modifikaator ebaõnnestus
97
94 Modifikaator ebaõnnestus
98
95 Asenduse puhvri ületäitumine
98
95 Asenduse puhvri ületäitumine
99
96 Vigane ! argumendi valik
99
96 Vigane ! argumendi valik
Lines 118-124 Link Here
118
115 Termcap sõne on liiga pikk
118
115 Termcap sõne on liiga pikk
119
116 Kasuta: settc %s [yes|no]
119
116 Kasuta: settc %s [yes|no]
120
117 Tundmatu omadus `%s'
120
117 Tundmatu omadus `%s'
121
118 Tundmatu termcap parameeter `%%%c'
121
118 Tundmatu termcap parameeter '%%%c'
122
119 `%s' jaoks on liiga palju argumente (%d)
122
119 `%s' jaoks on liiga palju argumente (%d)
123
120 `%s' nõuab %d argumenti
123
120 `%s' nõuab %d argumenti
124
121 Kasuta: echotc [-v|-s] [<omadus> [<argumendid>]]
124
121 Kasuta: echotc [-v|-s] [<omadus> [<argumendid>]]
Lines 137-140 Link Here
137
134 Kasuta: unlimit [-fh] [limiidid]
137
134 Kasuta: unlimit [-fh] [limiidid]
138
135 $%S on ainult lugemiseks
138
135 $%S on ainult lugemiseks
139
136 Pole sellist tööd
139
136 Pole sellist tööd
140
137 Tundmatu colorls muutuja `%c%c'
140
137 Tundmatu colorls muutuja '%c%c'
(-)contrib/tcsh/nls/et/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.3 2011/02/04 18:19:33 christos Exp $
1
$ $tcsh: set20,v 1.4 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Vigane klahvi nimi `%S'\n
4
1 Vigane klahvi nimi `%S'\n
Lines 19-25 Link Here
19
16     -c   käsitle COMMAND kui sisemist või välist käsku\n
19
16     -c   käsitle COMMAND kui sisemist või välist käsku\n
20
17     -v   seo kõik klahvid vi seostega\n
20
17     -v   seo kõik klahvid vi seostega\n
21
18     -e   seo kõik klahvid emacsi seostega\n
21
18     -e   seo kõik klahvid emacsi seostega\n
22
19     -d   seo kõik klahvid vaikimisi toimeti seostega\n
22
19     -d   seo kõik klahvid vaikimisi toimeti seostega (%s)\n
23
20     -l   esita toimeti käsud koos kirjeldustega\n
23
20     -l   esita toimeti käsud koos kirjeldustega\n
24
21     -r   kustuta KLAHVILT seos\n
24
21     -r   kustuta KLAHVILT seos\n
25
22     -k   kasuta KLAHVI kui noole-klahvi sümbolnime\n
25
22     -k   kasuta KLAHVI kui noole-klahvi sümbolnime\n
(-)contrib/tcsh/nls/et/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.3 2011/02/04 18:19:34 christos Exp $
1
$ $tcsh: set9,v 1.4 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null pikkusega laiend-klahv ei ole lubatud.\n
4
1 AddXkey: Null pikkusega laiend-klahv ei ole lubatud.\n
Lines 8-12 Link Here
8
5 Mõned laiendatud klahvid on sisemise trükipuhvri jaoks liiga pikad
8
5 Mõned laiendatud klahvid on sisemise trükipuhvri jaoks liiga pikad
9
6 Enumerate: BUG!! Null viit anti\n!
9
6 Enumerate: BUG!! Null viit anti\n!
10
7 sisendit pole
10
7 sisendit pole
11
8 Midagi peab järgnema: %c\n
11
8 Midagi peab järgnema: '%c'\n
12
9 kaheksand-konstant ei mahu sümbolisse.\n
12
9 kaheksand-konstant ei mahu sümbolisse.\n
(-)contrib/tcsh/nls/finnish/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.4 2011/02/04 18:19:34 christos Exp $
1
$ $tcsh: set1,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Kielioppivirhe
4
1 Kielioppivirhe
Lines 8-14 Link Here
8
5 Puuttuva tiedosto $0
8
5 Puuttuva tiedosto $0
9
6 Vajavainen [] muunnos
9
6 Vajavainen [] muunnos
10
7 $ -laajennuksen on päätyttävä ennen ']'-merkkiä
10
7 $ -laajennuksen on päätyttävä ennen ']'-merkkiä
11
8 Virheellinen : -muunnos $ (%c)
11
8 Virheellinen : -muunnos $ '%c'
12
9 Indeksivirhe
12
9 Indeksivirhe
13
10 Virheellinen numero
13
10 Virheellinen numero
14
11 Liian vähän sanoja
14
11 Liian vähän sanoja
Lines 51-58 Link Here
51
48 Silmukan (while/foreach) ulkopuolella
51
48 Silmukan (while/foreach) ulkopuolella
52
49 Lisää prosesseja ei voida luoda
52
49 Lisää prosesseja ei voida luoda
53
50 Ei vastaavuuksia (match)
53
50 Ei vastaavuuksia (match)
54
51 Puuttuva %c
54
51 Puuttuva '%c'
55
52 Ylimääräinen/pariton %c
55
52 Ylimääräinen/pariton '%c'
56
53 Muisti loppu
56
53 Muisti loppu
57
54 Putkea ei voida luoda
57
54 Putkea ei voida luoda
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Virheellinen korvaava merkkijono
93
90 Virheellinen korvaava merkkijono
94
91 Edellistä vasemmanpuolista merkkijonoa ei ole
94
91 Edellistä vasemmanpuolista merkkijonoa ei ole
95
92 Oikeanpuolinen merkkijono on liian pitkä
95
92 Oikeanpuolinen merkkijono on liian pitkä
96
93 Virheellinen ! -muunnos: %c
96
93 Virheellinen ! -muunnos: '%c'
97
94 Muunnos epäonnistui
97
94 Muunnos epäonnistui
98
95 Korvauspuskurin ylivuoto
98
95 Korvauspuskurin ylivuoto
99
96 Virheellinen ! argumenttivalitsin
99
96 Virheellinen ! argumenttivalitsin
Lines 118-124 Link Here
118
115 Päätetyypin kuvaukselle (termcap) ei ole tarpeeksi tilaa
118
115 Päätetyypin kuvaukselle (termcap) ei ole tarpeeksi tilaa
119
116 Käyttö: settc %s [yes|no]
119
116 Käyttö: settc %s [yes|no]
120
117 Tuntematon toiminne `%s'
120
117 Tuntematon toiminne `%s'
121
118 Tuntematon päätetyypin (termcap) parameteri `%%%c'
121
118 Tuntematon päätetyypin (termcap) parameteri '%%%c'
122
119 Liian paljon argumentteja käskylle `%s' (%d)
122
119 Liian paljon argumentteja käskylle `%s' (%d)
123
120 `%s' edellyttää %d argumenttia
123
120 `%s' edellyttää %d argumenttia
124
121 Käyttö: echotc [-v|-s] [<toiminne> [<argumentit>]]
124
121 Käyttö: echotc [-v|-s] [<toiminne> [<argumentit>]]
Lines 137-140 Link Here
137
134 Käyttö: unlimit [-fh] [rajoitteet (limits)]
137
134 Käyttö: unlimit [-fh] [rajoitteet (limits)]
138
135 Muuttujalle $%S ei voida asettaa arvoa
138
135 Muuttujalle $%S ei voida asettaa arvoa
139
136 Viitattua työtä ei ole
139
136 Viitattua työtä ei ole
140
137 Tuntematon colorls-muuttuja `%c%c'
140
137 Tuntematon colorls-muuttuja '%c%c'
(-)contrib/tcsh/nls/finnish/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.4 2011/02/04 18:19:34 christos Exp $
1
$ $tcsh: set20,v 1.5 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Invalid key name `%S'\n
4
1 Invalid key name `%S'\n
Lines 19-25 Link Here
19
16     -c   interpret COMMAND as a builtin or external command\n
19
16     -c   interpret COMMAND as a builtin or external command\n
20
17     -v   bind all keys to vi bindings\n
20
17     -v   bind all keys to vi bindings\n
21
18     -e   bind all keys to emacs bindings\n
21
18     -e   bind all keys to emacs bindings\n
22
19     -d   bind all keys to default editor's bindings\n
22
19     -d   bind all keys to default editor's bindings (%s)\n
23
20     -l   list editor commands with descriptions\n
23
20     -l   list editor commands with descriptions\n
24
21     -r   remove KEY's binding\n
24
21     -r   remove KEY's binding\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
(-)contrib/tcsh/nls/finnish/set3 (-8 / +8 lines)
Lines 1-4 Link Here
1
$ $tcsh: set3,v 1.4 2011/02/04 18:19:34 christos Exp $
1
$ $tcsh: set3,v 1.5 2015/09/01 14:08:28 kim Exp $
2
$ Editor function descriptions
2
$ Editor function descriptions
3
$set 3 
3
$set 3 
4
1 Siirry taaksepäin yksi merkki
4
1 Siirry taaksepäin yksi merkki
Lines 114-124 Link Here
114
111 Vi: peruuta muutos
114
111 Vi: peruuta muutos
115
112 Vi: siirry rivin alkuun
115
112 Vi: siirry rivin alkuun
116
113 Suorita 'which' tälle komennolle
116
113 Suorita 'which' tälle komennolle
117
114 Liimaa/lisää leikkauspuskurin sisältö kursorin paikalle
117
114 Liitä leikkauspuskurin sisältö kursorin paikalle
118
115 Korvaa viimeksi liimattu teksti aikaisemmalla leikkauksella
118
115 Korvaa viimeksi liimattu teksti aikaisemmalla leikkauksella
119
116 (WIN32 only) Copy cut buffer to system clipboard
119
116 (Vain WIN32) Kopioi leikkauspuskuri leikepöydälle
120
117 (WIN32 only) Paste clipboard buffer at cursor position
120
117 (Vain WIN32) Liitä leikepöydän sisältö kursorin paikalle
121
118 (WIN32 only) Convert each '/' in next word to '\\\\'
121
118 (Vain WIN32) Muuta jokainen '/' seuraavassa sanassa merkkijonoksi '\\\\'
122
119 (WIN32 only) Convert each '/' in previous word to '\\\\'
122
119 (Vain WIN32) Muuta jokainen '/' edellisessä sanassa merkkijonoksi '\\\\'
123
120 (WIN32 only) Page visible console window up
123
120 (Vain WIN32) Näytä konsoli-ikkunan edellinen sivu
124
121 (WIN32 only) Page visible console window down
124
121 (Vain WIN32) Näytä konsoli-ikkunan seuraava sivu
(-)contrib/tcsh/nls/finnish/set9 (-5 / +5 lines)
Lines 1-12 Link Here
1
$ $tcsh: set9,v 1.3 2011/02/04 18:19:34 christos Exp $
1
$ $tcsh: set9,v 1.5 2015/09/01 14:08:28 kim Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
4
1 AddXkey: Tyhjää laajennettua näppäintä ei sallita.\n
5
2 AddXkey: sequence-lead-in command not allowed\n
5
2 AddXkey: sequence-lead-in command not allowed\n
6
3 DeleteXkey: Null extended-key not allowed.\n
6
3 DeleteXkey: Tyhjää laajennettua näppäintä ei sallita.\n
7
4 Sitomaton laajennettu näppäin "%S"\n
7
4 Sitomaton laajennettu näppäin "%S"\n
8
5 Jotkin laajennetut näppäimet ovat liian pitkiä sisäiseen tulostuspuskurille
8
5 Jotkin laajennetut näppäimet ovat liian pitkiä sisäiselle tulostuspuskurille
9
6 Enumerate: VIKA!! Välitetty null-osoitin\n!
9
6 Enumerate: VIKA!! Välitetty null-osoitin\n!
10
7 ei syötettä
10
7 ei syötettä
11
8 Jotain on seurattava: %c\n
11
8 Jotain on seurattava: '%c'\n
12
9 Oktaalivakio ei mahdu char-tyypin muuttujaan.\n
12
9 Oktaalivakio ei mahdu char-tyypin muuttujaan.\n
(-)contrib/tcsh/nls/french/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.5 2011/02/04 18:19:35 christos Exp $
1
$ $tcsh: set1,v 1.6 2015/05/26 17:38:25 christos Exp $
2
$ Messages d 'erreur
2
$ Messages d 'erreur
3
$set 1 
3
$set 1 
4
1 Erreur de syntaxe
4
1 Erreur de syntaxe
Lines 8-14 Link Here
8
5 Pas de fichier pour $0
8
5 Pas de fichier pour $0
9
6 Modificateur [] incomplet
9
6 Modificateur [] incomplet
10
7 $ l'expansion doit se terminer avant ]
10
7 $ l'expansion doit se terminer avant ]
11
8 Mauvais : modificateur dans $ (%c)
11
8 Mauvais : modificateur dans $ '%c'
12
9 Erreur d'indice
12
9 Erreur d'indice
13
10 Numéro mal formé
13
10 Numéro mal formé
14
11 Plus de mots
14
11 Plus de mots
Lines 51-58 Link Here
51
48 Vous n'êtes pas dans une boucle while ou foreach
51
48 Vous n'êtes pas dans une boucle while ou foreach
52
49 Plus de processus
52
49 Plus de processus
53
50 Pas de correspondance
53
50 Pas de correspondance
54
51 %c manquant
54
51 '%c' manquant
55
52 %c sans correspondance
55
52 '%c' sans correspondance
56
53 Mémoire insuffisante
56
53 Mémoire insuffisante
57
54 Impossible de créer un tube
57
54 Impossible de créer un tube
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Remplacement incorrect
93
90 Remplacement incorrect
94
91 Pas de partie gauche précédente
94
91 Pas de partie gauche précédente
95
92 Partie droite trop longue
95
92 Partie droite trop longue
96
93 Modificateur ! incorrect: %c
96
93 Modificateur ! incorrect: '%c'
97
94 Echec du modificateur
97
94 Echec du modificateur
98
95 Dépassement de capacité de la mémoire tampon de substitution
98
95 Dépassement de capacité de la mémoire tampon de substitution
99
96 Sélecteur d'argument ! incorrect
99
96 Sélecteur d'argument ! incorrect
Lines 118-124 Link Here
118
115 Pas assez de place pour la chaine termcap
118
115 Pas assez de place pour la chaine termcap
119
116 Syntaxe: settc %s [yes|no]
119
116 Syntaxe: settc %s [yes|no]
120
117 Capacité `%s' inconnue
120
117 Capacité `%s' inconnue
121
118 Paramètre termcap inconnu `%%%c'
121
118 Paramètre termcap inconnu '%%%c'
122
119 Trop d'arguments pour `%s' (%d)
122
119 Trop d'arguments pour `%s' (%d)
123
120 `%s' nécessite %d arguments
123
120 `%s' nécessite %d arguments
124
121 Syntaxe: echotc [-v|-s] [<capacité> [<args>]]
124
121 Syntaxe: echotc [-v|-s] [<capacité> [<args>]]
Lines 137-140 Link Here
137
134 Syntaxe: unlimit [-fh] [limites]
137
134 Syntaxe: unlimit [-fh] [limites]
138
135 $%S est en lecture seule
138
135 $%S est en lecture seule
139
136 Pas de travail de ce type
139
136 Pas de travail de ce type
140
137 Unknown colorls variable `%c%c'
140
137 Unknown colorls variable '%c%c'
(-)contrib/tcsh/nls/french/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.3 2011/02/04 18:19:35 christos Exp $
1
$ $tcsh: set20,v 1.4 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Nom de touche incorrect `%S'\n
4
1 Nom de touche incorrect `%S'\n
Lines 19-25 Link Here
19
16     -c   interprète COMMANDE comme une commande intégrée ou externe\n
19
16     -c   interprète COMMANDE comme une commande intégrée ou externe\n
20
17     -v   redéfinit toutes les touches pour vi\n
20
17     -v   redéfinit toutes les touches pour vi\n
21
18     -e   redéfinit toutes les touches pour emacs\n
21
18     -e   redéfinit toutes les touches pour emacs\n
22
19     -d   redéfinit toutes les touches pour de l'éditeur par defaut\n
22
19     -d   redéfinit toutes les touches pour de l'éditeur par defaut (%s)\n
23
20     -l   liste les commandes de l'éditeur avec descriptions\n
23
20     -l   liste les commandes de l'éditeur avec descriptions\n
24
21     -r   enlève la correspondance pour la TOUCHE\n
24
21     -r   enlève la correspondance pour la TOUCHE\n
25
22     -k   interprète TOUCHE comme un nom de touche de direction symbolique\n
25
22     -k   interprète TOUCHE comme un nom de touche de direction symbolique\n
(-)contrib/tcsh/nls/french/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.3 2011/02/04 18:19:36 christos Exp $
1
$ $tcsh: set9,v 1.4 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: touche d'extension nulle pas autorisé.\n
4
1 AddXkey: touche d'extension nulle pas autorisé.\n
Lines 8-12 Link Here
8
5 Certaines touches d'extension trop longues pour tampon d'impression interne
8
5 Certaines touches d'extension trop longues pour tampon d'impression interne
9
6 Enumerate: BUG!! Pointeur Null passé!\n
9
6 Enumerate: BUG!! Pointeur Null passé!\n
10
7 pas d'entrée
10
7 pas d'entrée
11
8 Quelque chose doit suivre: %c\n
11
8 Quelque chose doit suivre: '%c'\n
12
9 Une constante Octale ne peut pas tenir dans un caractère.\n
12
9 Une constante Octale ne peut pas tenir dans un caractère.\n
(-)contrib/tcsh/nls/german/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.7 2011/02/04 18:19:36 christos Exp $
1
$ $tcsh: set1,v 1.8 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1
3
$set 1
4
1 Syntaxfehler
4
1 Syntaxfehler
Lines 8-14 Link Here
8
5 Keine Datei für $0
8
5 Keine Datei für $0
9
6 Unvollständiger [] Modifizierer
9
6 Unvollständiger [] Modifizierer
10
7 $ Ausweitung muß vor ] enden
10
7 $ Ausweitung muß vor ] enden
11
8 Falscher : Modifizierer in $ (%c)
11
8 Falscher : Modifizierer in $ '%c'
12
9 Indexfehler
12
9 Indexfehler
13
10 Falsche Nummer
13
10 Falsche Nummer
14
11 Keine Worte mehr
14
11 Keine Worte mehr
Lines 51-58 Link Here
51
48 Nicht in while/foreach
51
48 Nicht in while/foreach
52
49 Keine Prozesse mehr
52
49 Keine Prozesse mehr
53
50 Kein Treffer
53
50 Kein Treffer
54
51 Fehlendes %c
54
51 Fehlendes '%c'
55
52 Überflüssiges %c
55
52 Überflüssiges '%c'
56
53 Kein Speicher mehr
56
53 Kein Speicher mehr
57
54 Kann keine Pipe erzeugen
57
54 Kann keine Pipe erzeugen
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Falsche Ersetzung
93
90 Falsche Ersetzung
94
91 Keine vorhergehende linke Seite
94
91 Keine vorhergehende linke Seite
95
92 Rechte Seite zu lang
95
92 Rechte Seite zu lang
96
93 Falscher ! Modifizierer: %c
96
93 Falscher ! Modifizierer: '%c'
97
94 Modifizierer fehlgeschlagen
97
94 Modifizierer fehlgeschlagen
98
95 Überlauf des Ersetzungspuffers
98
95 Überlauf des Ersetzungspuffers
99
96 Falscher ! Argumentbezeichner
99
96 Falscher ! Argumentbezeichner
Lines 118-124 Link Here
118
115 Kein Platz mehr für Termcap-Eintrag
118
115 Kein Platz mehr für Termcap-Eintrag
119
116 Benutzung: settc %s [yes|no]
119
116 Benutzung: settc %s [yes|no]
120
117 Unbekannte Fähigkeit `%s'
120
117 Unbekannte Fähigkeit `%s'
121
118 Unbekannter Termcap-Parameter `%%%c'
121
118 Unbekannter Termcap-Parameter '%%%c'
122
119 Zu viele Argumente für `%s' (%d)
122
119 Zu viele Argumente für `%s' (%d)
123
120 `%s' erfordert %d Argumente
123
120 `%s' erfordert %d Argumente
124
121 Benutzung: echotc [-v|-s] [<Fähigkeit> [<Argumente>]]
124
121 Benutzung: echotc [-v|-s] [<Fähigkeit> [<Argumente>]]
Lines 137-140 Link Here
137
134 Benutzung: unlimit [-fh] [Grenzen]
137
134 Benutzung: unlimit [-fh] [Grenzen]
138
135 $%S ist nur lesbar
138
135 $%S ist nur lesbar
139
136 Kein solcher Job
139
136 Kein solcher Job
140
137 Unknown colorls variable `%c%c'
140
137 Unknown colorls variable '%c%c'
(-)contrib/tcsh/nls/german/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.4 2011/02/04 18:19:36 christos Exp $
1
$ $tcsh: set20,v 1.5 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20
3
$set 20
4
1 Ungültiger Tastenname `%S'\n
4
1 Ungültiger Tastenname `%S'\n
Lines 19-25 Link Here
19
16     -c   belege einen Unix-Befehl anstelle eines Befehls\n
19
16     -c   belege einen Unix-Befehl anstelle eines Befehls\n
20
17     -v   initialisiere Belegungen mit Standard-Vi-Belegungen\n
20
17     -v   initialisiere Belegungen mit Standard-Vi-Belegungen\n
21
18     -e   initialisiere Belegungen mit Standard-Emacs-Belegungen\n
21
18     -e   initialisiere Belegungen mit Standard-Emacs-Belegungen\n
22
19     -d   initialisiere Belegungen mit Standard-Belegungen\n
22
19     -d   initialisiere Belegungen mit Standard-Belegungen (%s)\n
23
20     -l   zeige verfügbare Funktionen mit Beschreibungen an\n
23
20     -l   zeige verfügbare Funktionen mit Beschreibungen an\n
24
21     -r   entferne Belegung eines Tastes\n
24
21     -r   entferne Belegung eines Tastes\n
25
22     -k   belege Pfeiltaste mit Namen in In-String\n
25
22     -k   belege Pfeiltaste mit Namen in In-String\n
(-)contrib/tcsh/nls/german/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.5 2011/02/04 18:19:37 christos Exp $
1
$ $tcsh: set9,v 1.6 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
4
1 AddXkey: Null extended-key not allowed.\n
Lines 8-12 Link Here
8
5 Some extended keys too long for internal print buffer
8
5 Some extended keys too long for internal print buffer
9
6 Enumerate: BUG!! Null ptr passed\n!
9
6 Enumerate: BUG!! Null ptr passed\n!
10
7 keine Eingabe
10
7 keine Eingabe
11
8 Es muß noch etwas folgen: %c\n
11
8 Es muß noch etwas folgen: '%c'\n
12
9 Oktal-Konstante paßt nicht in ein Zeichen.\n
12
9 Oktal-Konstante paßt nicht in ein Zeichen.\n
(-)contrib/tcsh/nls/greek/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.5 2011/02/04 18:19:37 christos Exp $
1
$ $tcsh: set1,v 1.6 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Λάθος σύνταξη
4
1 Λάθος σύνταξη
Lines 8-14 Link Here
8
5 Δεν υπάρχει αρχείο γιά το $0
8
5 Δεν υπάρχει αρχείο γιά το $0
9
6 Ελλιπής μετατροπέας []
9
6 Ελλιπής μετατροπέας []
10
7 Η ανάπτυξη του $ πρέπει να τελειώνει πριν το ]
10
7 Η ανάπτυξη του $ πρέπει να τελειώνει πριν το ]
11
8 Λάθος μετατροπέας : στο $ (%c)
11
8 Λάθος μετατροπέας : στο $ '%c'
12
9 Λάθος όρισμα
12
9 Λάθος όρισμα
13
10 Κακοσχηματισμένος αριθμός
13
10 Κακοσχηματισμένος αριθμός
14
11 Δεν υπάρχουν άλλες λέξεις
14
11 Δεν υπάρχουν άλλες λέξεις
Lines 51-58 Link Here
51
48 Εκτός while/foreach
51
48 Εκτός while/foreach
52
49 Δεν υπάρχουν άλλες διεργασίες
52
49 Δεν υπάρχουν άλλες διεργασίες
53
50 Δεν υπάρχει ταίριασμα
53
50 Δεν υπάρχει ταίριασμα
54
51 Απόν %c
54
51 Απόν '%c'
55
52 Μη ταιριασμένο %c
55
52 Μη ταιριασμένο '%c'
56
53 Δεν υπάρχει άλλη μνήμη
56
53 Δεν υπάρχει άλλη μνήμη
57
54 Δεν μπορώ να δημιουργήσω pipe
57
54 Δεν μπορώ να δημιουργήσω pipe
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Λάθος αντικατάσταση
93
90 Λάθος αντικατάσταση
94
91 Δεν υπάρχει προηγούμενο αριστερό μέρος
94
91 Δεν υπάρχει προηγούμενο αριστερό μέρος
95
92 Tο δεξί μέρος είναι πολύ μεγάλο
95
92 Tο δεξί μέρος είναι πολύ μεγάλο
96
93 Κακός μετατροπέας !: %c
96
93 Κακός μετατροπέας !: '%c'
97
94 Ο μετατροπέας απέτυχε
97
94 Ο μετατροπέας απέτυχε
98
95 Υπερχείλιση του buffer αντικαταστάσεων
98
95 Υπερχείλιση του buffer αντικαταστάσεων
99
96 Λάθος επιλογέας ορίσματος !
99
96 Λάθος επιλογέας ορίσματος !
Lines 118-124 Link Here
118
115 Δεν υπάρχει χώρος γιά το termcap string 
118
115 Δεν υπάρχει χώρος γιά το termcap string 
119
116 Χρήση: settc %s [yes|no]
119
116 Χρήση: settc %s [yes|no]
120
117 Αγνωστη ικανότητα `%s'
120
117 Αγνωστη ικανότητα `%s'
121
118 Αγνωστη παράμετρος του termcap `%%%c'
121
118 Αγνωστη παράμετρος του termcap '%%%c'
122
119 Υπερβολικά πολλά ορίσματα γιά το `%s' (%d)
122
119 Υπερβολικά πολλά ορίσματα γιά το `%s' (%d)
123
120 Tο `%s' απαιτεί %d ορίσματα
123
120 Tο `%s' απαιτεί %d ορίσματα
124
121 Χρήση: echotc [-v|-s] [<ικανότητα> [<ορίσματα>]]
124
121 Χρήση: echotc [-v|-s] [<ικανότητα> [<ορίσματα>]]
Lines 137-140 Link Here
137
134 Χρήση: unlimit [-fh] [όρια]
137
134 Χρήση: unlimit [-fh] [όρια]
138
135 Tο $%S είναι μόνο γιά διάβασμα
138
135 Tο $%S είναι μόνο γιά διάβασμα
139
136 Δεν υπάρχει τέτοια εργασία
139
136 Δεν υπάρχει τέτοια εργασία
140
137 Unknown colorls variable `%c%c'
140
137 Unknown colorls variable '%c%c'
(-)contrib/tcsh/nls/greek/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.5 2011/02/04 18:19:37 christos Exp $
1
$ $tcsh: set20,v 1.6 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Ακυρο όνομα πλήκτρου `%S'\n
4
1 Ακυρο όνομα πλήκτρου `%S'\n
Lines 19-25 Link Here
19
16     -c   ερμηνεία ΕΝΤΟΛΗς ως εσωτερικής ή εξωτερικής εντολής\n
19
16     -c   ερμηνεία ΕΝΤΟΛΗς ως εσωτερικής ή εξωτερικής εντολής\n
20
17     -v   συσχέτιση όλων των πλήκτρων σε αντιστοιχία vi\n
20
17     -v   συσχέτιση όλων των πλήκτρων σε αντιστοιχία vi\n
21
18     -e   συσχέτιση όλων των πλήκτρων σε αντιστοιχία emacs\n
21
18     -e   συσχέτιση όλων των πλήκτρων σε αντιστοιχία emacs\n
22
19     -d   συσχέτιση όλων των πλήκτρων στην default του editor\n
22
19     -d   συσχέτιση όλων των πλήκτρων στην default του editor (%s)\n
23
20     -l   εμφάνιση των εντολών του editor με περιγραφές\n
23
20     -l   εμφάνιση των εντολών του editor με περιγραφές\n
24
21     -r   κατάργηση συσχέτισης του ΠΛΗΚΤΡΟυ\n
24
21     -r   κατάργηση συσχέτισης του ΠΛΗΚΤΡΟυ\n
25
22     -k   ερμηνεία ΠΛΗΚΤΡΟυ ως συμβολικό όνομα πλήκτρου βέλους\n
25
22     -k   ερμηνεία ΠΛΗΚΤΡΟυ ως συμβολικό όνομα πλήκτρου βέλους\n
(-)contrib/tcsh/nls/greek/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.4 2011/02/04 18:19:38 christos Exp $
1
$ $tcsh: set9,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: δεν επιτρέπεται μηδενικό extended-key.\n
4
1 AddXkey: δεν επιτρέπεται μηδενικό extended-key.\n
Lines 8-12 Link Here
8
5 Μερικά extended keys είναι πολύ μεγάλα γιά τον εσωτερικό print buffer
8
5 Μερικά extended keys είναι πολύ μεγάλα γιά τον εσωτερικό print buffer
9
6 Enumerate: BUG!! Πέρασμα μηδενικού pointer!\n
9
6 Enumerate: BUG!! Πέρασμα μηδενικού pointer!\n
10
7 δεν υπάρχει είσοδος
10
7 δεν υπάρχει είσοδος
11
8 Κάτι πρέπει να ακολουθεί: %c\n
11
8 Κάτι πρέπει να ακολουθεί: '%c'\n
12
9 Η οκταδική σταθερά δε χωράει στο μέγεθος ενός char.\n
12
9 Η οκταδική σταθερά δε χωράει στο μέγεθος ενός char.\n
(-)contrib/tcsh/nls/italian/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.3 2011/02/04 18:19:38 christos Exp $
1
$ $tcsh: set1,v 1.4 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Errore di Sintassi
4
1 Errore di Sintassi
Lines 8-14 Link Here
8
5 Nessun file per $0
8
5 Nessun file per $0
9
6 Modificatore [] incompleto
9
6 Modificatore [] incompleto
10
7 L'espansione $ deve terminare prima di ]
10
7 L'espansione $ deve terminare prima di ]
11
8 Modificatore sbagliato in $ (%c)
11
8 Modificatore sbagliato in $ '%c'
12
9 Errore di indice
12
9 Errore di indice
13
10 Numero non corretto
13
10 Numero non corretto
14
11 Sono senza parole
14
11 Sono senza parole
Lines 51-58 Link Here
51
48 Non in un while/foreach
51
48 Non in un while/foreach
52
49 Ho finito i processi
52
49 Ho finito i processi
53
50 Corrispondenza non esistente
53
50 Corrispondenza non esistente
54
51 %c mancante
54
51 '%c' mancante
55
52 %c non corrispondente
55
52 '%c' non corrispondente
56
53 Memoria esaurita
56
53 Memoria esaurita
57
54 Non posso creare una pipe
57
54 Non posso creare una pipe
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Sostituzione sbagliata
93
90 Sostituzione sbagliata
94
91 Non esiste il precedente lato sinistro
94
91 Non esiste il precedente lato sinistro
95
92 Lato destro troppo lungo
95
92 Lato destro troppo lungo
96
93 Modificatore ! errato: %c
96
93 Modificatore ! errato: '%c'
97
94 Il modificatore non ha funzionato
97
94 Il modificatore non ha funzionato
98
95 Overflow di buffer nella sostituzione
98
95 Overflow di buffer nella sostituzione
99
96 Errato selettore ! di argomento
99
96 Errato selettore ! di argomento
Lines 118-124 Link Here
118
115 Al di fuori dello spazio stringa del termcap
118
115 Al di fuori dello spazio stringa del termcap
119
116 Utilizzo: settc %s [yes|no]
119
116 Utilizzo: settc %s [yes|no]
120
117 Capacità `%s' sconosciuta
120
117 Capacità `%s' sconosciuta
121
118 Parametro del termcap `%%%c' sconosciuto
121
118 Parametro del termcap '%%%c' sconosciuto
122
119 Troppi argomenti per `%s' (%d)
122
119 Troppi argomenti per `%s' (%d)
123
120 `%s' richiede %d argomenti
123
120 `%s' richiede %d argomenti
124
121 Utilizzo: echotc [-v|-s] [<capacità> [<argomenti>]]
124
121 Utilizzo: echotc [-v|-s] [<capacità> [<argomenti>]]
Lines 137-140 Link Here
137
134 Utilizzo: unlimit [-fh] [limiti]
137
134 Utilizzo: unlimit [-fh] [limiti]
138
135 $%S è a sola lettura
138
135 $%S è a sola lettura
139
136 Non esiste il lavoro
139
136 Non esiste il lavoro
140
137 Variabile `%c%c colorls' sconosciuta
140
137 Variabile '%c%c colorls' sconosciuta
(-)contrib/tcsh/nls/italian/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.3 2011/02/04 18:19:39 christos Exp $
1
$ $tcsh: set20,v 1.4 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Nome di tasto non corretto `%S'\n
4
1 Nome di tasto non corretto `%S'\n
Lines 19-25 Link Here
19
16     -c   interpreta COMANDO come un comando interno o esterno\n
19
16     -c   interpreta COMANDO come un comando interno o esterno\n
20
17     -v   definisce tutti i tasti alla 'vi'\n
20
17     -v   definisce tutti i tasti alla 'vi'\n
21
18     -e   definisce tutti i tasti alla 'emacs'\n
21
18     -e   definisce tutti i tasti alla 'emacs'\n
22
19     -d   definisce tutti i tasti in base all'editor di default\n
22
19     -d   definisce tutti i tasti in base all'editor di default (%s)\n
23
20     -l   elenca i comandi di modifica testo con relativa descrizione\n
23
20     -l   elenca i comandi di modifica testo con relativa descrizione\n
24
21     -r   rimuove la definizione per TASTO\n
24
21     -r   rimuove la definizione per TASTO\n
25
22     -k   interpreta TASTO come un nome simbolico di tasto freccia\n
25
22     -k   interpreta TASTO come un nome simbolico di tasto freccia\n
(-)contrib/tcsh/nls/italian/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.2 2006/03/02 18:46:47 christos Exp $
1
$ $tcsh: set9,v 1.3 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: tasto esteso nullo non ammesso.\n
4
1 AddXkey: tasto esteso nullo non ammesso.\n
Lines 8-12 Link Here
8
5 Alcuni tasti estesi sono troppo grandi per il buffer interno di stampa
8
5 Alcuni tasti estesi sono troppo grandi per il buffer interno di stampa
9
6 Enumerate: BACO!! ho ricevuto un puntatore nullo\n!
9
6 Enumerate: BACO!! ho ricevuto un puntatore nullo\n!
10
7 niente in ingresso
10
7 niente in ingresso
11
8 Qualcosa deve seguire: %c\n
11
8 Qualcosa deve seguire: '%c'\n
12
9 Costante ottale non adeguata per un char.\n
12
9 Costante ottale non adeguata per un char.\n
(-)contrib/tcsh/nls/ja/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.6 2011/02/04 18:19:39 christos Exp $
1
$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 文法が間違っています
4
1 文法が間違っています
Lines 8-14 Link Here
8
5 $0 用のファイルがありません
8
5 $0 用のファイルがありません
9
6 [] 修飾子が不完全です
9
6 [] 修飾子が不完全です
10
7 $ 展開は ] の前に終わる必要があります
10
7 $ 展開は ] の前に終わる必要があります
11
8 $ 内の : 修飾子が間違っています (%c)
11
8 $ 内の : 修飾子が間違っています '%c'
12
9 配列の添え字が間違っています
12
9 配列の添え字が間違っています
13
10 番号が正しい書式になっていません
13
10 番号が正しい書式になっていません
14
11 文字列はもうありません
14
11 文字列はもうありません
Lines 51-58 Link Here
51
48 while/foreachの中ではありません
51
48 while/foreachの中ではありません
52
49 プロセスを生成できません
52
49 プロセスを生成できません
53
50 照合パターンに合いません
53
50 照合パターンに合いません
54
51 %c が欠けている箇所があります
54
51 '%c' が欠けている箇所があります
55
52 %c が対応しません
55
52 '%c' が対応しません
56
53 メモリが不足しています
56
53 メモリが不足しています
57
54 パイプを作れません
57
54 パイプを作れません
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 不正な置換です
93
90 不正な置換です
94
91 直前の左サイドがありません
94
91 直前の左サイドがありません
95
92 右サイドが長過ぎます
95
92 右サイドが長過ぎます
96
93 間違った ! 修飾子です: %c
96
93 間違った ! 修飾子です: '%c'
97
94 修飾子の失敗です
97
94 修飾子の失敗です
98
95 置換バッファがオーバーフローしました
98
95 置換バッファがオーバーフローしました
99
96 間違った ! 引数のセレクターです
99
96 間違った ! 引数のセレクターです
Lines 118-124 Link Here
118
115 termcapの文字列領域不足です
118
115 termcapの文字列領域不足です
119
116 形式: settc %s [yes|no]
119
116 形式: settc %s [yes|no]
120
117 知らないcapability `%s'
120
117 知らないcapability `%s'
121
118 知らないtermcapパラメタ `%%%c'
121
118 知らないtermcapパラメタ '%%%c'
122
119 `%s' に対する引数が多過ぎます (%d)
122
119 `%s' に対する引数が多過ぎます (%d)
123
120 `%s' には %d 引数が必要です
123
120 `%s' には %d 引数が必要です
124
121 形式: echotc [-v|-s] [<capability> [<args>]]
124
121 形式: echotc [-v|-s] [<capability> [<args>]]
Lines 137-140 Link Here
137
134 形式: unlimit [-fh] [limits]
137
134 形式: unlimit [-fh] [limits]
138
135 $%S は読取専用です
138
135 $%S は読取専用です
139
136 jobが見つかりません
139
136 jobが見つかりません
140
137 不明のcolorls変数です `%c%c'
140
137 不明のcolorls変数です '%c%c'
(-)contrib/tcsh/nls/pl/README (+3 lines)
Line 0 Link Here
1
T³umaczenia dokona³ Pawe³ Niewiadomski <new@linuxpl.org>.
2
Licencja GPL. Wszelkie informacje o b³êdach proszê kierowaæ do mnie 
3
(chcia³bym aby t³umaczenie to by³o jak najlepsze)
(-)contrib/tcsh/nls/pl/charset (+3 lines)
Line 0 Link Here
1
$ codeset=UTF-8
2
$set 255
3
1 UTF-8
(-)contrib/tcsh/nls/pl/set1 (+140 lines)
Line 0 Link Here
1
$ $tcsh: set1,v 1.5 1998/06/27 12:27:55 christos Exp $
2
$ Error messages
3
$set 1 
4
1 Błąd składni
5
2 %s jest niedozwolone
6
3 Zbyt długie słowo
7
4 $< zbyt długa linia
8
5 Brak pliku dla $0
9
6 Niekompletny modyfikator []
10
7 ekspansja $ musi zakończyć się przed ]
11
8 Błąd : modyfikator w $ '%c'
12
9 Błąd subskrypcji
13
10 Źle stworzona liczba
14
11 Brak słów
15
12 Brakuje nazwy pliku
16
13 Wewnętrzny błąd podczas dopasowywania
17
14 Nie znaleziono polecenia
18
15 Zbyt mało argumentów
19
16 Zbyt dużo argumentów
20
17 Zbyt niebezpiecznie aliasować
21
18 Pusty if
22
19 Nieprawidłowy then
23
20 Słowa nie są w nawiasach
24
21 %s nie został znaleziony
25
22 Nieprawidłowa maska
26
23 Nie ma takiego limitu
27
24 Zbyt duży argument
28
25 Nieprawidłowy, lub nieznany współczynnik skali
29
26 Niezdefiniowana zmienna
30
27 Stos katalogów nie jest aż tak głęboki
31
28 Zły numer sygnału
32
29 Nieznany sygnał; kill -l pokaże znane sygnały
33
30 Nazwa zmiennej musi zaczynać się od litery
34
31 Nazwa zmiennej jest zbyt długa
35
32 Nazwa zmiennej musi zawierać znaki alfanumeryczne
36
33 Brak kontroli pracami w tej powłoce
37
34 Błąd składni wyrażenia
38
35 Brak katalogu domowego
39
36 Nie mogę przejść do katalogu domowego
40
37 Nieprawidłowe puste polecenie
41
38 Wyrażenie pozbawione przyporządkowania
42
39 Nieznany operator
43
40 Niejasne
44
41 %s: Plik istnieje
45
42 Argument dla -c zakończony jest backslashem
46
43 Przerwano
47
44 Za duża wartość przyporządkowania
48
45 Przepełnienie linii
49
46 Brak takiej pracy
50
47 Z terminala nie mogę
51
48 Nie w while/foreach
52
49 Brak innych procesów
53
50 Brak pasujących
54
51 Brakuje '%c'
55
52 Niedopasowany '%c'
56
53 Brak pamięci
57
54 Nie mogę stworzyć potoku
58
55 %s: %s
59
56 %s
60
57 Użycie: jobs [ -l ]
61
58 Argumentami powinny być identyfikatory prac lub procesów
62
59 Nie ma aktualnej pracy
63
60 Brak poprzednich prac
64
61 Brak prac pasujących do wzorca
65
62 Zagnieżdżenie fork > %d; prawdopodobnie pętla `...`
66
63 Brak kontroli pracami w podpowłokach
67
64 Błąd synchronizacji: Proces %d nie został znaleziony
68
65 %sIstnieją uśpione prace
69
66 %sIstnieją zatrzymane prace
70
67 Brak innych katalogów
71
68 Stos katalogów jest pusty
72
69 Zły katalog
73
70 Użycie: %s [-%s]%s
74
71 Brak operandu dla flagi -h
75
72 To nie jest powłoka logowania
76
73 Dzielenie przez 0
77
74 Modula przez 0
78
75 Zła skala; czy myślałeś o "%s"?
79
76 Nie można zatrzymać powłoki logowania (na razie)
80
77 Nieznany użytkownik: %s
81
78 Zmienna $home nie jest ustawiona
82
79 Użycie: history [-%s] [# liczba zdarzeń]
83
80 $, ! i < są niedozwolone z $#, lub $?
84
81 Znak nowej linii w nazwie zmiennej
85
82 * jest zabronione z $# i $?
86
83 $?<cyfra> lub $#<cyfra> są zabronione
87
84 Nielegalna nazwa zmiennej
88
85 Znak nowej linii w indeksie zmiennych
89
86 Przepełnienie bufora ekspansji
90
87 Sładnia zmiennej
91
88 Zła forma !
92
89 Brak poprzedniego dopasowania
93
90 Złe dopasowanie
94
91 No previous left hand side
95
92 Right hand side too long
96
93 Zły modyfikator ! : '%c'
97
94 Modyfikator zawiódł
98
95 Przepełnienie bufora dopasowania
99
96 Zły ! selektor argumentów
100
97 Brak poprzedniego wyszukiwania
101
98 %s: Zdarzenie nie zostało znalezione
102
99 Zbyt wiele )
103
100 Zbyt wiele (
104
101 Źle wstawiony (
105
102 Brakuje nazwy dla przekierowania
106
103 Niejasne przekierowanie wyjścia
107
104 Nie można << wewnątrz ()
108
105 Niejasne przekierowanie wejścia
109
106 Źle wstawione ()
110
107 Zapętlenie się aliasów
111
108 Zmienna $watch nie została ustawiona
112
109 Brak zaplanowanych prac
113
110 Użycie: sched -<item#>.\nUżycie: sched [+]hh:mm <polecenie>
114
111 Nie ma aż tylu zaplanowanych prac
115
112 Brak programu do uruchomienia
116
113 Nieprawidłowy czas dla pracy
117
114 Czas relatywny jest sprzeczny z am/pm
118
115 Brak miejsc w łańcuchu termcap
119
116 Użycie: settc %s [yes|no]
120
117 Nieznana zdolność `%s'
121
118 Nieznany parametr termcap '%%%c'
122
119 Zbyt wiele argumentów dla `%s' (%d)
123
120 `%s' requires %d arguments
124
121 Użycie: echotc [-v|-s] [<zdolność> [<argumenty>]]
125
122 %s: %s. Nieprawidłowa architektura
126
123 !# Zapętlenie się historii
127
124 Zniekształcony zapytanie na temat pliku
128
125 Przepełnienie selektora
129
126 Nieznana opcja: `-%s'\nUżycie: %s [ -bcdefilmnqstvVxX -Dnazwa[=wartość] ] [ argument ... ]
130
127 Nieznana opcja: `-%s'\nUżycie: %s [ -bcdefFilmnqstvVxX ] [ argument ... ]
131
128 Nieznana opcja: `-%s'\nUżycie: %s [ -bcdefilmnqstvVxX ] [ argument ... ]
132
129 \nNieprawidłowe dopełnienie: "%s"
133
130 \nNieprawidłowe %s: '%c'
134
131 \nBrakuje separatora '%c' po %s "%s"
135
132 \nNiekompletne %s: "%s"
136
133 Brak operandu dla flagi -m
137
134 Użycie: unlimit [-fh] [limity]
138
135 $%S jest tylko-do-odczytu
139
136 Brak takiej pracy
140
137 Nieznana zmienna colorls '%c%c'
(-)contrib/tcsh/nls/pl/set10 (+8 lines)
Line 0 Link Here
1
$ $tcsh: set10,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ ma.setp.c
3
$set 10 
4
1 setpath: nieprawidłowe polecenie '%s'.\n
5
2 setpath: za mało argumentów dla polecenia '%s'.\n
6
3 setpath: brakuje wartości w ścieżce '%s'\n
7
4 setpath: %s nie został znaleziony w %s\n
8
5 setpath: %d nie jest prawidłową pozycją w %s\n
(-)contrib/tcsh/nls/pl/set11 (+10 lines)
Line 0 Link Here
1
$ $tcsh: set11,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ sh.c
3
$set 11 
4
1 Uwaga: brak dostępu do tty (%s).\n
5
2 Innymi słowy brak zarządzania pracami w tej powłoce.\n
6
3 Masz %d wiadomości.\n
7
4 Masz %d wiadomości w %s.\n
8
5 Masz %spocztę.\n
9
6 nową 
10
7 Masz %spocztę w %s.\n
(-)contrib/tcsh/nls/pl/set12 (+4 lines)
Line 0 Link Here
1
$ $tcsh: set12,v 1.3 1996/04/26 20:31:52 christos Exp $
2
$ sh.dir.c
3
$set 12 
4
1 %s: Próbuję wystartować z "%s"\n
(-)contrib/tcsh/nls/pl/set13 (+13 lines)
Line 0 Link Here
1
$ $tcsh: set13,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ sh.exec.c
3
$set 13 
4
1 hash=%-4d dir=%-2d prog=%s\n
5
2 %d hash buckets of %d bits each\n
6
3 maska odpluskwiania = 0x%08x\n
7
4 %d trafień, %d chybień, %d%%\n
8
5 %S: polecenie wbudowane w powłokę.\n
9
6 %S: Nie znaleziono polecenia.\n
10
7 gdzie: / w poleceniu nie ma sensu\n
11
8 %S jest aliasem do 
12
9 %S jest wbudowane w powłokę\n
13
10 chybień hash: 
(-)contrib/tcsh/nls/pl/set14 (+6 lines)
Line 0 Link Here
1
$ $tcsh: set14,v 1.3 1998/11/24 18:18:06 christos Exp $
2
$ sh.file.c
3
$set 14 
4
1 \nKurcze!! Zbyt wiele %s!!\n
5
2 nazw w pliku haseł
6
3 pliki
(-)contrib/tcsh/nls/pl/set15 (+7 lines)
Line 0 Link Here
1
$ $tcsh: set15,v 1.3 1996/10/19 17:52:32 christos Exp $
2
$ sh.func.c
3
$set 15 
4
1 %s: %s: Nie mogę limitować %s%s\n
5
2 usuń
6
3 ustaw
7
4 \040twardy
(-)contrib/tcsh/nls/pl/set16 (+13 lines)
Line 0 Link Here
1
$ $tcsh: set16,v 1.3 1996/04/26 20:31:55 christos Exp $
2
$ sh.lex.c
3
$set 16 
4
1 Reset tty pgrp from %d to %d\n
5
2 \nAby wylogować się użyj "logout".\n
6
3 \nAby opuścić %s użyj "exit".\n
7
4 seek to eval %x %x\n
8
5 seek to alias %x %x\n
9
6 seek to file %x\n
10
7 Bad seek type %d\n
11
8 tell eval %x %x\n
12
9 tell alias %x %x\n
13
10 tell file %x\n
(-)contrib/tcsh/nls/pl/set17 (+17 lines)
Line 0 Link Here
1
$ $tcsh: set17,v 1.3 1996/10/19 17:52:33 christos Exp $
2
$ sh.proc.c
3
$set 17 
4
1 PLUSKWA: czekam na zadanie pracujące w tle!\n
5
2 Zakończono %d\n
6
3 PLUSKWA: proces wywołany drugi raz
7
4 Running 
8
5 Sygnał 
9
6 Zwrócono %-25d
10
7 Zakończony
11
8 PLUSKWA: status=%-9o
12
9 \040(zrzucono core)
13
10 \040(KR:
14
11 (KR jest:  
15
12 %S: Już jest zawieszony\n
16
13 %S: Już jest zatrzymany\n
17
14 %S: Badly formed number\n
(-)contrib/tcsh/nls/pl/set18 (+4 lines)
Line 0 Link Here
1
$ $tcsh: set18,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ sh.set.c
3
$set 18 
4
1 Uwaga: śmiesznie długa PATH została obcięta\n
(-)contrib/tcsh/nls/pl/set19 (+23 lines)
Line 0 Link Here
1
$ $tcsh: set19,v 1.3 1996/04/26 20:31:58 christos Exp $
2
$ tc.alloc.c
3
$set 19 
4
1 n-bajtów=%d: Brak pamięci\n
5
2 free(%lx) wywołany przez jakąkolwiek allokacją.
6
3 free(%lx) above top of memory.
7
4 free(%lx) below bottom of memory.
8
5 free(%lx) bad block.
9
6 free(%lx) bad range check.
10
7 free(%lx) bad block index.
11
8 %s aktualnie allokowana pamięć:\nwolna:\t
12
9 używane
13
10 \n\tAktualnie w użyciu: %d, wolnych: %d\n
14
11 \tZaallokowano pamięć od 0x%lx do 0x%lx.  Wierzchołek 0x%lx\n
15
12 Zaallokowano pamięć od 0x%lx do 0x%lx (%ld).\n
16
13 %s current memory allocation:\n
17
14 Total space allocated from system: %d\n
18
15 Number of non-inuse chunks: %d\n
19
16 Number of mmapped regions: %d\n
20
17 Total space in mmapped regions: %d\n
21
18 Total allocated space: %d\n
22
19 Total non-inuse space: %d\n
23
20 Top-most, releasable space: %d\n
(-)contrib/tcsh/nls/pl/set2 (+111 lines)
Line 0 Link Here
1
$ $tcsh: set2,v 1.4 1998/10/25 15:12:38 christos Exp $
2
$ Signal names
3
$set 2 
4
1 Pusty sygnał
5
2 Hangup
6
3 Przerwij
7
4 Quit
8
5 Nieprawdiłowa instrukcja
9
6 Trace/BPT trap
10
7 Abort
11
8 IOT trap
12
9 System Crash Imminent
13
10 Error exit
14
11 EMT trap
15
12 Floating exception
16
13 Zabity
17
14 User signal 1
18
15 User signal 2
19
16 Naruszenie ochrony pamięci
20
17 Błąd szyny
21
18 Program range error
22
19 Operand range error
23
20 Nieprawidłowe wywołanie systemowe
24
21 Broken pipe
25
22 Alarm clock
26
23 Zakończono
27
24 Child status change
28
25 Śmierć potomka
29
26 Apollo-specific fault
30
27 Potomek zakończył działanie, lub został wyłączony
31
28 Potomek zakończył działanie
32
29 Brak zasilania
33
30 Resource Lost
34
31 Przerwanie (Ctrl-Break)
35
32 Input/output possible signal
36
33 Asynchroniczne We/Wy (select)
37
34 Urgent condition on I/O channel
38
35 Multitasking wake-up
39
36 Multitasking kill
40
37 Fortran asynchronous I/O completion
41
38 Recovery
42
39 Uncorrectable memory error
43
40 Limit czasu CPU przekroczony
44
41 System shutdown imminent
45
42 micro-tasking group-no wakeup flag set
46
43 Thread error - (use cord -T for detailed info)
47
44 CRAY Y-MP register parity error
48
45 Information request
49
46 Zawieszony (sygnał)
50
47 Zatrzymany (sygnał)
51
48 Zawieszony
52
49 Zatrzymany
53
50 Continued
54
51 Suspended (tty input)
55
52 Stopped (tty input)
56
53 Suspended (tty output)
57
54 Stopped (tty output)
58
55 Window status changed
59
56 Window size changed
60
57 Phone status changed
61
58 Cputime limit exceeded
62
59 Filesize limit exceeded
63
60 Virtual time alarm
64
61 Profiling time alarm
65
62 DIL signal
66
63 Pollable event occured
67
64 Process's lwps are blocked
68
65 Special LWP signal
69
66 Special CPR Signal
70
67 Special CPR Signal
71
68 First Realtime Signal
72
69 Second Realtime Signal
73
70 Third Realtime Signal
74
71 Fourth Realtime Signal
75
72 Fourth Last Realtime Signal
76
73 Third Last Realtime Signal
77
74 Second Last Realtime Signal
78
75 Last Realtime Signal
79
76 LAN Asyncronous I/O
80
77 PTY read/write availability
81
78 I/O intervention required
82
79 HFT monitor mode granted
83
80 HFT monitor mode should be relinguished
84
81 HFT sound control has completed
85
82 Data in HFT ring buffer
86
83 Migrate process
87
84 Secure attention key
88
85 Reschedule
89
86 Signaling SS$_DEBUG
90
87 Priority changed
91
88 True deadlock detected
92
89 New input character
93
90 Stack limit exceeded
94
91 Unused signal
95
92 LM overlay
96
93 system freeze
97
94 system defreeze
98
95 dead lock
99
96 exceeded memory size limit
100
97 exceeded data size limit
101
98 exceeded memory size limit of 32KB
102
99 exce error for no memory
103
100 check point start
104
101 check point start of kernel
105
102 restart start
106
103 restart of kernel
107
104 exeeded XMU size limit
108
105 exeeded RLG0 limit
109
106 exeeded RLG1 limit
110
107 exeeded RLG2 limit
111
108 exeeded RLG3 limit
(-)contrib/tcsh/nls/pl/set20 (+41 lines)
Line 0 Link Here
1
$ $tcsh: set20,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.bind.c
3
$set 20 
4
1 Invalid key name `%S'\n
5
2 Bad key name: %S\n
6
3 Bad command name: %S\n
7
4 Bad key spec %S\n
8
5 Null string specification\n
9
6 Standard key bindings\n
10
7 Alternative key bindings\n
11
8 Multi-character bindings\n
12
9 Arrow key bindings\n
13
10 %-15s->  is undefined\n
14
11 BUG!!! %s isn't bound to anything.\n
15
12 Usage: bindkey [options] [--] [KEY [COMMAND]]\n
16
13     -a   list or bind KEY in alternative key map\n
17
14     -b   interpret KEY as a C-, M-, F- or X- key name\n
18
15     -s   interpret COMMAND as a literal string to be output\n
19
16     -c   interpret COMMAND as a builtin or external command\n
20
17     -v   bind all keys to vi bindings\n
21
18     -e   bind all keys to emacs bindings\n
22
19     -d   bind all keys to default editor's bindings (%s)\n
23
20     -l   list editor commands with descriptions\n
24
21     -r   remove KEY's binding\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
26
23     --   force a break from option processing\n
27
24     -u   (or any invalid option) this message\n
28
25 Without KEY or COMMAND, prints all bindings\n
29
26 Without COMMAND, prints the binding for KEY.\n
30
27 bad key specification -- null string\n
31
28 bad key specification -- empty string\n
32
29 Bad function-key specification.  Null key not allowed\n
33
30 bad key specification -- malformed hex number\n
34
31 bad key specification -- malformed octal number\n
35
32 bad key specification -- malformed decimal number\n
36
33 Bad function-key specification.\n
37
34 Null key not allowed\n
38
35 bad key specification -- unknown name "%S"\n
39
36 usage: bind [KEY | COMMAND KEY | "emacs" | "vi" | "-a"]\n
40
37 Invalid function
41
38  %s\t\tis undefined\n
(-)contrib/tcsh/nls/pl/set21 (+5 lines)
Line 0 Link Here
1
$ $tcsh: set21,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.disc.c
3
$set 21 
4
1 Couldn't get local chars.\n
5
2 Couldn't set local chars.\n
(-)contrib/tcsh/nls/pl/set22 (+17 lines)
Line 0 Link Here
1
$ $tcsh: set22,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.func.c
3
$set 22 
4
1 %S: \t aliased to 
5
2 \nIncorrect passwd for %s\n
6
3 Faulty alias 'precmd' removed.\n
7
4 Faulty alias 'cwdcmd' removed.\n
8
5 Faulty alias 'beepcmd' removed.\n
9
6 Faulty alias 'periodic' removed.\n
10
7 parsing command line\n
11
8 Do you really want to delete all files? [n/y] 
12
9 skipping deletion of files!\n
13
10 command line now is:\n
14
11 parsing command line\n
15
12 in one of the lists\n
16
13 command line now is:\n
17
14 yY
(-)contrib/tcsh/nls/pl/set23 (+34 lines)
Line 0 Link Here
1
$ $tcsh: set23,v 1.3 1996/04/26 20:32:00 christos Exp $
2
$ tc.os.c
3
$set 23 
4
1 Bad cpu/site name
5
2 Site path too long
6
3 unknown
7
4 site: %s\n
8
5 %d: Nie znaleziono komputera\n
9
6 setlocal: %s: %s\n
10
7 Komputer nie został znaleziony
11
8 You're trapped in a universe you never made
12
9 Getwarp failed
13
10 Invalid warp
14
11 Setwarp failed
15
12 Illegal universe
16
13 Nieznany błąd: %d
17
14 sysname:  %s\n
18
15 nodename: %s\n
19
16 release:  %s\n
20
17 version:  %s\n
21
18 machine:  %s\n
22
19 getwd: Nie mogę otworzyć ".." (%s)
23
20 getwd: Nie mogę przejść do ".." (%s)
24
21 getwd: Błąd odczytu w ".." (%s)
25
22 getwd: Nie mogę przejść do "." (%s)
26
23 getwd: Cannot stat "/" (%s)
27
24 getwd: Cannot stat "." (%s)
28
25 getwd: Cannot stat directory "%s" (%s)
29
26 getwd: Cannot open directory "%s" (%s)
30
27 getwd: Cannot find "." in ".." (%s)
31
28 Nieprawidłowy typ systemu
32
29 Typ systemu nie został ustawiony
33
30 Zbyt dużo argumentów
34
31 Nieprawidłowy argument
(-)contrib/tcsh/nls/pl/set24 (+4 lines)
Line 0 Link Here
1
$ $tcsh: set24,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.sched.c
3
$set 24 
4
1 kludge
(-)contrib/tcsh/nls/pl/set25 (+6 lines)
Line 0 Link Here
1
$ $tcsh: set25,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.sig.c
3
$set 25 
4
1 our wait %d\n
5
2 error: bsd_signal(%d) signal out of range\n
6
3 error: bsd_signal(%d) - sigaction failed, errno %d\n
(-)contrib/tcsh/nls/pl/set26 (+15 lines)
Line 0 Link Here
1
$ $tcsh: set26,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tc.who.c
3
$set 26 
4
1 cannot stat %s.  Please "unset watch".\n
5
2 %s cannot be opened.  Please "unset watch".\n
6
3 BUG! last element is not whotail!\n
7
4 backward: 
8
5 BUG! first element is not whohead!\n
9
6 new: %s/%s\n
10
7 %n has %a %l from %m.
11
8 %n has %a %l.
12
9 logged on
13
10 logged off
14
11 replaced %s on
15
12 local
(-)contrib/tcsh/nls/pl/set27 (+8 lines)
Line 0 Link Here
1
$ $tcsh: set27,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tw.comp.c
3
$set 27 
4
1 polecenie
5
2 separator
6
3 pattern
7
4 zasięg
8
5 completion
(-)contrib/tcsh/nls/pl/set29 (+4 lines)
Line 0 Link Here
1
$ $tcsh: set29,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ tw.help.c
3
$set 29 
4
1 Brak pliku pomocy dla %S\n
(-)contrib/tcsh/nls/pl/set3 (+117 lines)
Line 0 Link Here
1
$ $tcsh: set3,v 1.3 1995/04/24 14:12:51 christos Exp $
2
$ Editor function descriptions
3
$set 3 
4
1 Przejdź znak wstecz
5
2 Usuń znak za kursorem
6
3 Obetnij od początku słowa do kursora, zachowaj w buforze wycięć
7
4 Obetnij od początku linii do kursora, zachowaj w buforze wycięć
8
5 Przejdź do początku aktualnego słowa
9
6 Przejdź do początku linii
10
7 Capitalize the characters from cursor to end of current word
11
8 Vi change case of character under cursor and advance one character
12
9 Vi change to end of line
13
10 Clear screen leaving current line on top
14
11 Complete current word
15
12 Tab forward through files
16
13 Tab backward through files
17
14 Complete current word ignoring programmable completions
18
15 Copy current word to cursor
19
16 Copy area between mark and cursor to cut buffer
20
17 Expand to preceding word for which this is a prefix
21
18 Delete character under cursor
22
19 Delete character under cursor or signal end of file on an empty line
23
20 Delete character under cursor or list completions if at end of line
24
21 Delete character under cursor, list completions or signal end of file
25
22 Cut from cursor to end of current word - save in cut buffer
26
23 Adds to argument if started or enters digit
27
24 Digit that starts argument
28
25 Move to next history line
29
26 Lowercase the characters from cursor to end of current word
30
27 Indicate end of file
31
28 Move cursor to end of line
32
29 Exchange the cursor and mark
33
30 Expand file name wildcards
34
31 Expand history escapes
35
32 Expand the history escapes in a line
36
33 Expand variables
37
34 Move forward one character
38
35 Move forward to end of current word
39
36 Exchange the two characters before the cursor
40
37 Search in history backward for line beginning as current
41
38 Search in history forward for line beginning as current
42
39 Insert last item of previous command
43
40 Incremental search forward
44
41 Incremental search backward
45
42 Clear line
46
43 Cut to end of line and save in cut buffer
47
44 Cut area between mark and cursor and save in cut buffer
48
45 Cut the entire line and save in cut buffer
49
46 List choices for completion
50
47 List choices for completion overriding programmable completion
51
48 List file name wildcard matches
52
49 List choices for completion or indicate end of file if empty line
53
50 Display load average and current process status
54
51 Expand history escapes and insert a space
55
52 Execute command
56
53 Expand pathnames, eliminating leading .'s and ..'s
57
54 Expand commands to the resulting pathname or alias
58
55 Switch from insert to overwrite mode or vice versa
59
56 Add 8th bit to next character typed
60
57 Add the next character typed to the line verbatim
61
58 Redisplay everything
62
59 Restart stopped editor
63
60 Look for help on current command
64
61 This character is added to the line
65
62 This character is the first in a character sequence
66
63 Set the mark at cursor
67
64 Correct the spelling of current word
68
65 Correct the spelling of entire line
69
66 Send character to tty in cooked mode
70
67 Toggle between literal and lexical current history line
71
68 Exchange the character to the left of the cursor with the one under
72
69 Exchange the two characters before the cursor
73
70 Tty delayed suspend character
74
71 Tty flush output character
75
72 Tty interrupt character
76
73 Tty quit character
77
74 Tty suspend character
78
75 Tty allow output character
79
76 Tty disallow output character
80
77 Indicates unbound character
81
78 Emacs universal argument (argument times 4)
82
79 Move to previous history line
83
80 Uppercase the characters from cursor to end of current word
84
81 Vi goto the beginning of next word
85
82 Vi enter insert mode after the cursor
86
83 Vi enter insert mode at end of line
87
84 Vi change case of character under cursor and advance one character
88
85 Vi change prefix command
89
86 Vi change to end of line
90
87 Enter vi command mode (use alternative key bindings)
91
88 Vi command mode complete current word
92
89 Vi move to previous character (backspace)
93
90 Vi delete prefix command
94
91 Vi move to the end of the current space delimited word
95
92 Vi move to the end of the current word
96
93 Vi move to the character specified backward
97
94 Vi move to the character specified forward
98
95 Vi move up to the character specified backward
99
96 Vi move up to the character specified forward
100
97 Enter vi insert mode
101
98 Enter vi insert mode at beginning of line
102
99 Vi repeat current character search in the same search direction
103
100 Vi repeat current character search in the opposite search direction
104
101 Vi repeat current search in the same search direction
105
102 Vi repeat current search in the opposite search direction
106
103 Vi replace character under the cursor with the next character typed
107
104 Vi replace mode
108
105 Vi search history backward
109
106 Vi search history forward
110
107 Vi replace character under the cursor and enter insert mode
111
108 Vi replace entire line
112
109 Vi move to the previous word
113
110 Vi move to the next word
114
111 Vi undo last change
115
112 Vi goto the beginning of line
116
113 Perform which of current command
117
114 Paste cut buffer at cursor position
(-)contrib/tcsh/nls/pl/set30 (+16 lines)
Line 0 Link Here
1
$ $tcsh: set30,v 1.4 1996/10/19 17:52:34 christos Exp $
2
$ tw.parse.c
3
$set 30 
4
1 starting_a_command %d\n
5
2 complete %d 
6
3 complete %d %S\n
7
4 %s: Internal match error.\n
8
5 elementów
9
6 wierszy
10
7 Jest %d %s, pokazać je? [n/y] 
11
8 looking = %d\n
12
9 \ntcsh internal error: I don't know what I'm looking for!\n
13
10 nie jest katalogiem
14
11 nie został znaleziony
15
12 jest nieczytelny
16
13 yY
(-)contrib/tcsh/nls/pl/set31 (+7 lines)
Line 0 Link Here
1
$ $tcsh: set31,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ vms.termcap.c
3
$set 31 
4
1 Nie mogę otworzyć TERMCAP: [%s]\n
5
2 Nie mogę otworzyć %s.\n
6
3 Znaleziono %s w %s.\n
7
4 Nie znaleziono %s w pliku %s\n
(-)contrib/tcsh/nls/pl/set4 (+45 lines)
Line 0 Link Here
1
$ $tcsh: set4,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ Termcap strings
3
$set 4
4
1 add new blank line
5
2 audible bell
6
3 clear to bottom
7
4 clear to end of line
8
5 cursor to horiz pos
9
6 clear screen
10
7 delete a character
11
8 delete a line
12
9 start delete mode
13
10 end delete mode
14
11 end insert mode
15
12 cursor from status line
16
13 home cursor
17
14 insert character
18
15 start insert mode
19
16 insert padding
20
17 sends cursor down
21
18 sends cursor left
22
19 sends cursor right
23
20 sends cursor up
24
21 begin bold
25
22 end attributes
26
23 non destructive space
27
24 end standout
28
25 begin standout
29
26 cursor to status line
30
27 cursor up one
31
28 begin underline
32
29 end underline
33
30 visible bell
34
31 delete multiple chars
35
32 cursor down multiple
36
33 insert multiple chars
37
34 cursor left multiple
38
35 cursor right multiple
39
36 cursor up multiple
40
37 Has automatic margins
41
38 Can use physical tabs
42
39 Number of lines
43
40 Number of columns
44
41 Has meta key
45
42 Newline ignored at right margin
(-)contrib/tcsh/nls/pl/set5 (+4 lines)
Line 0 Link Here
1
$ $tcsh: set5,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ ed.chared.c
3
$set 5
4
1 Średnie obciążenie niedostępne\n
(-)contrib/tcsh/nls/pl/set6 (+11 lines)
Line 0 Link Here
1
$ $tcsh: set6,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ ed.inputl.c
3
$set 6
4
1 ERROR: illegal command from key 0%o\r\n
5
2 tak\n
6
3 edytuj\n
7
4 przerwij\n
8
5 nie\n
9
6 Brak pasującego polecenia\n
10
7 Niejasne polecenie\n
11
8 *** BŁĄD fatalny edytora ***\r\n\n
(-)contrib/tcsh/nls/pl/set7 (+30 lines)
Line 0 Link Here
1
$ $tcsh: set7,v 1.3 1996/04/26 20:32:04 christos Exp $
2
$ ed.screen.c
3
$set 7
4
1 \n\tTcsh thinks your terminal has the\n
5
2 \tfollowing characteristics:\n\n
6
3 \tIt has %d columns and %d lines\n
7
4 \tIt has %s meta key\n
8
5 a
9
6 no
10
7 \tIt can%s use tabs\n
11
8 not
12
9 \tIt %s automatic margins\n
13
10 has
14
11 does not have
15
12 \tIt %s magic margins\n
16
13 (empty)
17
14 yes
18
15 no
19
16 ERROR: cannot delete\r\n
20
17 DeleteChars: num is riduculous: %d\r\n
21
18 ERROR: cannot insert\r\n
22
19 StartInsert: num is riduculous: %d\r\n
23
20 %s: Cannot open /etc/termcap.\n
24
21 %s: No entry for terminal type "%s"\n
25
22 %s: using dumb terminal settings.\n
26
23 %s: WARNING: Your terminal cannot move up.\n
27
24 Editing may be odd for long lines.\n
28
25 no clear EOL capability.\n
29
26 no delete char capability.\n
30
27 no insert char capability.\n
(-)contrib/tcsh/nls/pl/set8 (+5 lines)
Line 0 Link Here
1
$ $tcsh: set8,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ ed.term.c
3
$set 8
4
1 Nieprawidłowy przełącznik
5
2 Nieprawidłowy argument
(-)contrib/tcsh/nls/pl/set9 (+12 lines)
Line 0 Link Here
1
$ $tcsh: set9,v 1.2 1995/03/19 18:07:15 christos Exp $
2
$ ed.xmap.c
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
5
2 AddXkey: sequence-lead-in command not allowed\n
6
3 DeleteXkey: Null extended-key not allowed.\n
7
4 Unbound extended key "%S"\n
8
5 Some extended keys too long for internal print buffer
9
6 Enumerate: BUG!! Null ptr passed\n!
10
7 no input
11
8 Something must follow: '%c'\n
12
9 Octal constant does not fit in a char.\n
(-)contrib/tcsh/nls/russian/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.5 2011/02/04 18:19:41 christos Exp $
1
$ $tcsh: set1,v 1.6 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Синтаксическая ошибка
4
1 Синтаксическая ошибка
Lines 8-14 Link Here
8
5 Нет файла для $0
8
5 Нет файла для $0
9
6 Незавершённый модификатор []
9
6 Незавершённый модификатор []
10
7 $ расширение должно оканчиваться перед ]
10
7 $ расширение должно оканчиваться перед ]
11
8 Плохой модификатор в $ (%c)
11
8 Плохой модификатор в $ '%c'
12
9 Ошибка подпрограммы
12
9 Ошибка подпрограммы
13
10 Неправильно сформированное число
13
10 Неправильно сформированное число
14
11 Нет больше слов
14
11 Нет больше слов
Lines 51-58 Link Here
51
48 Не внутри while/foreach
51
48 Не внутри while/foreach
52
49 Нет больше процессов
52
49 Нет больше процессов
53
50 Нет соответствий
53
50 Нет соответствий
54
51 Отсутствует %c
54
51 Отсутствует '%c'
55
52 Нет соответствия для %c
55
52 Нет соответствия для '%c'
56
53 Нет памяти
56
53 Нет памяти
57
54 Не могу создать неименованный канал
57
54 Не могу создать неименованный канал
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Плохая подстановка
93
90 Плохая подстановка
94
91 Отсутствует предыдущая левая сторона
94
91 Отсутствует предыдущая левая сторона
95
92 Правая сторона слишком длинная
95
92 Правая сторона слишком длинная
96
93 Плохой модификатор !: %c
96
93 Плохой модификатор !: '%c'
97
94 Ошибка модификатора
97
94 Ошибка модификатора
98
95 Переполнение буфера подстановки
98
95 Переполнение буфера подстановки
99
96 Плохой селектор для аргумента !
99
96 Плохой селектор для аргумента !
Lines 118-124 Link Here
118
115 Переполнение строки termcap
118
115 Переполнение строки termcap
119
116 Использование: settc %s [yes|no]
119
116 Использование: settc %s [yes|no]
120
117 Неизвестная capability `%s'
120
117 Неизвестная capability `%s'
121
118 Неизвестный параметр termcap `%%%c'
121
118 Неизвестный параметр termcap '%%%c'
122
119 Слишком много аргументов для `%s' (%d)
122
119 Слишком много аргументов для `%s' (%d)
123
120 `%s' требует %d аргументов
123
120 `%s' требует %d аргументов
124
121 Использование: echotc [-v|-s] [<capability> [<аргументы>]]
124
121 Использование: echotc [-v|-s] [<capability> [<аргументы>]]
Lines 137-140 Link Here
137
134 Использование: unlimit [-fh] [пределы]
137
134 Использование: unlimit [-fh] [пределы]
138
135 $%S только для чтения
138
135 $%S только для чтения
139
136 Нет такого задания
139
136 Нет такого задания
140
137 Неизвестное значение `%c%c' переменной colorls
140
137 Неизвестное значение '%c%c' переменной colorls
(-)contrib/tcsh/nls/russian/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.6 2011/02/04 18:19:42 christos Exp $
1
$ $tcsh: set20,v 1.7 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Неверное имя клавиши `%S'\n
4
1 Неверное имя клавиши `%S'\n
Lines 19-25 Link Here
19
16     -c   воспринимать КОМАНДу как встроенную или внешнюю команду\n
19
16     -c   воспринимать КОМАНДу как встроенную или внешнюю команду\n
20
17     -v   привязать все клавиши в соответствии с редактором vi\n
20
17     -v   привязать все клавиши в соответствии с редактором vi\n
21
18     -e   привязать все клавиши в соответствии с редактором emacs\n
21
18     -e   привязать все клавиши в соответствии с редактором emacs\n
22
19     -d   привязать все клавиши в соответствии с редактором по умолчанию\n
22
19     -d   привязать все клавиши в соответствии с редактором по умолчанию (%s)\n
23
20     -l   вывести список команд редактора и их описания\n
23
20     -l   вывести список команд редактора и их описания\n
24
21     -r   удалить привязку КЛАВИШи\n
24
21     -r   удалить привязку КЛАВИШи\n
25
22     -k   воспринимать КЛАВИШу как явное название управляющей клавиши\n
25
22     -k   воспринимать КЛАВИШу как явное название управляющей клавиши\n
(-)contrib/tcsh/nls/russian/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.4 2011/02/04 18:19:42 christos Exp $
1
$ $tcsh: set9,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
4
1 AddXkey: Null extended-key not allowed.\n
Lines 8-12 Link Here
8
5 Some extended keys too long for internal print buffer
8
5 Some extended keys too long for internal print buffer
9
6 Enumerate: BUG!! Передан нулевой указатель!\n
9
6 Enumerate: BUG!! Передан нулевой указатель!\n
10
7 нет вводимых данных
10
7 нет вводимых данных
11
8 Something must follow: %c\n
11
8 Something must follow: '%c'\n
12
9 Восьмеричная константа не умещается в char.\n
12
9 Восьмеричная константа не умещается в char.\n
(-)contrib/tcsh/nls/spanish/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.4 2011/02/04 18:19:42 christos Exp $
1
$ $tcsh: set1,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ Mensajes de Error
2
$ Mensajes de Error
3
$set 1 
3
$set 1 
4
1 Error de sintaxis
4
1 Error de sintaxis
Lines 8-14 Link Here
8
5 No hay fichero para $0
8
5 No hay fichero para $0
9
6 Modificador [] incompleto
9
6 Modificador [] incompleto
10
7 $ expansión debe terminar antes de ]
10
7 $ expansión debe terminar antes de ]
11
8 Modificador erróneo : en $ (%c)
11
8 Modificador erróneo : en $ '%c'
12
9 Error de índice
12
9 Error de índice
13
10 Número erróneamente formado
13
10 Número erróneamente formado
14
11 No hay más palabras
14
11 No hay más palabras
Lines 51-58 Link Here
51
48 No se encuentra en bucle while/foreach
51
48 No se encuentra en bucle while/foreach
52
49 No hay más procesos
52
49 No hay más procesos
53
50 No existe correspondencia
53
50 No existe correspondencia
54
51 Falta %c
54
51 Falta '%c'
55
52 No se ha hallado correspondencia con %c
55
52 No se ha hallado correspondencia con '%c'
56
53 Memoria insuficiente
56
53 Memoria insuficiente
57
54 No se puede crear la tubería
57
54 No se puede crear la tubería
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Sustituto erróneo
93
90 Sustituto erróneo
94
91 No existe `lado izquierdo' previo
94
91 No existe `lado izquierdo' previo
95
92 Valor de asignación demasiado largo
95
92 Valor de asignación demasiado largo
96
93 Modificador de ! incorrecto: %c
96
93 Modificador de ! incorrecto: '%c'
97
94 Error de modificador
97
94 Error de modificador
98
95 Desborde el el buffer de sustitución
98
95 Desborde el el buffer de sustitución
99
96 Selector de argumento de ! erróneo
99
96 Selector de argumento de ! erróneo
Lines 118-124 Link Here
118
115 Se ha agotado el espacio para cadenas termcap
118
115 Se ha agotado el espacio para cadenas termcap
119
116 Uso: settc %s [yes|no]
119
116 Uso: settc %s [yes|no]
120
117 Característica `%s' desconocida
120
117 Característica `%s' desconocida
121
118 Parámetro termcap `%%%c' desconocido
121
118 Parámetro termcap '%%%c' desconocido
122
119 Demasiados argumentos para `%s' (%d)
122
119 Demasiados argumentos para `%s' (%d)
123
120 `%s' requiere %d argumentos
123
120 `%s' requiere %d argumentos
124
121 Uso: echotc [-v|-s] [<característica> [<args>]]
124
121 Uso: echotc [-v|-s] [<característica> [<args>]]
Lines 137-140 Link Here
137
134 Uso: unlimit [-fh] [límites]
137
134 Uso: unlimit [-fh] [límites]
138
135 $%S es de sólo-lectura
138
135 $%S es de sólo-lectura
139
136 No existe ese trabajo
139
136 No existe ese trabajo
140
137 Unknown colorls variable `%c%c'
140
137 Unknown colorls variable '%c%c'
(-)contrib/tcsh/nls/spanish/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.4 2011/02/04 18:19:43 christos Exp $
1
$ $tcsh: set20,v 1.5 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Nombre de tecla no válido `%S'\n
4
1 Nombre de tecla no válido `%S'\n
Lines 19-25 Link Here
19
16     -c   interpreta COMANDO como comando interno o externo\n
19
16     -c   interpreta COMANDO como comando interno o externo\n
20
17     -v   usa las definiciones del editor vi\n
20
17     -v   usa las definiciones del editor vi\n
21
18     -e   usa las definiciones del editor vi\n
21
18     -e   usa las definiciones del editor vi\n
22
19     -d   usa las definiciones del editor por defecto\n
22
19     -d   usa las definiciones del editor por defecto (%s)\n
23
20     -l   lista los comandos del editor y sus descripciones\n
23
20     -l   lista los comandos del editor y sus descripciones\n
24
21     -r   elimina la definición asociada a TECLA\n
24
21     -r   elimina la definición asociada a TECLA\n
25
22     -k   interpreta TECLA como nombre simbólico de tecla de flecha\n
25
22     -k   interpreta TECLA como nombre simbólico de tecla de flecha\n
(-)contrib/tcsh/nls/spanish/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.3 2011/02/04 18:19:43 christos Exp $
1
$ $tcsh: set9,v 1.4 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: No se permite una tecla extendida nula.\n
4
1 AddXkey: No se permite una tecla extendida nula.\n
Lines 8-12 Link Here
8
5 Algunas teclas extendidas son demasiado grandes para el buffer de impresión interno
8
5 Algunas teclas extendidas son demasiado grandes para el buffer de impresión interno
9
6 Enumerate: ¡¡BUG!! Se ha pasado un puntero nulo!\n
9
6 Enumerate: ¡¡BUG!! Se ha pasado un puntero nulo!\n
10
7 no hay entrada
10
7 no hay entrada
11
8 Falta algo a continuación: %c\n
11
8 Falta algo a continuación: '%c'\n
12
9 Una constante octal no cabe en un carácter.\n
12
9 Una constante octal no cabe en un carácter.\n
(-)contrib/tcsh/nls/ukrainian/set1 (-7 / +7 lines)
Lines 1-4 Link Here
1
$ $tcsh: set1,v 1.4 2011/02/04 18:19:44 christos Exp $
1
$ $tcsh: set1,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ Error messages
2
$ Error messages
3
$set 1 
3
$set 1 
4
1 Синтаксична помилка
4
1 Синтаксична помилка
Lines 8-14 Link Here
8
5 Немає файлу для $0
8
5 Немає файлу для $0
9
6 Неповний модифікатор []
9
6 Неповний модифікатор []
10
7 Розширення $ має бути перед ]
10
7 Розширення $ має бути перед ]
11
8 Поганий модифікатор : в $ (%c)
11
8 Поганий модифікатор : в $ '%c'
12
9 Помилковий індекс
12
9 Помилковий індекс
13
10 Число погано сформоване
13
10 Число погано сформоване
14
11 Не можна більше слів
14
11 Не можна більше слів
Lines 51-58 Link Here
51
48 Не у while/foreach
51
48 Не у while/foreach
52
49 Не можна більше процесів
52
49 Не можна більше процесів
53
50 Немає співпадань
53
50 Немає співпадань
54
51 Пропущено %c
54
51 Пропущено '%c'
55
52 Відсутній відповідник до %c
55
52 Відсутній відповідник до '%c'
56
53 Мало пам'яті
56
53 Мало пам'яті
57
54 Не можу створити канал
57
54 Не можу створити канал
58
55 %s: %s
58
55 %s: %s
Lines 93-99 Link Here
93
90 Погана підстановка
93
90 Погана підстановка
94
91 No previous left hand side
94
91 No previous left hand side
95
92 Right hand side too long
95
92 Right hand side too long
96
93 Поганий модифікатор !: %c
96
93 Поганий модифікатор !: '%c'
97
94 Невдача модифікатора
97
94 Невдача модифікатора
98
95 Переповнення буферу підстановки
98
95 Переповнення буферу підстановки
99
96 Bad ! arg selector
99
96 Bad ! arg selector
Lines 118-124 Link Here
118
115 Out of termcap string space
118
115 Out of termcap string space
119
116 Використання: settc %s [yes|no]
119
116 Використання: settc %s [yes|no]
120
117 Unknown capability `%s'
120
117 Unknown capability `%s'
121
118 Невідомий параметр termcap `%%%c'
121
118 Невідомий параметр termcap '%%%c'
122
119 Забагато аргументів для `%s' (%d)
122
119 Забагато аргументів для `%s' (%d)
123
120 `%s' вимагає %d аргумент(ів)
123
120 `%s' вимагає %d аргумент(ів)
124
121 Використання: echotc [-v|-s] [<capability> [<args>]]
124
121 Використання: echotc [-v|-s] [<capability> [<args>]]
Lines 137-140 Link Here
137
134 Використання: unlimit [-fh] [ліміти]
137
134 Використання: unlimit [-fh] [ліміти]
138
135 $%S лише для читання
138
135 $%S лише для читання
139
136 Немає такої задачі
139
136 Немає такої задачі
140
137 Невідоме значення змінної colorls: `%c%c'
140
137 Невідоме значення змінної colorls: '%c%c'
(-)contrib/tcsh/nls/ukrainian/set20 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set20,v 1.4 2011/02/04 18:19:44 christos Exp $
1
$ $tcsh: set20,v 1.5 2015/08/13 08:54:04 christos Exp $
2
$ tc.bind.c
2
$ tc.bind.c
3
$set 20 
3
$set 20 
4
1 Invalid key name `%S'\n
4
1 Invalid key name `%S'\n
Lines 19-25 Link Here
19
16     -c   interpret COMMAND as a builtin or external command\n
19
16     -c   interpret COMMAND as a builtin or external command\n
20
17     -v   bind all keys to vi bindings\n
20
17     -v   bind all keys to vi bindings\n
21
18     -e   bind all keys to emacs bindings\n
21
18     -e   bind all keys to emacs bindings\n
22
19     -d   bind all keys to default editor's bindings\n
22
19     -d   bind all keys to default editor's bindings (%s)\n
23
20     -l   list editor commands with descriptions\n
23
20     -l   list editor commands with descriptions\n
24
21     -r   remove KEY's binding\n
24
21     -r   remove KEY's binding\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
25
22     -k   interpret KEY as a symbolic arrow-key name\n
(-)contrib/tcsh/nls/ukrainian/set9 (-2 / +2 lines)
Lines 1-4 Link Here
1
$ $tcsh: set9,v 1.4 2011/02/04 18:19:45 christos Exp $
1
$ $tcsh: set9,v 1.5 2015/05/26 17:38:25 christos Exp $
2
$ ed.xmap.c
2
$ ed.xmap.c
3
$set 9
3
$set 9
4
1 AddXkey: Null extended-key not allowed.\n
4
1 AddXkey: Null extended-key not allowed.\n
Lines 8-12 Link Here
8
5 Some extended keys too long for internal print buffer
8
5 Some extended keys too long for internal print buffer
9
6 Enumerate: ПОМИЛКА!! Null ptr passed\n!
9
6 Enumerate: ПОМИЛКА!! Null ptr passed\n!
10
7 no input
10
7 no input
11
8 Something must follow: %c\n
11
8 Something must follow: '%c'\n
12
9 Octal constant does not fit in a char.\n
12
9 Octal constant does not fit in a char.\n
(-)contrib/tcsh/patchlevel.h (-4 / +4 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/patchlevel.h,v 3.180 2012/02/13 16:33:50 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/patchlevel.h,v 3.187 2016/11/24 15:04:52 christos Exp $ */
2
/*
2
/*
3
 * patchlevel.h: Our life story.
3
 * patchlevel.h: Our life story.
4
 */
4
 */
Lines 7-14 Link Here
7
7
8
#define ORIGIN "Astron"
8
#define ORIGIN "Astron"
9
#define REV 6
9
#define REV 6
10
#define VERS 18
10
#define VERS 20
11
#define PATCHLEVEL 1
11
#define PATCHLEVEL 00
12
#define DATE "2012-02-14"
12
#define DATE "2016-11-24"
13
13
14
#endif /* _h_patchlevel */
14
#endif /* _h_patchlevel */
(-)contrib/tcsh/sh.c (-17 / +36 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.c,v 3.174 2011/11/29 18:38:54 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.c,v 3.189 2016/09/12 16:33:54 christos Exp $ */
2
/*
2
/*
3
 * sh.c: Main shell routines
3
 * sh.c: Main shell routines
4
 */
4
 */
Lines 39-45 Link Here
39
 All rights reserved.\n";
39
 All rights reserved.\n";
40
#endif /* not lint */
40
#endif /* not lint */
41
41
42
RCSID("$tcsh: sh.c,v 3.174 2011/11/29 18:38:54 christos Exp $")
42
RCSID("$tcsh: sh.c,v 3.189 2016/09/12 16:33:54 christos Exp $")
43
43
44
#include "tc.h"
44
#include "tc.h"
45
#include "ed.h"
45
#include "ed.h"
Lines 78-84 Link Here
78
 * ported to Apple Unix (TM) (OREO)  26 -- 29 Jun 1987
78
 * ported to Apple Unix (TM) (OREO)  26 -- 29 Jun 1987
79
 */
79
 */
80
80
81
jmp_buf_t reslab;
81
jmp_buf_t reslab IZERO_STRUCT;
82
struct wordent paraml IZERO_STRUCT;
82
83
83
static const char tcshstr[] = "tcsh";
84
static const char tcshstr[] = "tcsh";
84
85
Lines 250-259 Link Here
250
    int osetintr;
251
    int osetintr;
251
    struct sigaction oparintr;
252
    struct sigaction oparintr;
252
253
253
    (void)memset(&reslab, 0, sizeof(reslab));
254
#ifdef WINNT_NATIVE
254
#ifdef WINNT_NATIVE
255
    nt_init();
255
    nt_init();
256
#endif /* WINNT_NATIVE */
256
#endif /* WINNT_NATIVE */
257
258
    (void)memset(&reslab, 0, sizeof(reslab));
257
#if defined(NLS_CATALOGS) && defined(LC_MESSAGES)
259
#if defined(NLS_CATALOGS) && defined(LC_MESSAGES)
258
    (void) setlocale(LC_MESSAGES, "");
260
    (void) setlocale(LC_MESSAGES, "");
259
#endif /* NLS_CATALOGS && LC_MESSAGES */
261
#endif /* NLS_CATALOGS && LC_MESSAGES */
Lines 272-277 Link Here
272
#endif
274
#endif
273
275
274
    nlsinit();
276
    nlsinit();
277
    initlex(&paraml);
275
278
276
#ifdef MALLOC_TRACE
279
#ifdef MALLOC_TRACE
277
    mal_setstatsfile(fdopen(dmove(xopen("/tmp/tcsh.trace", 
280
    mal_setstatsfile(fdopen(dmove(xopen("/tmp/tcsh.trace", 
Lines 343-348 Link Here
343
# endif
346
# endif
344
#endif
347
#endif
345
    STR_WORD_CHARS = SAVE(WORD_CHARS);
348
    STR_WORD_CHARS = SAVE(WORD_CHARS);
349
    STR_WORD_CHARS_VI = SAVE(WORD_CHARS_VI);
346
350
347
    HIST = '!';
351
    HIST = '!';
348
    HISTSUB = '^';
352
    HISTSUB = '^';
Lines 355-360 Link Here
355
359
356
    /* Default history size to 100 */
360
    /* Default history size to 100 */
357
    setcopy(STRhistory, str2short("100"), VAR_READWRITE);
361
    setcopy(STRhistory, str2short("100"), VAR_READWRITE);
362
    sethistory(100);
358
363
359
    tempv = argv;
364
    tempv = argv;
360
    ffile = SAVE(tempv[0]);
365
    ffile = SAVE(tempv[0]);
Lines 477-482 Link Here
477
     */
482
     */
478
    initdesc();
483
    initdesc();
479
484
485
    cdtohome = 1;
486
    setv(STRcdtohome, SAVE(""), VAR_READWRITE);
487
480
    /*
488
    /*
481
     * Get and set the tty now
489
     * Get and set the tty now
482
     */
490
     */
Lines 493-498 Link Here
493
    }
501
    }
494
    else
502
    else
495
	setv(STRtty, cp = SAVE(""), VAR_READWRITE);
503
	setv(STRtty, cp = SAVE(""), VAR_READWRITE);
504
496
    /*
505
    /*
497
     * Initialize the shell variables. ARGV and PROMPT are initialized later.
506
     * Initialize the shell variables. ARGV and PROMPT are initialized later.
498
     * STATUS is also munged in several places. CHILD is munged when
507
     * STATUS is also munged in several places. CHILD is munged when
Lines 588-606 Link Here
588
     */
597
     */
589
    shlvl(1);
598
    shlvl(1);
590
599
591
    if ((tcp = getenv("HOME")) != NULL)
592
	cp = quote(SAVE(tcp));
593
    else
594
#ifdef __ANDROID__
600
#ifdef __ANDROID__
595
	/* On Android, $HOME usually isn't set, so we can't load user RC files.
601
    /* On Android, $HOME either isn't set or set to /data, a R/O location.
596
	   Check for the environment variable EXTERNAL_STORAGE, which contains
602
       Check for the environment variable EXTERNAL_STORAGE, which contains
597
	   the mount point of the external storage (SD card, mostly).  If
603
       the mount point of the external storage (SD card, mostly).  If
598
	   EXTERNAL_STORAGE isn't set fall back to "/sdcard". */
604
       EXTERNAL_STORAGE isn't set fall back to "/sdcard".  Eventually
599
    if ((tcp = getenv("EXTERNAL_STORAGE")) != NULL)
605
       override $HOME so the environment is on the same page. */
606
    if (((tcp = getenv("HOME")) != NULL && strcmp (tcp, "/data") != 0)
607
	|| (tcp = getenv("EXTERNAL_STORAGE")) != NULL) {
600
	cp = quote(SAVE(tcp));
608
	cp = quote(SAVE(tcp));
601
    else
609
    } else
602
	cp = quote(SAVE("/sdcard"));
610
	cp = quote(SAVE("/sdcard"));
611
    tsetenv(STRKHOME, cp);
603
#else
612
#else
613
    if ((tcp = getenv("HOME")) != NULL)
614
	cp = quote(SAVE(tcp));
615
    else
604
	cp = NULL;
616
	cp = NULL;
605
#endif
617
#endif
606
618
Lines 797-805 Link Here
797
#ifdef COLOR_LS_F
809
#ifdef COLOR_LS_F
798
    if ((tcp = getenv("LS_COLORS")) != NULL)
810
    if ((tcp = getenv("LS_COLORS")) != NULL)
799
	parseLS_COLORS(str2short(tcp));
811
	parseLS_COLORS(str2short(tcp));
812
    if ((tcp = getenv("LSCOLORS")) != NULL)
813
	parseLSCOLORS(str2short(tcp));
800
#endif /* COLOR_LS_F */
814
#endif /* COLOR_LS_F */
801
815
802
    doldol = putn((tcsh_number_t)getpid());	/* For $$ */
816
    mainpid = getpid();
817
    doldol = putn((tcsh_number_t)mainpid);	/* For $$ */
803
#ifdef WINNT_NATIVE
818
#ifdef WINNT_NATIVE
804
    {
819
    {
805
	char *tmp;
820
	char *tmp;
Lines 818-824 Link Here
818
#else /* !WINNT_NATIVE */
833
#else /* !WINNT_NATIVE */
819
#ifdef HAVE_MKSTEMP
834
#ifdef HAVE_MKSTEMP
820
    {
835
    {
821
	char *tmpdir = getenv ("TMPDIR");
836
	const char *tmpdir = getenv ("TMPDIR");
822
	if (!tmpdir)
837
	if (!tmpdir)
823
	    tmpdir = "/tmp";
838
	    tmpdir = "/tmp";
824
	shtemp = Strspl(SAVE(tmpdir), SAVE("/sh" TMP_TEMPLATE)); /* For << */
839
	shtemp = Strspl(SAVE(tmpdir), SAVE("/sh" TMP_TEMPLATE)); /* For << */
Lines 1215-1221 Link Here
1215
1230
1216
#ifdef NeXT
1231
#ifdef NeXT
1217
	    /* NeXT 2.0 /usr/etc/rlogind, does not set our process group! */
1232
	    /* NeXT 2.0 /usr/etc/rlogind, does not set our process group! */
1218
	    if (shpgrp == 0) {
1233
	    if (f != -1 && shpgrp == 0) {
1219
	        shpgrp = getpid();
1234
	        shpgrp = getpid();
1220
		(void) setpgid(0, shpgrp);
1235
		(void) setpgid(0, shpgrp);
1221
	        (void) tcsetpgrp(f, shpgrp);
1236
	        (void) tcsetpgrp(f, shpgrp);
Lines 1222-1228 Link Here
1222
	    }
1237
	    }
1223
#endif /* NeXT */
1238
#endif /* NeXT */
1224
#ifdef BSDJOBS			/* if we have tty job control */
1239
#ifdef BSDJOBS			/* if we have tty job control */
1225
	    if (grabpgrp(f, shpgrp) != -1) {
1240
	    if (f != -1 && grabpgrp(f, shpgrp) != -1) {
1226
		/*
1241
		/*
1227
		 * Thanks to Matt Day for the POSIX references, and to
1242
		 * Thanks to Matt Day for the POSIX references, and to
1228
		 * Paul Close for the SGI clarification.
1243
		 * Paul Close for the SGI clarification.
Lines 1904-1909 Link Here
1904
    {
1919
    {
1905
	(void) Cookedmode();
1920
	(void) Cookedmode();
1906
	GettingInput = 0;
1921
	GettingInput = 0;
1922
	if (evalvec)
1923
	    doneinp = 1;
1907
    }
1924
    }
1908
    drainoline();
1925
    drainoline();
1909
#ifdef HAVE_GETPWENT
1926
#ifdef HAVE_GETPWENT
Lines 2037-2042 Link Here
2037
	 */
2054
	 */
2038
	if (setintr)
2055
	if (setintr)
2039
	    pintr_push_enable(&old_pintr_disabled);
2056
	    pintr_push_enable(&old_pintr_disabled);
2057
	freelex(&paraml);
2040
	hadhist = lex(&paraml);
2058
	hadhist = lex(&paraml);
2041
	if (setintr)
2059
	if (setintr)
2042
	    cleanup_until(&old_pintr_disabled);
2060
	    cleanup_until(&old_pintr_disabled);
Lines 2178-2183 Link Here
2178
    cleanup_push(file, xfree);
2196
    cleanup_push(file, xfree);
2179
    xfree(f);
2197
    xfree(f);
2180
    t = glob_all_or_error(t);
2198
    t = glob_all_or_error(t);
2199
    cleanup_push(t, blk_cleanup);
2181
    if ((!srcfile(file, 0, hflg, t)) && (!hflg) && (!bequiet))
2200
    if ((!srcfile(file, 0, hflg, t)) && (!hflg) && (!bequiet))
2182
	stderror(ERR_SYSTEM, file, strerror(errno));
2201
	stderror(ERR_SYSTEM, file, strerror(errno));
2183
    cleanup_until(file);
2202
    cleanup_until(file);
(-)contrib/tcsh/sh.char.h (-5 / +5 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.h,v 3.36 2010/05/08 00:36:02 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.h,v 3.37 2014/05/09 19:22:49 christos Exp $ */
2
/*
2
/*
3
 * sh.char.h: Table for spotting special characters quickly
3
 * sh.char.h: Table for spotting special characters quickly
4
 * 	      Makes for very obscure but efficient coding.
4
 * 	      Makes for very obscure but efficient coding.
Lines 167-181 Link Here
167
#define iscmdmeta(c)	cmap((c), _CMD)
167
#define iscmdmeta(c)	cmap((c), _CMD)
168
#ifdef WIDE_STRINGS
168
#ifdef WIDE_STRINGS
169
#define letter(c)	(((c) & QUOTE) ? 0 :  \
169
#define letter(c)	(((c) & QUOTE) ? 0 :  \
170
			 (iswalpha((tcshuc) (c)) || (c) == '_'))
170
			 (iswalpha((c)) || (c) == '_'))
171
#define alnum(c)	(((c) & QUOTE) ? 0 :  \
171
#define alnum(c)	(((c) & QUOTE) ? 0 :  \
172
		         (iswalnum((tcshuc) (c)) || (c) == '_'))
172
		         (iswalnum((c)) || (c) == '_'))
173
#else
173
#else
174
#define letter(c)	(((Char)(c) & QUOTE) ? 0 :  \
174
#define letter(c)	(((Char)(c) & QUOTE) ? 0 :  \
175
			 ((isalpha((tcshuc) (c)) && !(cmap((c), _PUN))) \
175
			 ((isalpha((c)) && !(cmap((c), _PUN))) \
176
			  || (c) == '_'))
176
			  || (c) == '_'))
177
#define alnum(c)	(((Char)(c) & QUOTE) ? 0 :  \
177
#define alnum(c)	(((Char)(c) & QUOTE) ? 0 :  \
178
		         ((isalnum((tcshuc) (c)) && !(cmap((c), _PUN))) \
178
		         ((isalnum((c)) && !(cmap((c), _PUN))) \
179
			  || (c) == '_'))
179
			  || (c) == '_'))
180
180
181
#endif
181
#endif
(-)contrib/tcsh/sh.decls.h (-1 / +7 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.decls.h,v 3.62 2011/02/25 23:58:34 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.decls.h,v 3.68 2016/08/01 16:21:09 christos Exp $ */
2
/*
2
/*
3
 * sh.decls.h	 External declarations from sh*.c
3
 * sh.decls.h	 External declarations from sh*.c
4
 */
4
 */
Lines 78-83 Link Here
78
extern	void		  Dfix		(struct command *);
78
extern	void		  Dfix		(struct command *);
79
extern	Char		 *Dfix1		(Char *);
79
extern	Char		 *Dfix1		(Char *);
80
extern	void		  heredoc	(Char *);
80
extern	void		  heredoc	(Char *);
81
extern  Char		 *randsuf	(void);
81
82
82
/*
83
/*
83
 * sh.err.c
84
 * sh.err.c
Lines 184-189 Link Here
184
extern	void		  wfree		(void);
185
extern	void		  wfree		(void);
185
extern	void		  dobuiltins	(Char **, struct command *);
186
extern	void		  dobuiltins	(Char **, struct command *);
186
extern	void		  reexecute	(struct command *);
187
extern	void		  reexecute	(struct command *);
188
extern  int		  getYN		(const char *);
187
189
188
/*
190
/*
189
 * sh.glob.c
191
 * sh.glob.c
Lines 221-226 Link Here
221
extern	void		  rechist	(Char *, int);
223
extern	void		  rechist	(Char *, int);
222
extern	void		  loadhist	(Char *, int);
224
extern	void		  loadhist	(Char *, int);
223
extern	void		  displayHistStats(const char *);
225
extern	void		  displayHistStats(const char *);
226
extern	void		  sethistory	(int);
224
227
225
/*
228
/*
226
 * sh.init.c
229
 * sh.init.c
Lines 236-241 Link Here
236
extern	void		  btoeof	(void);
239
extern	void		  btoeof	(void);
237
extern	void		  copylex	(struct wordent *, struct wordent *);
240
extern	void		  copylex	(struct wordent *, struct wordent *);
238
extern	Char		 *domod		(Char *, Char);
241
extern	Char		 *domod		(Char *, Char);
242
extern	void		  initlex	(struct wordent *);
239
extern	void		  freelex	(struct wordent *);
243
extern	void		  freelex	(struct wordent *);
240
extern	int		  lex		(struct wordent *);
244
extern	int		  lex		(struct wordent *);
241
extern	void		  lex_cleanup	(void *);
245
extern	void		  lex_cleanup	(void *);
Lines 243-248 Link Here
243
extern	eChar		  readc		(int);
247
extern	eChar		  readc		(int);
244
extern	void		  settell	(void);
248
extern	void		  settell	(void);
245
extern	void		  unreadc	(Char);
249
extern	void		  unreadc	(Char);
250
extern	ssize_t		  wide_read	(int, Char *, size_t, int);
246
251
247
252
248
/*
253
/*
Lines 397-402 Link Here
397
#if defined(AUTOSET_KANJI)
402
#if defined(AUTOSET_KANJI)
398
extern	void		  autoset_kanji	(void);
403
extern	void		  autoset_kanji	(void);
399
#endif
404
#endif
405
extern	void		  update_wordchars	(void);
400
406
401
/*
407
/*
402
 * sh.time.c
408
 * sh.time.c
(-)contrib/tcsh/sh.dir.c (-3 / +6 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.82 2011/10/16 16:25:05 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.85 2016/04/08 16:10:52 christos Exp $ */
2
/*
2
/*
3
 * sh.dir.c: Directory manipulation functions
3
 * sh.dir.c: Directory manipulation functions
4
 */
4
 */
Lines 33-39 Link Here
33
#include "sh.h"
33
#include "sh.h"
34
#include "ed.h"
34
#include "ed.h"
35
35
36
RCSID("$tcsh: sh.dir.c,v 3.82 2011/10/16 16:25:05 christos Exp $")
36
RCSID("$tcsh: sh.dir.c,v 3.85 2016/04/08 16:10:52 christos Exp $")
37
37
38
/*
38
/*
39
 * C Shell - directory management
39
 * C Shell - directory management
Lines 501-507 Link Here
501
    cp = (dflag & DIR_OLD) ? varval(STRowd) : *v;
501
    cp = (dflag & DIR_OLD) ? varval(STRowd) : *v;
502
502
503
    if (cp == NULL) {
503
    if (cp == NULL) {
504
	if ((cp = varval(STRhome)) == STRNULL || *cp == 0)
504
	if (!cdtohome)
505
	    stderror(ERR_NAME | ERR_TOOFEW);
506
	else if ((cp = varval(STRhome)) == STRNULL || *cp == 0)
505
	    stderror(ERR_NAME | ERR_NOHOMEDIR);
507
	    stderror(ERR_NAME | ERR_NOHOMEDIR);
506
	if (chdir(short2str(cp)) < 0)
508
	if (chdir(short2str(cp)) < 0)
507
	    stderror(ERR_NAME | ERR_CANTCHANGE);
509
	    stderror(ERR_NAME | ERR_CANTCHANGE);
Lines 674-679 Link Here
674
		cleanup_until(cp);
676
		cleanup_until(cp);
675
		return dgoto(cp);
677
		return dgoto(cp);
676
	    }
678
	    }
679
	    xfree(dp);
677
	}
680
	}
678
	xfree(buf.s);
681
	xfree(buf.s);
679
    }
682
    }
(-)contrib/tcsh/sh.dol.c (-9 / +17 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.dol.c,v 3.83 2011/01/25 20:10:46 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.dol.c,v 3.87 2014/08/13 23:39:34 amold Exp $ */
2
/*
2
/*
3
 * sh.dol.c: Variable substitutions
3
 * sh.dol.c: Variable substitutions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.dol.c,v 3.83 2011/01/25 20:10:46 christos Exp $")
35
RCSID("$tcsh: sh.dol.c,v 3.87 2014/08/13 23:39:34 amold Exp $")
36
36
37
/*
37
/*
38
 * C shell
38
 * C shell
Lines 825-833 Link Here
825
		    (void) Strcpy(np + diff, rhsub);
825
		    (void) Strcpy(np + diff, rhsub);
826
		    (void) Strcpy(np + diff + rhlen, dp + lhlen);
826
		    (void) Strcpy(np + diff + rhlen, dp + lhlen);
827
827
828
		    dp = np + diff + 1;
829
		    xfree(cp);
828
		    xfree(cp);
830
		    cp = np;
829
		    dp = cp = np;
831
		    cp[--len] = '\0';
830
		    cp[--len] = '\0';
832
		    didmod = 1;
831
		    didmod = 1;
833
		    if (diff >= (ssize_t)len)
832
		    if (diff >= (ssize_t)len)
Lines 920-925 Link Here
920
    inheredoc = 0;
919
    inheredoc = 0;
921
}
920
}
922
921
922
Char *
923
randsuf(void) {
924
#ifndef WINNT_NATIVE
925
	struct timeval tv;
926
	(void) gettimeofday(&tv, NULL);
927
	return putn((((tcsh_number_t)tv.tv_sec) ^ 
928
	    ((tcsh_number_t)tv.tv_usec) ^
929
	    ((tcsh_number_t)getpid())) & 0x00ffffff);
930
#else
931
    return putn(getpid());
932
#endif
933
}
934
923
/*
935
/*
924
 * Form a shell temporary file (in unit 0) from the words
936
 * Form a shell temporary file (in unit 0) from the words
925
 * of the shell input up to EOF or a line the same as "term".
937
 * of the shell input up to EOF or a line the same as "term".
Lines 950-956 Link Here
950
#else /* !HAVE_MKSTEMP */
962
#else /* !HAVE_MKSTEMP */
951
    char   *tmp;
963
    char   *tmp;
952
# ifndef WINNT_NATIVE
964
# ifndef WINNT_NATIVE
953
    struct timeval tv;
954
965
955
again:
966
again:
956
# endif /* WINNT_NATIVE */
967
# endif /* WINNT_NATIVE */
Lines 966-976 Link Here
966
# ifndef WINNT_NATIVE
977
# ifndef WINNT_NATIVE
967
	if (errno == EEXIST) {
978
	if (errno == EEXIST) {
968
	    if (unlink(tmp) == -1) {
979
	    if (unlink(tmp) == -1) {
969
		(void) gettimeofday(&tv, NULL);
970
		xfree(shtemp);
980
		xfree(shtemp);
971
		mbp = putn((((tcsh_number_t)tv.tv_sec) ^ 
981
		mbp = randsuf();
972
		    ((tcsh_number_t)tv.tv_usec) ^
973
		    ((tcsh_number_t)getpid())) & 0x00ffffff);
974
		shtemp = Strspl(STRtmpsh, mbp);
982
		shtemp = Strspl(STRtmpsh, mbp);
975
		xfree(mbp);
983
		xfree(mbp);
976
	    }
984
	    }
(-)contrib/tcsh/sh.err.c (-12 / +12 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.err.c,v 3.55 2011/02/25 23:58:34 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.err.c,v 3.57 2015/05/26 17:32:45 christos Exp $ */
2
/*
2
/*
3
 * sh.err.c: Error printing routines. 
3
 * sh.err.c: Error printing routines. 
4
 */
4
 */
Lines 34-40 Link Here
34
#include "sh.h"
34
#include "sh.h"
35
#include <assert.h>
35
#include <assert.h>
36
36
37
RCSID("$tcsh: sh.err.c,v 3.55 2011/02/25 23:58:34 christos Exp $")
37
RCSID("$tcsh: sh.err.c,v 3.57 2015/05/26 17:32:45 christos Exp $")
38
38
39
/*
39
/*
40
 * C Shell
40
 * C Shell
Lines 218-224 Link Here
218
    elst[ERR_DOLZERO] = CSAVS(1, 5, "No file for $0");
218
    elst[ERR_DOLZERO] = CSAVS(1, 5, "No file for $0");
219
    elst[ERR_INCBR] = CSAVS(1, 6, "Incomplete [] modifier");
219
    elst[ERR_INCBR] = CSAVS(1, 6, "Incomplete [] modifier");
220
    elst[ERR_EXPORD] = CSAVS(1, 7, "$ expansion must end before ]");
220
    elst[ERR_EXPORD] = CSAVS(1, 7, "$ expansion must end before ]");
221
    elst[ERR_BADMOD] = CSAVS(1, 8, "Bad : modifier in $ (%c)");
221
    elst[ERR_BADMOD] = CSAVS(1, 8, "Bad : modifier in $ '%c'");
222
    elst[ERR_SUBSCRIPT] = CSAVS(1, 9, "Subscript error");
222
    elst[ERR_SUBSCRIPT] = CSAVS(1, 9, "Subscript error");
223
    elst[ERR_BADNUM] = CSAVS(1, 10, "Badly formed number");
223
    elst[ERR_BADNUM] = CSAVS(1, 10, "Badly formed number");
224
    elst[ERR_NOMORE] = CSAVS(1, 11, "No more words");
224
    elst[ERR_NOMORE] = CSAVS(1, 11, "No more words");
Lines 262-269 Link Here
262
    elst[ERR_NOTWHILE] = CSAVS(1, 48, "Not in while/foreach");
262
    elst[ERR_NOTWHILE] = CSAVS(1, 48, "Not in while/foreach");
263
    elst[ERR_NOPROC] = CSAVS(1, 49, "No more processes");
263
    elst[ERR_NOPROC] = CSAVS(1, 49, "No more processes");
264
    elst[ERR_NOMATCH] = CSAVS(1, 50, "No match");
264
    elst[ERR_NOMATCH] = CSAVS(1, 50, "No match");
265
    elst[ERR_MISSING] = CSAVS(1, 51, "Missing %c");
265
    elst[ERR_MISSING] = CSAVS(1, 51, "Missing '%c'");
266
    elst[ERR_UNMATCHED] = CSAVS(1, 52, "Unmatched %c");
266
    elst[ERR_UNMATCHED] = CSAVS(1, 52, "Unmatched '%c'");
267
    elst[ERR_NOMEM] = CSAVS(1, 53, "Out of memory");
267
    elst[ERR_NOMEM] = CSAVS(1, 53, "Out of memory");
268
    elst[ERR_PIPE] = CSAVS(1, 54, "Can't make pipe");
268
    elst[ERR_PIPE] = CSAVS(1, 54, "Can't make pipe");
269
    elst[ERR_SYSTEM] = CSAVS(1, 55, "%s: %s");
269
    elst[ERR_SYSTEM] = CSAVS(1, 55, "%s: %s");
Lines 309-315 Link Here
309
    elst[ERR_BADSUBST] = CSAVS(1, 90, "Bad substitute");
309
    elst[ERR_BADSUBST] = CSAVS(1, 90, "Bad substitute");
310
    elst[ERR_LHS] = CSAVS(1, 91, "No previous left hand side");
310
    elst[ERR_LHS] = CSAVS(1, 91, "No previous left hand side");
311
    elst[ERR_RHSLONG] = CSAVS(1, 92, "Right hand side too long");
311
    elst[ERR_RHSLONG] = CSAVS(1, 92, "Right hand side too long");
312
    elst[ERR_BADBANGMOD] = CSAVS(1, 93, "Bad ! modifier: %c");
312
    elst[ERR_BADBANGMOD] = CSAVS(1, 93, "Bad ! modifier: '%c'");
313
    elst[ERR_MODFAIL] = CSAVS(1, 94, "Modifier failed");
313
    elst[ERR_MODFAIL] = CSAVS(1, 94, "Modifier failed");
314
    elst[ERR_SUBOVFL] = CSAVS(1, 95, "Substitution buffer overflow");
314
    elst[ERR_SUBOVFL] = CSAVS(1, 95, "Substitution buffer overflow");
315
    elst[ERR_BADBANGARG] = CSAVS(1, 96, "Bad ! arg selector");
315
    elst[ERR_BADBANGARG] = CSAVS(1, 96, "Bad ! arg selector");
Lines 335-341 Link Here
335
    elst[ERR_TCNOSTR] = CSAVS(1, 115, "Out of termcap string space");
335
    elst[ERR_TCNOSTR] = CSAVS(1, 115, "Out of termcap string space");
336
    elst[ERR_SETTCUS] = CSAVS(1, 116, "Usage: settc %s [yes|no]");
336
    elst[ERR_SETTCUS] = CSAVS(1, 116, "Usage: settc %s [yes|no]");
337
    elst[ERR_TCCAP] = CSAVS(1, 117, "Unknown capability `%s'");
337
    elst[ERR_TCCAP] = CSAVS(1, 117, "Unknown capability `%s'");
338
    elst[ERR_TCPARM] = CSAVS(1, 118, "Unknown termcap parameter `%%%c'");
338
    elst[ERR_TCPARM] = CSAVS(1, 118, "Unknown termcap parameter '%%%c'");
339
    elst[ERR_TCARGS] = CSAVS(1, 119, "Too many arguments for `%s' (%d)");
339
    elst[ERR_TCARGS] = CSAVS(1, 119, "Too many arguments for `%s' (%d)");
340
    elst[ERR_TCNARGS] = CSAVS(1, 120, "`%s' requires %d arguments");
340
    elst[ERR_TCNARGS] = CSAVS(1, 120, "`%s' requires %d arguments");
341
    elst[ERR_TCUSAGE] = CSAVS(1, 121,
341
    elst[ERR_TCUSAGE] = CSAVS(1, 121,
Lines 365-371 Link Here
365
    elst[ERR_ULIMUS] = CSAVS(1, 134, "Usage: unlimit [-fh] [limits]");
365
    elst[ERR_ULIMUS] = CSAVS(1, 134, "Usage: unlimit [-fh] [limits]");
366
    elst[ERR_READONLY] = CSAVS(1, 135, "$%S is read-only");
366
    elst[ERR_READONLY] = CSAVS(1, 135, "$%S is read-only");
367
    elst[ERR_BADJOB] = CSAVS(1, 136, "No such job (badjob)");
367
    elst[ERR_BADJOB] = CSAVS(1, 136, "No such job (badjob)");
368
    elst[ERR_BADCOLORVAR] = CSAVS(1, 137, "Unknown colorls variable `%c%c'");
368
    elst[ERR_BADCOLORVAR] = CSAVS(1, 137, "Unknown colorls variable '%c%c'");
369
    elst[ERR_EOF] = CSAVS(1, 138, "Unexpected end of file");
369
    elst[ERR_EOF] = CSAVS(1, 138, "Unexpected end of file");
370
}
370
}
371
371
Lines 380-389 Link Here
380
#endif
380
#endif
381
};
381
};
382
382
383
static struct cleanup_entry *cleanup_stack; /* = NULL; */
383
static struct cleanup_entry *cleanup_stack INIT_ZERO; /* = NULL; */
384
static size_t cleanup_sp; /* = 0; Next free entry */
384
static size_t cleanup_sp INIT_ZERO; /* = 0; Next free entry */
385
static size_t cleanup_mark; /* = 0; Last entry to handle before unwinding */
385
static size_t cleanup_mark INIT_ZERO; /* = 0; Last entry to handle before unwinding */
386
static size_t cleanup_stack_size; /* = 0 */
386
static size_t cleanup_stack_size INIT_ZERO; /* = 0 */
387
387
388
/* fn() will be run with all signals blocked, so it should not do anything
388
/* fn() will be run with all signals blocked, so it should not do anything
389
   risky. */
389
   risky. */
(-)contrib/tcsh/sh.exec.c (-5 / +13 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.79 2011/02/25 23:58:34 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.81 2016/09/12 16:33:54 christos Exp $ */
2
/*
2
/*
3
 * sh.exec.c: Search, find, and execute a command!
3
 * sh.exec.c: Search, find, and execute a command!
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.exec.c,v 3.79 2011/02/25 23:58:34 christos Exp $")
35
RCSID("$tcsh: sh.exec.c,v 3.81 2016/09/12 16:33:54 christos Exp $")
36
36
37
#include "tc.h"
37
#include "tc.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 606-614 Link Here
606
    cleanup_push(&state, execash_cleanup);
606
    cleanup_push(&state, execash_cleanup);
607
607
608
    /*
608
    /*
609
     * Decrement the shell level
609
     * Decrement the shell level, if not in a subshell
610
     */
610
     */
611
    shlvl(-1);
611
    if (mainpid == getpid())
612
	shlvl(-1);
612
#ifdef WINNT_NATIVE
613
#ifdef WINNT_NATIVE
613
    __nt_really_exec=1;
614
    __nt_really_exec=1;
614
#endif /* WINNT_NATIVE */
615
#endif /* WINNT_NATIVE */
Lines 1070-1075 Link Here
1070
{
1071
{
1071
    int found = 1;
1072
    int found = 1;
1072
    USE(c);
1073
    USE(c);
1074
1075
    if (adrof(STRautorehash))
1076
	dohash(NULL, NULL);
1073
    for (v++; *v; v++)
1077
    for (v++; *v; v++)
1074
	found &= find_cmd(*v, 1);
1078
	found &= find_cmd(*v, 1);
1075
    /* Make status nonzero if any command is not found. */
1079
    /* Make status nonzero if any command is not found. */
Lines 1166-1172 Link Here
1166
		return rval;
1170
		return rval;
1167
	}
1171
	}
1168
    }
1172
    }
1169
    if (adrof(STRautorehash) && !rehashed && havhash) {
1173
    /*
1174
     * If we are printing, we are being called from dowhere() which it 
1175
     * has rehashed already
1176
     */
1177
    if (!prt && adrof(STRautorehash) && !rehashed && havhash) {
1170
	dohash(NULL, NULL);
1178
	dohash(NULL, NULL);
1171
	rehashed = 1;
1179
	rehashed = 1;
1172
	goto retry;
1180
	goto retry;
(-)contrib/tcsh/sh.exp.c (-7 / +7 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.exp.c,v 3.58 2011/12/25 15:21:50 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.exp.c,v 3.63 2015/12/09 17:17:43 christos Exp $ */
2
/*
2
/*
3
 * sh.exp.c: Expression evaluations
3
 * sh.exp.c: Expression evaluations
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.exp.c,v 3.58 2011/12/25 15:21:50 christos Exp $")
35
RCSID("$tcsh: sh.exp.c,v 3.63 2015/12/09 17:17:43 christos Exp $")
36
36
37
#include "tw.h"
37
#include "tw.h"
38
38
Lines 172-177 Link Here
172
		    mode <<= 3;
172
		    mode <<= 3;
173
		    break;
173
		    break;
174
		}
174
		}
175
	    xfree(groups);
175
	}
176
	}
176
    }
177
    }
177
# endif /* NGROUPS_MAX */
178
# endif /* NGROUPS_MAX */
Lines 322-328 Link Here
322
	cleanup_push(p2, xfree);
323
	cleanup_push(p2, xfree);
323
	etracc("exp2c p2", p2, vp);
324
	etracc("exp2c p2", p2, vp);
324
	if (!(ignore & TEXP_IGNORE))
325
	if (!(ignore & TEXP_IGNORE))
325
	    switch (i) {
326
	    switch ((int)i) {
326
327
327
	    case EQEQ:
328
	    case EQEQ:
328
		i = eq(p1, p2);
329
		i = eq(p1, p2);
Lines 367-373 Link Here
367
	cleanup_push(p2, xfree);
368
	cleanup_push(p2, xfree);
368
	etracc("exp3 p2", p2, vp);
369
	etracc("exp3 p2", p2, vp);
369
	if (!(ignore & TEXP_IGNORE))
370
	if (!(ignore & TEXP_IGNORE))
370
	    switch (i) {
371
	    switch ((int)i) {
371
372
372
	    case GTR:
373
	    case GTR:
373
		i = egetn(p1) > egetn(p2);
374
		i = egetn(p1) > egetn(p2);
Lines 632-638 Link Here
632
    int altout = 0;
633
    int altout = 0;
633
    Char *ft = cp, *dp, *ep, *strdev, *strino, *strF, *str, valtest = '\0',
634
    Char *ft = cp, *dp, *ep, *strdev, *strino, *strF, *str, valtest = '\0',
634
    *errval = STR0;
635
    *errval = STR0;
635
    char *string, string0[22 + MB_LEN_MAX + 1];	// space for 64 bit octal
636
    char *string, string0[22 + MB_LEN_MAX + 1];	/* space for 64 bit octal */
636
    time_t footime;
637
    time_t footime;
637
    struct passwd *pw;
638
    struct passwd *pw;
638
    struct group *gr;
639
    struct group *gr;
Lines 954-961 Link Here
954
    struct wordent *wdp = hp;
955
    struct wordent *wdp = hp;
955
956
956
    setcopy(STRstatus, STR0, VAR_READWRITE);
957
    setcopy(STRstatus, STR0, VAR_READWRITE);
957
    hp->prev = hp->next = hp;
958
    initlex(hp);
958
    hp->word = STRNULL;
959
    while (*v) {
959
    while (*v) {
960
	struct wordent *new = xcalloc(1, sizeof *wdp);
960
	struct wordent *new = xcalloc(1, sizeof *wdp);
961
961
(-)contrib/tcsh/sh.file.c (-5 / +5 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.file.c,v 3.37 2010/02/09 20:21:49 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.file.c,v 3.40 2016/04/16 14:08:14 christos Exp $ */
2
/*
2
/*
3
 * sh.file.c: File completion for csh. This file is not used in tcsh.
3
 * sh.file.c: File completion for csh. This file is not used in tcsh.
4
 */
4
 */
Lines 33-39 Link Here
33
#include "sh.h"
33
#include "sh.h"
34
#include "ed.h"
34
#include "ed.h"
35
35
36
RCSID("$tcsh: sh.file.c,v 3.37 2010/02/09 20:21:49 christos Exp $")
36
RCSID("$tcsh: sh.file.c,v 3.40 2016/04/16 14:08:14 christos Exp $")
37
37
38
#if defined(FILEC) && defined(TIOCSTI)
38
#if defined(FILEC) && defined(TIOCSTI)
39
39
Lines 231-237 Link Here
231
# ifdef POSIX
231
# ifdef POSIX
232
    (void) tcgetattr(SHOUT, &tty);
232
    (void) tcgetattr(SHOUT, &tty);
233
# else
233
# else
234
    (void) ioctl(SHOUT, TCSETAW, (ioctl_t) &tty);
234
    (void) ioctl(SHOUT, TCGETA, (ioctl_t) &tty);
235
# endif /* POSIX */
235
# endif /* POSIX */
236
    tty_normal = tty;
236
    tty_normal = tty;
237
    tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL |
237
    tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL |
Lines 249-255 Link Here
249
	char buf[MB_LEN_MAX];
249
	char buf[MB_LEN_MAX];
250
	size_t i, len;
250
	size_t i, len;
251
251
252
	len = one_wctomb(buf, *p & CHAR);
252
	len = one_wctomb(buf, *p);
253
	for (i = 0; i < len; i++)
253
	for (i = 0; i < len; i++)
254
	    (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) &buf[i]);
254
	    (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) &buf[i]);
255
    }
255
    }
Lines 564-570 Link Here
564
    }
564
    }
565
565
566
    if (looking_for_lognames) {
566
    if (looking_for_lognames) {
567
#ifndef HAVE_GETPWENT
567
#ifdef HAVE_GETPWENT
568
	(void) endpwent();
568
	(void) endpwent();
569
#endif
569
#endif
570
    } else
570
    } else
(-)contrib/tcsh/sh.func.c (-9 / +75 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.func.c,v 3.162 2011/02/26 00:07:06 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.func.c,v 3.176 2016/10/18 17:26:42 christos Exp $ */
2
/*
2
/*
3
 * sh.func.c: csh builtin functions
3
 * sh.func.c: csh builtin functions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.func.c,v 3.162 2011/02/26 00:07:06 christos Exp $")
35
RCSID("$tcsh: sh.func.c,v 3.176 2016/10/18 17:26:42 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 799-806 Link Here
799
	    break;
799
	    break;
800
800
801
	case TC_IF:
801
	case TC_IF:
802
	    while (getword(&word))
802
	    while (getword(&word)) {
803
		if (intty) {
804
		    histent->word = Strsave(word.s);
805
		    histent->next = xmalloc(sizeof(*histent));
806
		    histent->next->prev = histent;
807
		    histent = histent->next;
808
		}
803
		continue;
809
		continue;
810
	    }
811
	    
804
	    if ((type == TC_IF || type == TC_ELSE) &&
812
	    if ((type == TC_IF || type == TC_ELSE) &&
805
		eq(word.s, STRthen))
813
		eq(word.s, STRthen))
806
		level++;
814
		level++;
Lines 893-899 Link Here
893
static struct wordent *
901
static struct wordent *
894
histgetword(struct wordent *histent) 
902
histgetword(struct wordent *histent) 
895
{
903
{
896
    int found = 0, first;
904
    int first;
897
    eChar c, d;
905
    eChar c, d;
898
    int e;
906
    int e;
899
    struct Strbuf *tmp;
907
    struct Strbuf *tmp;
Lines 917-923 Link Here
917
	if (c == '\n') 
925
	if (c == '\n') 
918
	    goto nl;
926
	    goto nl;
919
	unreadc(c);
927
	unreadc(c);
920
	found = 1;
921
	first = 1;
928
	first = 1;
922
	do {
929
	do {
923
	    e = (c == '\\');
930
	    e = (c == '\\');
Lines 1038-1043 Link Here
1038
		goto past;
1045
		goto past;
1039
	    if (wp)
1046
	    if (wp)
1040
		Strbuf_append1(wp, (Char) c);
1047
		Strbuf_append1(wp, (Char) c);
1048
	    if (!d && c == ')') {
1049
		if (!first && wp) {
1050
		    goto past_word_end;
1051
		} else {
1052
		    if (wp) {
1053
			wp->len = 1;
1054
			Strbuf_terminate(wp);
1055
		    }
1056
		    return found;
1057
		}
1058
	    }
1041
	    if (!first && !d && c == '(') {
1059
	    if (!first && !d && c == '(') {
1042
		if (wp)
1060
		if (wp)
1043
		    goto past_word_end;
1061
		    goto past_word_end;
Lines 1381-1387 Link Here
1381
	stderror(ERR_NAME | ERR_VARBEGIN);
1399
	stderror(ERR_NAME | ERR_VARBEGIN);
1382
    do {
1400
    do {
1383
	lp++;
1401
	lp++;
1384
    } while (alnum(*lp));
1402
    } while (alnum(*lp) || *lp == '.');
1385
    if (*lp != '\0')
1403
    if (*lp != '\0')
1386
	stderror(ERR_NAME | ERR_VARALNUM);
1404
	stderror(ERR_NAME | ERR_VARALNUM);
1387
1405
Lines 1543-1548 Link Here
1543
	cleanup_until(lp);
1561
	cleanup_until(lp);
1544
	return;
1562
	return;
1545
    }
1563
    }
1564
    if (eq(vp, STRLSCOLORS)) {
1565
        parseLSCOLORS(lp);
1566
	cleanup_until(lp);
1567
	return;
1568
    }
1546
#endif /* COLOR_LS_F */
1569
#endif /* COLOR_LS_F */
1547
1570
1548
#ifdef SIG_WINDOW
1571
#ifdef SIG_WINDOW
Lines 1670-1675 Link Here
1670
#ifdef COLOR_LS_F
1693
#ifdef COLOR_LS_F
1671
		else if (eq(name, STRLS_COLORS))
1694
		else if (eq(name, STRLS_COLORS))
1672
		    parseLS_COLORS(n);
1695
		    parseLS_COLORS(n);
1696
		else if (eq(name, STRLSCOLORS))
1697
		    parseLSCOLORS(n);
1673
#endif /* COLOR_LS_F */
1698
#endif /* COLOR_LS_F */
1674
#ifdef NLS_CATALOGS
1699
#ifdef NLS_CATALOGS
1675
		else if (eq(name, STRNLSPATH)) {
1700
		else if (eq(name, STRNLSPATH)) {
Lines 1927-1932 Link Here
1927
    { RLIMIT_NOFILE, 	"descriptors", 1,	""		},
1952
    { RLIMIT_NOFILE, 	"descriptors", 1,	""		},
1928
# endif /* RLIMIT_NOFILE */
1953
# endif /* RLIMIT_NOFILE */
1929
1954
1955
# ifdef RLIMIT_NPTS
1956
    { RLIMIT_NPTS,	"pseudoterminals", 1,	""		},
1957
# endif /* RLIMIT_NPTS */
1958
1959
# ifdef RLIMIT_KQUEUES
1960
    { RLIMIT_KQUEUES,	"kqueues",	1,	""		},
1961
# endif /* RLIMIT_KQUEUES */
1962
1930
# ifdef RLIMIT_CONCUR
1963
# ifdef RLIMIT_CONCUR
1931
    { RLIMIT_CONCUR, 	"concurrency", 1,	"thread(s)"	},
1964
    { RLIMIT_CONCUR, 	"concurrency", 1,	"thread(s)"	},
1932
# endif /* RLIMIT_CONCUR */
1965
# endif /* RLIMIT_CONCUR */
Lines 1939-1944 Link Here
1939
    { RLIMIT_NPROC,	"maxproc",	1,	""		},
1972
    { RLIMIT_NPROC,	"maxproc",	1,	""		},
1940
# endif /* RLIMIT_NPROC */
1973
# endif /* RLIMIT_NPROC */
1941
1974
1975
# ifdef RLIMIT_NTHR
1976
    { RLIMIT_NTHR,	"maxthread",	1,	""		},
1977
# endif /* RLIMIT_NTHR */
1978
1942
# if defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
1979
# if defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
1943
    { RLIMIT_OFILE,	"openfiles",	1,	""		},
1980
    { RLIMIT_OFILE,	"openfiles",	1,	""		},
1944
# endif /* RLIMIT_OFILE && !defined(RLIMIT_NOFILE) */
1981
# endif /* RLIMIT_OFILE && !defined(RLIMIT_NOFILE) */
Lines 1955-1960 Link Here
1955
    { RLIMIT_LOCKS,	"maxlocks",	1,	""		}, 
1992
    { RLIMIT_LOCKS,	"maxlocks",	1,	""		}, 
1956
# endif /* RLIMIT_LOCKS */ 
1993
# endif /* RLIMIT_LOCKS */ 
1957
1994
1995
# ifdef RLIMIT_POSIXLOCKS
1996
    { RLIMIT_POSIXLOCKS,"posixlocks",	1,	""		},
1997
# endif /* RLIMIT_POSIXLOCKS */
1998
1958
# ifdef RLIMIT_SIGPENDING 
1999
# ifdef RLIMIT_SIGPENDING 
1959
    { RLIMIT_SIGPENDING,"maxsignal",	1,	""		}, 
2000
    { RLIMIT_SIGPENDING,"maxsignal",	1,	""		}, 
1960
# endif /* RLIMIT_SIGPENDING */ 
2001
# endif /* RLIMIT_SIGPENDING */ 
Lines 2407-2418 Link Here
2407
    didcch = state->didcch;
2448
    didcch = state->didcch;
2408
#endif /* CLOSE_ON_EXEC */
2449
#endif /* CLOSE_ON_EXEC */
2409
    didfds = state->didfds;
2450
    didfds = state->didfds;
2410
    xclose(SHIN);
2451
    if (state->saveIN != SHIN)
2411
    xclose(SHOUT);
2452
	xclose(SHIN);
2412
    xclose(SHDIAG);
2453
    if (state->saveOUT != SHOUT)
2454
	xclose(SHOUT);
2455
    if (state->saveDIAG != SHDIAG)
2456
	xclose(SHDIAG);
2413
    close_on_exec(SHIN = dmove(state->saveIN, state->SHIN), 1);
2457
    close_on_exec(SHIN = dmove(state->saveIN, state->SHIN), 1);
2414
    close_on_exec(SHOUT = dmove(state->saveOUT, state->SHOUT), 1);
2458
    close_on_exec(SHOUT = dmove(state->saveOUT, state->SHOUT), 1);
2415
    close_on_exec(SHDIAG = dmove(state->saveDIAG, state->SHDIAG), 1);
2459
    close_on_exec(SHDIAG = dmove(state->saveDIAG, state->SHDIAG), 1);
2460
    if (didfds) {
2461
	close_on_exec(dcopy(SHIN, 0), 1);
2462
	close_on_exec(dcopy(SHOUT, 1), 1);
2463
	close_on_exec(dcopy(SHDIAG, 2), 1);
2464
    }
2416
}
2465
}
2417
2466
2418
static Char **Ggv;
2467
static Char **Ggv;
Lines 2681-2683 Link Here
2681
    }
2730
    }
2682
#endif /* NLS_CATALOGS */
2731
#endif /* NLS_CATALOGS */
2683
}
2732
}
2733
2734
int
2735
getYN(const char *prompt)
2736
{
2737
    int doit, c;
2738
    xprintf("%s", prompt);
2739
    flush();
2740
    (void) force_read(SHIN, &c, 1);
2741
    /* 
2742
     * Perhaps we should use the yesexpr from the
2743
     * actual locale
2744
     */
2745
    doit = (strchr(CGETS(22, 14, "Yy"), c) != NULL);
2746
    while (c != '\n' && force_read(SHIN, &c, 1) == 1)
2747
	continue;
2748
    return doit;
2749
}
(-)contrib/tcsh/sh.glob.c (-51 / +33 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.82 2011/02/27 00:15:17 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.95 2016/08/01 16:21:09 christos Exp $ */
2
/*
2
/*
3
 * sh.glob.c: Regular expression expansion
3
 * sh.glob.c: Regular expression expansion
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.glob.c,v 3.82 2011/02/27 00:15:17 christos Exp $")
35
RCSID("$tcsh: sh.glob.c,v 3.95 2016/08/01 16:21:09 christos Exp $")
36
36
37
#include "tc.h"
37
#include "tc.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 594-601 Link Here
594
    Char *p;
594
    Char *p;
595
595
596
    while ((p = *t++) != '\0')
596
    while ((p = *t++) != '\0')
597
	while (*p)
597
	while (*p) {
598
	    *p++ &= TRIM;
598
#if INVALID_BYTE != 0
599
	    if ((*p & INVALID_BYTE) != INVALID_BYTE)	/* *p < INVALID_BYTE */
600
#endif
601
		*p &= TRIM;
602
	    p++;
603
	}
599
}
604
}
600
605
601
int
606
int
Lines 699-709 Link Here
699
    int    hadnl;
704
    int    hadnl;
700
    int     pvec[2], quoted;
705
    int     pvec[2], quoted;
701
    Char   *fakecom[2], ibuf[BUFSIZE];
706
    Char   *fakecom[2], ibuf[BUFSIZE];
702
    char    tibuf[BUFSIZE];
703
707
704
    hadnl = 0;
708
    hadnl = 0;
705
    icnt = 0;
709
    icnt = 0;
706
    quoted = (literal || (cp[0] & QUOTE)) ? QUOTE : 0;
710
    if (!literal) {
711
	for (ip = cp; (*ip & QUOTE) != 0; ip++)
712
		continue;
713
	quoted = *ip == '\0';
714
    } else
715
	quoted = literal;
707
    faket.t_dtyp = NODE_COMMAND;
716
    faket.t_dtyp = NODE_COMMAND;
708
    faket.t_dflg = F_BACKQ;
717
    faket.t_dflg = F_BACKQ;
709
    faket.t_dlef = 0;
718
    faket.t_dlef = 0;
Lines 760-765 Link Here
760
	omark = cleanup_push_mark();
769
	omark = cleanup_push_mark();
761
	getexit(osetexit);
770
	getexit(osetexit);
762
	for (;;) {
771
	for (;;) {
772
	    struct wordent paraml1;
773
	    initlex(&paraml1);
774
763
	    (void) setexit();
775
	    (void) setexit();
764
	    justpr = 0;
776
	    justpr = 0;
765
	    
777
	    
Lines 775-793 Link Here
775
		seterr = NULL;
787
		seterr = NULL;
776
	    }
788
	    }
777
789
778
	    (void) lex(&paraml);
790
	    freelex(&paraml1);
779
	    cleanup_push(&paraml, lex_cleanup);
791
	    (void) lex(&paraml1);
792
	    cleanup_push(&paraml1, lex_cleanup);
780
	    if (seterr)
793
	    if (seterr)
781
		stderror(ERR_OLD);
794
		stderror(ERR_OLD);
782
	    alias(&paraml);
795
	    alias(&paraml1);
783
	    t = syntax(paraml.next, &paraml, 0);
796
	    t = syntax(paraml1.next, &paraml1, 0);
784
	    if (t == NULL)
785
		return;
786
	    cleanup_push(t, syntax_cleanup);
797
	    cleanup_push(t, syntax_cleanup);
787
	    /* The F_BACKQ flag must set so the job output is correct if
798
	    /* The F_BACKQ flag must set so the job output is correct if
788
	     * printexitvalue is set.  If it's not set, the job output
799
	     * printexitvalue is set.  If it's not set, the job output
789
	     * will have "Exit N" appended where N is the exit status. */
800
	     * will have "Exit N" appended where N is the exit status. */
790
	    t->t_dflg = F_BACKQ|F_NOFORK;
801
	    if (t)
802
		    t->t_dflg = F_BACKQ|F_NOFORK;
791
	    if (seterr)
803
	    if (seterr)
792
		stderror(ERR_OLD);
804
		stderror(ERR_OLD);
793
#ifdef SIGTSTP
805
#ifdef SIGTSTP
Lines 801-807 Link Here
801
#endif
813
#endif
802
	    execute(t, -1, NULL, NULL, TRUE);
814
	    execute(t, -1, NULL, NULL, TRUE);
803
815
804
	    cleanup_until(&paraml);
816
	    cleanup_until(&paraml1);
805
	}
817
	}
806
    }
818
    }
807
    cleanup_until(&pvec[1]);
819
    cleanup_until(&pvec[1]);
Lines 809-853 Link Here
809
    ip = NULL;
821
    ip = NULL;
810
    do {
822
    do {
811
	ssize_t     cnt = 0;
823
	ssize_t     cnt = 0;
812
	char   *tmp;
813
824
814
	tmp = tibuf;
815
	for (;;) {
825
	for (;;) {
816
	    while (icnt == 0) {
826
	    if (icnt == 0) {
817
		int     i, eof;
818
819
		ip = ibuf;
827
		ip = ibuf;
820
		icnt = xread(pvec[0], tmp, tibuf + BUFSIZE - tmp);
828
		icnt = wide_read(pvec[0], ibuf, BUFSIZE, 0);
821
		eof = 0;
829
		if (icnt <= 0)
822
		if (icnt <= 0) {
830
		    goto eof;
823
		    if (tmp == tibuf)
824
			goto eof;
825
		    icnt = 0;
826
		    eof = 1;
827
		}
828
		icnt += tmp - tibuf;
829
		i = 0;
830
		tmp = tibuf;
831
		while (tmp < tibuf + icnt) {
832
		    int len;
833
834
		    len = normal_mbtowc(&ip[i], tmp, tibuf + icnt - tmp);
835
		    if (len == -1) {
836
		        reset_mbtowc();
837
		        if (!eof && (size_t)(tibuf + icnt - tmp) < MB_CUR_MAX) {
838
			    break; /* Maybe a partial character */
839
			}
840
			ip[i] = (unsigned char) *tmp | INVALID_BYTE; /* Error */
841
		    }
842
		    if (len <= 0)
843
		        len = 1;
844
		    i++;
845
		    tmp += len;
846
		}
847
		if (tmp != tibuf)
848
		    memmove (tibuf, tmp, tibuf + icnt - tmp);
849
		tmp = tibuf + (tibuf + icnt - tmp);
850
		icnt = i;
851
	    }
831
	    }
852
	    if (hadnl)
832
	    if (hadnl)
853
		break;
833
		break;
Lines 870-876 Link Here
870
	    if (!quoted && (c == ' ' || c == '\t'))
850
	    if (!quoted && (c == ' ' || c == '\t'))
871
		break;
851
		break;
872
	    cnt++;
852
	    cnt++;
873
	    Strbuf_append1(word, c | quoted);
853
	    if (c == '\\' || quoted)
854
		c |= QUOTE;
855
	    Strbuf_append1(word, c);
874
	}
856
	}
875
	/*
857
	/*
876
	 * Unless at end-of-file, we will form a new word here if there were
858
	 * Unless at end-of-file, we will form a new word here if there were
(-)contrib/tcsh/sh.h (-31 / +37 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.h,v 3.165 2011/04/14 18:25:25 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.h,v 3.178 2016/09/12 16:33:54 christos Exp $ */
2
/*
2
/*
3
 * sh.h: Catch it all globals and includes file!
3
 * sh.h: Catch it all globals and includes file!
4
 */
4
 */
Lines 127-132 Link Here
127
#if !defined(__inline) && !defined(__GNUC__) && !defined(_MSC_VER)
127
#if !defined(__inline) && !defined(__GNUC__) && !defined(_MSC_VER)
128
#define __inline
128
#define __inline
129
#endif
129
#endif
130
#ifdef _MSC_VER
131
#define TCSH_PTRDIFF_T_FMT "I"
132
#else
133
#define TCSH_PTRDIFF_T_FMT "t"
134
#endif
130
/* Elide unused argument warnings */
135
/* Elide unused argument warnings */
131
#define USE(a)	(void) (a)
136
#define USE(a)	(void) (a)
132
#define TCSH_IGNORE(a)	tcsh_ignore((intptr_t)a)
137
#define TCSH_IGNORE(a)	tcsh_ignore((intptr_t)a)
Lines 188-193 Link Here
188
# endif /* SYSVREL */
193
# endif /* SYSVREL */
189
#endif /* ECHO_STYLE */
194
#endif /* ECHO_STYLE */
190
195
196
/* values for noclobber */
197
#define NOCLOBBER_DEFAULT  1
198
#define NOCLOBBER_NOTEMPTY 2
199
#define NOCLOBBER_ASK      4
200
191
/*
201
/*
192
 * The shell moves std in/out/diag and the old std input away from units
202
 * The shell moves std in/out/diag and the old std input away from units
193
 * 0, 1, and 2 so that it is easy to set up these standards for invoked
203
 * 0, 1, and 2 so that it is easy to set up these standards for invoked
Lines 428-436 Link Here
428
# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
438
# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
429
#  if !defined(__APPLE__) /* Damnit, where is getnameinfo() folks? */
439
#  if !defined(__APPLE__) /* Damnit, where is getnameinfo() folks? */
430
#   if !defined(sgi)
440
#   if !defined(sgi)
431
#    if !defined(__CYGWIN__)
441
#    define INET6
432
#     define INET6
433
#    endif /* __CYGWIN__ */
434
#   endif /* sgi */
442
#   endif /* sgi */
435
#  endif /* __APPLE__ */
443
#  endif /* __APPLE__ */
436
# endif
444
# endif
Lines 440-460 Link Here
440
#ifdef PURIFY
448
#ifdef PURIFY
441
/* exit normally, allowing purify to trace leaks */
449
/* exit normally, allowing purify to trace leaks */
442
# define _exit		exit
450
# define _exit		exit
443
typedef  int		pret_t;
451
#endif /* !PURIFY */
444
#else /* !PURIFY */
445
/*
446
 * If your compiler complains, then you can either
447
 * throw it away and get gcc or, use the following define
448
 * and get rid of the typedef.
449
 * [The 4.2/3BSD vax compiler does not like that]
450
 * Both MULTIFLOW and PCC compilers exhbit this bug.  -- sterling@netcom.com
451
 */
452
# if (defined(vax) || defined(uts) || defined(MULTIFLOW) || defined(PCC)) && !defined(__GNUC__)
453
#  define pret_t void
454
# else /* !((vax || uts || MULTIFLOW || PCC) && !__GNUC__) */
455
typedef void pret_t;
456
# endif /* (vax || uts || MULTIFLOW || PCC) && !__GNUC__ */
457
#endif /* PURIFY */
458
452
459
/*
453
/*
460
 * ASCII vs. EBCDIC
454
 * ASCII vs. EBCDIC
Lines 573-579 Link Here
573
EXTERN int    noexec IZERO;	/* Don't execute, just syntax check */
567
EXTERN int    noexec IZERO;	/* Don't execute, just syntax check */
574
EXTERN int    pjobs IZERO;	/* want to print jobs if interrupted */
568
EXTERN int    pjobs IZERO;	/* want to print jobs if interrupted */
575
EXTERN int    setintr IZERO;	/* Set interrupts on/off -> Wait intr... */
569
EXTERN int    setintr IZERO;	/* Set interrupts on/off -> Wait intr... */
576
EXTERN int    handle_intr IZERO;/* Are we currently handling an interrupt? */
570
EXTERN int    handle_interrupt IZERO;/* Are we currently handling an interrupt? */
577
EXTERN int    havhash IZERO;	/* path hashing is available */
571
EXTERN int    havhash IZERO;	/* path hashing is available */
578
EXTERN int    editing IZERO;	/* doing filename expansion and line editing */
572
EXTERN int    editing IZERO;	/* doing filename expansion and line editing */
579
EXTERN int    noediting IZERO;	/* initial $term defaulted to noedit */
573
EXTERN int    noediting IZERO;	/* initial $term defaulted to noedit */
Lines 585-592 Link Here
585
EXTERN int    is1atty IZERO;	/* is file descriptor 1 a tty (didfds mode) */
579
EXTERN int    is1atty IZERO;	/* is file descriptor 1 a tty (didfds mode) */
586
EXTERN int    is2atty IZERO;	/* is file descriptor 2 a tty (didfds mode) */
580
EXTERN int    is2atty IZERO;	/* is file descriptor 2 a tty (didfds mode) */
587
EXTERN int    arun IZERO;	/* Currently running multi-line-aliases */
581
EXTERN int    arun IZERO;	/* Currently running multi-line-aliases */
588
EXTERN int     implicit_cd IZERO;/* implicit cd enabled?(1=enabled,2=verbose) */
582
EXTERN int    implicit_cd IZERO;/* implicit cd enabled?(1=enabled,2=verbose) */
583
EXTERN int    cdtohome IZERO;	/* cd without args goes home */
589
EXTERN int    inheredoc IZERO;	/* Currently parsing a heredoc */
584
EXTERN int    inheredoc IZERO;	/* Currently parsing a heredoc */
585
EXTERN int    no_clobber IZERO;	/* no clobber enabled? 1=yes 2=notempty, 4=ask*/
590
/* We received a window change event */
586
/* We received a window change event */
591
EXTERN volatile sig_atomic_t windowchg IZERO;
587
EXTERN volatile sig_atomic_t windowchg IZERO;
592
#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
588
#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
Lines 635-643 Link Here
635
/*
631
/*
636
 * Miscellany
632
 * Miscellany
637
 */
633
 */
634
EXTERN pid_t   mainpid;		/* pid of the main shell ($$) */
638
EXTERN Char   *doldol;		/* Character pid for $$ */
635
EXTERN Char   *doldol;		/* Character pid for $$ */
639
EXTERN pid_t   backpid;		/* pid of the last background job */
636
EXTERN pid_t   backpid;		/* pid of the last background job */
640
637
638
641
/*
639
/*
642
 * Ideally these should be uid_t, gid_t, pid_t. I cannot do that right now
640
 * Ideally these should be uid_t, gid_t, pid_t. I cannot do that right now
643
 * cause pid's could be unsigned and that would break our -1 flag, and 
641
 * cause pid's could be unsigned and that would break our -1 flag, and 
Lines 717-730 Link Here
717
#define		ASCII		0177
715
#define		ASCII		0177
718
#ifdef WIDE_STRINGS		/* Implies SHORT_STRINGS */
716
#ifdef WIDE_STRINGS		/* Implies SHORT_STRINGS */
719
/* 31st char bit used for 'ing (not 32nd, we want all values nonnegative) */
717
/* 31st char bit used for 'ing (not 32nd, we want all values nonnegative) */
720
# define	QUOTE		0x40000000
718
/*
721
# define	TRIM		0x3FFFFFFF /* Mask to strip quote bit */
719
 * Notice
720
 *
721
 * By fix for handling unicode name file, 32nd bit is used.
722
 * We need use '&' instead of '> or <' when comparing with INVALID_BYTE etc..
723
 * Cast to uChar is not recommended,
724
 *  becase Char is 4bytes but uChar is 8bytes on I32LP64. */
725
# define	QUOTE		0x80000000
726
# define	TRIM		0x7FFFFFFF /* Mask to strip quote bit */
722
# define	UNDER		0x08000000 /* Underline flag */
727
# define	UNDER		0x08000000 /* Underline flag */
723
# define	BOLD		0x04000000 /* Bold flag */
728
# define	BOLD		0x04000000 /* Bold flag */
724
# define	STANDOUT	0x02000000 /* Standout flag */
729
# define	STANDOUT	0x02000000 /* Standout flag */
725
# define	LITERAL		0x01000000 /* Literal character flag */
730
# define	LITERAL		0x01000000 /* Literal character flag */
726
# define	ATTRIBUTES	0x0F000000 /* The bits used for attributes */
731
# define	ATTRIBUTES	0x0F000000 /* The bits used for attributes */
727
# define	INVALID_BYTE	0x00800000 /* Invalid character on input */
732
# define	INVALID_BYTE	0xF0000000 /* Invalid character on input */
728
# ifdef SOLARIS2
733
# ifdef SOLARIS2
729
#  define	CHAR		0x30FFFFFF /* Mask to mask out the character */
734
#  define	CHAR		0x30FFFFFF /* Mask to mask out the character */
730
# else
735
# else
Lines 753-758 Link Here
753
#endif
758
#endif
754
#define		CHAR_DBWIDTH	(LITERAL|(LITERAL-1))
759
#define		CHAR_DBWIDTH	(LITERAL|(LITERAL-1))
755
760
761
# define 	MAX_UTF32	0x7FFFFFFF	/* max UTF32 is U+7FFFFFFF */
762
756
EXTERN int     AsciiOnly;	/* If set only 7 bits expected in characters */
763
EXTERN int     AsciiOnly;	/* If set only 7 bits expected in characters */
757
764
758
/*
765
/*
Lines 1020-1029 Link Here
1020
 * Filename/command name expansion variables
1027
 * Filename/command name expansion variables
1021
 */
1028
 */
1022
1029
1023
#ifdef __CYGWIN__
1024
# undef MAXPATHLEN
1025
#endif /* __CYGWIN__ */
1026
1027
#ifndef MAXPATHLEN
1030
#ifndef MAXPATHLEN
1028
# ifdef PATH_MAX
1031
# ifdef PATH_MAX
1029
#  define MAXPATHLEN PATH_MAX
1032
#  define MAXPATHLEN PATH_MAX
Lines 1065-1071 Link Here
1065
    unsigned Hhash;                     /* hash value of command line */
1068
    unsigned Hhash;                     /* hash value of command line */
1066
}       Histlist IZERO_STRUCT;
1069
}       Histlist IZERO_STRUCT;
1067
1070
1068
EXTERN struct wordent paraml;	/* Current lexical word list */
1071
extern struct wordent paraml;	/* Current lexical word list */
1069
EXTERN int     eventno;		/* Next events number */
1072
EXTERN int     eventno;		/* Next events number */
1070
EXTERN int     lastev;		/* Last event reference (default) */
1073
EXTERN int     lastev;		/* Last event reference (default) */
1071
1074
Lines 1166-1177 Link Here
1166
    const char *pname;		/* print name */
1169
    const char *pname;		/* print name */
1167
} mesg[];
1170
} mesg[];
1168
1171
1169
/* word_chars is set by default to WORD_CHARS but can be overridden by
1172
/* word_chars is set by default to WORD_CHARS (or WORD_CHARS_VI) but can
1170
   the worchars variable--if unset, reverts to WORD_CHARS */
1173
   be overridden by the wordchars variable--if unset, reverts to
1174
   WORD_CHARS (or WORD_CHARS_VI) */
1171
1175
1172
EXTERN Char   *word_chars;
1176
EXTERN Char   *word_chars;
1173
1177
1174
#define WORD_CHARS "*?_-.[]~="	/* default chars besides alnums in words */
1178
#define WORD_CHARS "*?_-.[]~="	/* default chars besides alnums in words */
1179
#define WORD_CHARS_VI "_"	/* default chars besides alnums in words */
1175
1180
1176
EXTERN Char   *STR_SHELLPATH;
1181
EXTERN Char   *STR_SHELLPATH;
1177
1182
Lines 1179-1184 Link Here
1179
EXTERN Char   *STR_BSHELL;
1184
EXTERN Char   *STR_BSHELL;
1180
#endif 
1185
#endif 
1181
EXTERN Char   *STR_WORD_CHARS;
1186
EXTERN Char   *STR_WORD_CHARS;
1187
EXTERN Char   *STR_WORD_CHARS_VI;
1182
EXTERN Char  **STR_environ IZERO;
1188
EXTERN Char  **STR_environ IZERO;
1183
1189
1184
extern int     dont_free;	/* Tell free that we are in danger if we free */
1190
extern int     dont_free;	/* Tell free that we are in danger if we free */
(-)contrib/tcsh/sh.hist.c (-45 / +89 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.hist.c,v 3.53 2011/01/24 18:10:26 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.hist.c,v 3.61 2015/06/06 21:19:08 christos Exp $ */
2
/*
2
/*
3
 * sh.hist.c: Shell history expansions and substitutions
3
 * sh.hist.c: Shell history expansions and substitutions
4
 */
4
 */
Lines 32-41 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.hist.c,v 3.53 2011/01/24 18:10:26 christos Exp $")
35
RCSID("$tcsh: sh.hist.c,v 3.61 2015/06/06 21:19:08 christos Exp $")
36
36
37
#include <stdio.h>	/* for rename(2), grr. */
37
#include <assert.h>
38
#include <assert.h>
38
#include "tc.h"
39
#include "tc.h"
40
#include "dotlock.h"
39
41
40
extern int histvalid;
42
extern int histvalid;
41
extern struct Strbuf histline;
43
extern struct Strbuf histline;
Lines 68-79 Link Here
68
70
69
static const int fastMergeErase = 1;
71
static const int fastMergeErase = 1;
70
static unsigned histCount = 0;		/* number elements on history list */
72
static unsigned histCount = 0;		/* number elements on history list */
73
static int histlen = 0;
71
static struct Hist *histTail = NULL;     /* last element on history list */
74
static struct Hist *histTail = NULL;     /* last element on history list */
72
static struct Hist *histMerg = NULL;	 /* last element merged by Htime */
75
static struct Hist *histMerg = NULL;	 /* last element merged by Htime */
73
76
74
static void insertHistHashTable(struct Hist *, unsigned);
77
static void insertHistHashTable(struct Hist *, unsigned);
75
78
76
77
/* Insert new element (hp) in history list after specified predecessor (pp). */
79
/* Insert new element (hp) in history list after specified predecessor (pp). */
78
static void
80
static void
79
hinsert(struct Hist *hp, struct Hist *pp)
81
hinsert(struct Hist *hp, struct Hist *pp)
Lines 107-113 Link Here
107
109
108
/* Prune length of history list to specified size by history variable. */
110
/* Prune length of history list to specified size by history variable. */
109
PG_STATIC void
111
PG_STATIC void
110
discardExcess(int histlen)
112
discardExcess(int hlen)
111
{
113
{
112
    struct Hist *hp, *np;
114
    struct Hist *hp, *np;
113
    if (histTail == NULL) {
115
    if (histTail == NULL) {
Lines 117-139 Link Here
117
    /* Prune dummy entries from the front, then old entries from the back. If
119
    /* Prune dummy entries from the front, then old entries from the back. If
118
     * the list is still too long scan the whole list as before.  But only do a
120
     * the list is still too long scan the whole list as before.  But only do a
119
     * full scan if the list is more than 6% (1/16th) too long. */
121
     * full scan if the list is more than 6% (1/16th) too long. */
120
    while (histCount > (unsigned)histlen && (np = Histlist.Hnext)) {
122
    while (histCount > (unsigned)hlen && (np = Histlist.Hnext)) {
121
        if (eventno - np->Href >= histlen || histlen == 0)
123
        if (eventno - np->Href >= hlen || hlen == 0)
122
            hremove(np), hfree(np);
124
            hremove(np), hfree(np);
123
        else
125
        else
124
            break;
126
            break;
125
    }
127
    }
126
    while (histCount > (unsigned)histlen && (np = histTail) != &Histlist) {
128
    while (histCount > (unsigned)hlen && (np = histTail) != &Histlist) {
127
        if (eventno - np->Href >= histlen || histlen == 0)
129
        if (eventno - np->Href >= hlen || hlen == 0)
128
            hremove(np), hfree(np);
130
            hremove(np), hfree(np);
129
        else
131
        else
130
            break;
132
            break;
131
    }
133
    }
132
    if (histCount - (histlen >> 4) <= (unsigned)histlen)
134
    if (histCount - (hlen >> 4) <= (unsigned)hlen)
133
	return;				/* don't bother doing the full scan */
135
	return;				/* don't bother doing the full scan */
134
    for (hp = &Histlist; histCount > (unsigned)histlen &&
136
    for (hp = &Histlist; histCount > (unsigned)hlen &&
135
	(np = hp->Hnext) != NULL;)
137
	(np = hp->Hnext) != NULL;)
136
        if (eventno - np->Href >= histlen || histlen == 0)
138
        if (eventno - np->Href >= hlen || hlen == 0)
137
            hremove(np), hfree(np);
139
            hremove(np), hfree(np);
138
        else
140
        else
139
            hp = np;
141
            hp = np;
Lines 145-164 Link Here
145
  struct wordent *sp,
147
  struct wordent *sp,
146
  int mflg)				/* true if -m (merge) specified */
148
  int mflg)				/* true if -m (merge) specified */
147
{
149
{
148
    int histlen = 0;
149
    Char   *cp;
150
151
    /* throw away null lines */
150
    /* throw away null lines */
152
    if (sp && sp->next->word[0] == '\n')
151
    if (sp && sp->next->word[0] == '\n')
153
	return;
152
	return;
154
    cp = varval(STRhistory);
155
    while (*cp) {
156
	if (!Isdigit(*cp)) {
157
	    histlen = 0;
158
	    break;
159
	}
160
	histlen = histlen * 10 + *cp++ - '0';
161
    }
162
    if (sp)
153
    if (sp)
163
        (void) enthist(++eventno, sp, 1, mflg, histlen);
154
        (void) enthist(++eventno, sp, 1, mflg, histlen);
164
    discardExcess(histlen);
155
    discardExcess(histlen);
Lines 711-719 Link Here
711
702
712
/* Computes a new hash table size, when the current one is too small. */
703
/* Computes a new hash table size, when the current one is too small. */
713
static unsigned
704
static unsigned
714
getHashTableSize(int histlen)
705
getHashTableSize(int hlen)
715
{
706
{
716
    unsigned target = histlen * 2;
707
    unsigned target = hlen * 2;
717
    unsigned e = 5;
708
    unsigned e = 5;
718
    unsigned size;
709
    unsigned size;
719
    while ((size = 1<<e) < target)
710
    while ((size = 1<<e) < target)
Lines 729-745 Link Here
729
720
730
/* Create the hash table or resize, if necessary. */
721
/* Create the hash table or resize, if necessary. */
731
static void
722
static void
732
createHistHashTable(int histlen)
723
createHistHashTable(int hlen)
733
{
724
{
734
    if (histlen == 0) {
725
    if (hlen == 0) {
735
	discardHistHashTable();
726
	discardHistHashTable();
736
        return;
727
        return;
737
    }
728
    }
738
    if (histlen < 0) {
729
    if (hlen < 0) {
739
        histlen = getn(varval(STRhistory));
730
	if (histlen <= 0)
740
	if (histlen == 0)
741
	    return;			/* no need for hash table */
731
	    return;			/* no need for hash table */
742
	assert(histlen > 0);
732
	hlen = histlen;
743
    }
733
    }
744
    if (histHashTable != NULL) {
734
    if (histHashTable != NULL) {
745
	if (histCount < histHashTableLength * 3 / 4)
735
	if (histCount < histHashTableLength * 3 / 4)
Lines 747-753 Link Here
747
	discardHistHashTable();		/* too small */
737
	discardHistHashTable();		/* too small */
748
    }
738
    }
749
    histHashTableLength = getHashTableSize(
739
    histHashTableLength = getHashTableSize(
750
	histlen > (int)histCount ? histlen : (int)histCount);
740
	hlen > (int)histCount ? hlen : (int)histCount);
751
    histHashTable = xmalloc(histHashTableLength * sizeof(struct Hist *));
741
    histHashTable = xmalloc(histHashTableLength * sizeof(struct Hist *));
752
    memset(histHashTable, 0, histHashTableLength * sizeof(struct Hist *));
742
    memset(histHashTable, 0, histHashTableLength * sizeof(struct Hist *));
753
    assert(histHashTable[0] == emptyHTE);
743
    assert(histHashTable[0] == emptyHTE);
Lines 934-940 Link Here
934
  struct wordent *lp,
924
  struct wordent *lp,
935
  int docopy,
925
  int docopy,
936
  int mflg,				/* true if merge requested */
926
  int mflg,				/* true if merge requested */
937
  int histlen)				/* -1 if unknown */
927
  int hlen)				/* -1 if unknown */
938
{
928
{
939
    struct Hist *p = NULL, *pp = &Histlist, *pTime = NULL;
929
    struct Hist *p = NULL, *pp = &Histlist, *pTime = NULL;
940
    struct Hist *np;
930
    struct Hist *np;
Lines 944-950 Link Here
944
    if ((dp = varval(STRhistdup)) != STRNULL) {
934
    if ((dp = varval(STRhistdup)) != STRNULL) {
945
	if (eq(dp, STRerase)) {
935
	if (eq(dp, STRerase)) {
946
	    /* masaoki@akebono.tky.hp.com (Kobayashi Masaoki) */
936
	    /* masaoki@akebono.tky.hp.com (Kobayashi Masaoki) */
947
            createHistHashTable(histlen);
937
            createHistHashTable(hlen);
948
            lpHash = hashhist(lp);
938
            lpHash = hashhist(lp);
949
            assert(lpHash != 0);
939
            assert(lpHash != 0);
950
            p = findHistHashTable(lp, lpHash);
940
            p = findHistHashTable(lp, lpHash);
Lines 963-969 Link Here
963
	    }
953
	    }
964
	}
954
	}
965
	else if (eq(dp, STRall)) {
955
	else if (eq(dp, STRall)) {
966
            createHistHashTable(histlen);
956
            createHistHashTable(hlen);
967
            lpHash = hashhist(lp);
957
            lpHash = hashhist(lp);
968
            assert(lpHash != 0);
958
            assert(lpHash != 0);
969
            p = findHistHashTable(lp, lpHash);
959
            p = findHistHashTable(lp, lpHash);
Lines 1031-1037 Link Here
1031
    else
1021
    else
1032
        pp = &Histlist;                 /* insert at beginning of history */
1022
        pp = &Histlist;                 /* insert at beginning of history */
1033
    hinsert(np, pp);
1023
    hinsert(np, pp);
1034
    if (lpHash && histlen != 0)		/* erase & all modes use hash table */
1024
    if (lpHash && hlen != 0)		/* erase & all modes use hash table */
1035
        insertHistHashTable(np, lpHash);
1025
        insertHistHashTable(np, lpHash);
1036
    else
1026
    else
1037
        discardHistHashTable();
1027
        discardHistHashTable();
Lines 1053-1058 Link Here
1053
PG_STATIC void
1043
PG_STATIC void
1054
phist(struct Hist *hp, int hflg)
1044
phist(struct Hist *hp, int hflg)
1055
{
1045
{
1046
    if (hp->Href < 0)
1047
	return;
1056
    if (hflg & HIST_ONLY) {
1048
    if (hflg & HIST_ONLY) {
1057
	int old_output_raw;
1049
	int old_output_raw;
1058
1050
Lines 1207-1213 Link Here
1207
	    buf = xmalloc(Strlen(istr) * MB_LEN_MAX + 1);
1199
	    buf = xmalloc(Strlen(istr) * MB_LEN_MAX + 1);
1208
1200
1209
	    for (p = buf, ip = istr; *ip != '\0'; ip++)
1201
	    for (p = buf, ip = istr; *ip != '\0'; ip++)
1210
		p += one_wctomb(p, CHAR & *ip);
1202
		p += one_wctomb(p, *ip);
1211
1203
1212
	    *p = '\0';
1204
	    *p = '\0';
1213
	    xfree(istr);
1205
	    xfree(istr);
Lines 1220-1232 Link Here
1220
    }
1212
    }
1221
}
1213
}
1222
1214
1215
static void
1216
dotlock_cleanup(void* lockpath)
1217
{
1218
	dot_unlock((char*)lockpath);
1219
}
1220
1223
/* Save history before exiting the shell. */
1221
/* Save history before exiting the shell. */
1224
void
1222
void
1225
rechist(Char *fname, int ref)
1223
rechist(Char *fname, int ref)
1226
{
1224
{
1227
    Char    *snum;
1225
    Char    *snum, *rs;
1228
    int     fp, ftmp, oldidfds;
1226
    int     fp, ftmp, oldidfds;
1229
    struct varent *shist;
1227
    struct varent *shist;
1228
    char path[MAXPATHLEN];
1229
    struct stat st;
1230
    static Char   *dumphist[] = {STRhistory, STRmhT, 0, 0};
1230
    static Char   *dumphist[] = {STRhistory, STRmhT, 0, 0};
1231
1231
1232
    if (fname == NULL && !ref) 
1232
    if (fname == NULL && !ref) 
Lines 1255-1266 Link Here
1255
     * with numerous shells being in simultaneous use. Imagine
1255
     * with numerous shells being in simultaneous use. Imagine
1256
     * any kind of window system. All these shells 'share' the same 
1256
     * any kind of window system. All these shells 'share' the same 
1257
     * ~/.history file for recording their command line history. 
1257
     * ~/.history file for recording their command line history. 
1258
     * Currently the automatic merge can only succeed when the shells
1258
     * We try to handle the case of multiple shells trying to merge
1259
     * nicely quit one after another. 
1259
     * histories at the same time, by creating semi-unique filenames
1260
     * and saving the history there first and then trying to rename
1261
     * them in the proper history file.
1260
     *
1262
     *
1261
     * Users that like to nuke their environment require here an atomic
1263
     * Users that like to nuke their environment require here an atomic
1262
     * 	loadhist-creat-dohist(dumphist)-close
1264
     * loadhist-creat-dohist(dumphist)-close sequence which is given
1263
     * sequence.
1265
		 * by optional lock parameter to savehist.
1264
     *
1266
     *
1265
     * jw.
1267
     * jw.
1266
     */ 
1268
     */ 
Lines 1271-1286 Link Here
1271
     */
1273
     */
1272
    oldidfds = didfds;
1274
    oldidfds = didfds;
1273
    didfds = 0;
1275
    didfds = 0;
1274
    if ((shist = adrof(STRsavehist)) != NULL && shist->vec != NULL)
1276
    if ((shist = adrof(STRsavehist)) != NULL && shist->vec != NULL) {
1275
	if (shist->vec[1] && eq(shist->vec[1], STRmerge))
1277
	size_t i;
1278
	int merge = 0, lock = 0;
1279
1280
	for (i = 1; shist->vec[i]; i++) {
1281
	    if (eq(shist->vec[i], STRmerge))
1282
		merge++;
1283
	    if (eq(shist->vec[i], STRlock))
1284
		lock++;
1285
	}
1286
1287
	if (merge) {
1288
	    if (lock) {
1289
#ifndef WINNT_NATIVE
1290
		char *lockpath = strsave(short2str(fname));
1291
		cleanup_push(lockpath, xfree);
1292
		/* Poll in 100 miliseconds interval to obtain the lock. */
1293
		if ((dot_lock(lockpath, 100) == 0))
1294
		    cleanup_push(lockpath, dotlock_cleanup);
1295
#endif
1296
	    }
1276
	    loadhist(fname, 1);
1297
	    loadhist(fname, 1);
1298
	}
1299
    }
1300
    rs = randsuf();
1301
    xsnprintf(path, sizeof(path), "%S.%S", fname, rs);
1302
    xfree(rs);
1277
1303
1278
    fp = xcreat(short2str(fname), 0600);
1304
    fp = xcreat(path, 0600);
1279
    cleanup_until(fname);
1280
    if (fp == -1) {
1305
    if (fp == -1) {
1281
	didfds = oldidfds;
1306
	didfds = oldidfds;
1307
	cleanup_until(fname);
1282
	return;
1308
	return;
1283
    }
1309
    }
1310
    /* Try to preserve ownership and permissions of the original history file */
1311
#ifndef WINNT_NATIVE
1312
    if (stat(short2str(fname), &st) != -1) {
1313
	TCSH_IGNORE(fchown(fp, st.st_uid, st.st_gid));
1314
	TCSH_IGNORE(fchmod(fp, st.st_mode));
1315
    }
1316
#else
1317
    UNREFERENCED_PARAMETER(st);
1318
#endif
1284
    ftmp = SHOUT;
1319
    ftmp = SHOUT;
1285
    SHOUT = fp;
1320
    SHOUT = fp;
1286
    dumphist[2] = snum;
1321
    dumphist[2] = snum;
Lines 1288-1293 Link Here
1288
    xclose(fp);
1323
    xclose(fp);
1289
    SHOUT = ftmp;
1324
    SHOUT = ftmp;
1290
    didfds = oldidfds;
1325
    didfds = oldidfds;
1326
    (void)rename(path, short2str(fname));
1327
    cleanup_until(fname);
1291
}
1328
}
1292
1329
1293
1330
Lines 1317-1319 Link Here
1317
	    hp->Hnum = hp->Href = n--;
1354
	    hp->Hnum = hp->Href = n--;
1318
    }
1355
    }
1319
}
1356
}
1357
1358
void
1359
sethistory(int n)
1360
{
1361
    histlen = n;
1362
    discardExcess(histlen);
1363
}
(-)contrib/tcsh/sh.init.c (-3 / +3 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.init.c,v 3.63 2006/08/23 01:49:32 mitr Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.init.c,v 3.64 2013/02/11 13:51:16 christos Exp $ */
2
/*
2
/*
3
 * sh.init.c: Function and signal tables
3
 * sh.init.c: Function and signal tables
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.init.c,v 3.63 2006/08/23 01:49:32 mitr Exp $")
35
RCSID("$tcsh: sh.init.c,v 3.64 2013/02/11 13:51:16 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 214-220 Link Here
214
 */
214
 */
215
215
216
/* We define NUMSIG to avoid changing NSIG or MAXSIG */
216
/* We define NUMSIG to avoid changing NSIG or MAXSIG */
217
#if defined(POSIX) && !defined(__CYGWIN__)
217
#if defined(POSIX) && (!defined(__CYGWIN__) || defined (__x86_64__))
218
# define NUMSIG 65
218
# define NUMSIG 65
219
#else /* !POSIX */
219
#else /* !POSIX */
220
# define NUMSIG 33
220
# define NUMSIG 33
(-)contrib/tcsh/sh.lex.c (-5 / +12 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.87 2011/01/24 17:48:15 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.91 2016/08/01 16:21:09 christos Exp $ */
2
/*
2
/*
3
 * sh.lex.c: Lexical analysis into tokens
3
 * sh.lex.c: Lexical analysis into tokens
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.lex.c,v 3.87 2011/01/24 17:48:15 christos Exp $")
35
RCSID("$tcsh: sh.lex.c,v 3.91 2016/08/01 16:21:09 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
38
Lines 66-72 Link Here
66
static	struct wordent	*getsub		(struct wordent *);
66
static	struct wordent	*getsub		(struct wordent *);
67
static	Char 		*subword	(Char *, Char, int *, size_t *);
67
static	Char 		*subword	(Char *, Char, int *, size_t *);
68
static	struct wordent	*dosub		(Char, struct wordent *, int);
68
static	struct wordent	*dosub		(Char, struct wordent *, int);
69
static	ssize_t		 wide_read	(int, Char *, size_t, int);
70
69
71
/*
70
/*
72
 * Peekc is a peek character for getC, peekread for readc.
71
 * Peekc is a peek character for getC, peekread for readc.
Lines 258-263 Link Here
258
}
257
}
259
258
260
void
259
void
260
initlex(struct wordent *vp)
261
{
262
	vp->word = STRNULL;
263
	vp->prev = vp;
264
	vp->next = vp;
265
}
266
267
void
261
freelex(struct wordent *vp)
268
freelex(struct wordent *vp)
262
{
269
{
263
    struct wordent *fp;
270
    struct wordent *fp;
Lines 378-384 Link Here
378
			     */
385
			     */
379
			    c |= QUOTE;
386
			    c |= QUOTE;
380
			ungetC(c);
387
			ungetC(c);
381
			c = '\\';
388
			c = '\\' | QUOTE;
382
		    }
389
		    }
383
		}
390
		}
384
	    }
391
	    }
Lines 1539-1545 Link Here
1539
    }
1546
    }
1540
}
1547
}
1541
1548
1542
static ssize_t
1549
ssize_t
1543
wide_read(int fildes, Char *buf, size_t nchars, int use_fclens)
1550
wide_read(int fildes, Char *buf, size_t nchars, int use_fclens)
1544
{
1551
{
1545
    char cbuf[BUFSIZE + 1];
1552
    char cbuf[BUFSIZE + 1];
(-)contrib/tcsh/sh.misc.c (-18 / +44 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.misc.c,v 3.46 2010/05/08 00:41:58 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.misc.c,v 3.50 2015/06/06 21:19:08 christos Exp $ */
2
/*
2
/*
3
 * sh.misc.c: Miscelaneous functions
3
 * sh.misc.c: Miscelaneous functions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.misc.c,v 3.46 2010/05/08 00:41:58 christos Exp $")
35
RCSID("$tcsh: sh.misc.c,v 3.50 2015/06/06 21:19:08 christos Exp $")
36
36
37
static	int	renum	(int, int);
37
static	int	renum	(int, int);
38
static  Char  **blkend	(Char **);
38
static  Char  **blkend	(Char **);
Lines 450-457 Link Here
450
450
451
    if (!cp)
451
    if (!cp)
452
	return (cp);
452
	return (cp);
453
    while ((*dp++ &= TRIM) != '\0')
453
    while (*dp != '\0') {
454
	continue;
454
#if INVALID_BYTE != 0
455
	if ((*dp & INVALID_BYTE) != INVALID_BYTE)    /* *dp < INVALID_BYTE */
456
#endif
457
		*dp &= TRIM;
458
	dp++;
459
    }
455
    return (cp);
460
    return (cp);
456
}
461
}
457
462
Lines 462-469 Link Here
462
467
463
    if (!cp)
468
    if (!cp)
464
	return (cp);
469
	return (cp);
465
    while (*dp != '\0')
470
    while (*dp != '\0') {
466
	*dp++ |= QUOTE;
471
#ifdef WIDE_STRINGS
472
	if ((*dp & 0xffffff80) == 0)	/* *dp < 0x80 */
473
#elif defined SHORT_STRINGS
474
	if ((*dp & 0xff80) == 0)	/* *dp < 0x80 */
475
#else
476
	if ((*dp & 0x80) == 0)		/* *dp < 0x80 */
477
#endif
478
	    *dp |= QUOTE;
479
	dp++;
480
    }
467
    return (cp);
481
    return (cp);
468
}
482
}
469
483
Lines 533-539 Link Here
533
    if (fildes < 0)
547
    if (fildes < 0)
534
	return;
548
	return;
535
    while (close(fildes) == -1 && errno == EINTR)
549
    while (close(fildes) == -1 && errno == EINTR)
536
	handle_pending_signals();
550
	if (handle_pending_signals())
551
	    break;
537
}
552
}
538
553
539
void
554
void
Lines 540-546 Link Here
540
xclosedir(DIR *dirp)
555
xclosedir(DIR *dirp)
541
{
556
{
542
    while (closedir(dirp) == -1 && errno == EINTR)
557
    while (closedir(dirp) == -1 && errno == EINTR)
543
	handle_pending_signals();
558
	if (handle_pending_signals())
559
	    break;
544
}
560
}
545
561
546
int
562
int
Lines 549-555 Link Here
549
    int res;
565
    int res;
550
566
551
    while ((res = creat(path, mode)) == -1 && errno == EINTR)
567
    while ((res = creat(path, mode)) == -1 && errno == EINTR)
552
	handle_pending_signals();
568
	if (handle_pending_signals())
569
	    break;
553
    return res;
570
    return res;
554
}
571
}
555
572
Lines 560-566 Link Here
560
    int res;
577
    int res;
561
578
562
    while ((res = dup2(fildes, fildes2)) == -1 && errno == EINTR)
579
    while ((res = dup2(fildes, fildes2)) == -1 && errno == EINTR)
563
	handle_pending_signals();
580
	if (handle_pending_signals())
581
	    break;
564
    return res;
582
    return res;
565
}
583
}
566
#endif
584
#endif
Lines 572-578 Link Here
572
590
573
    errno = 0;
591
    errno = 0;
574
    while ((res = getgrgid(xgid)) == NULL && errno == EINTR) {
592
    while ((res = getgrgid(xgid)) == NULL && errno == EINTR) {
575
	handle_pending_signals();
593
	if (handle_pending_signals())
594
	    break;
576
	errno = 0;
595
	errno = 0;
577
    }
596
    }
578
    return res;
597
    return res;
Lines 585-591 Link Here
585
604
586
    errno = 0;
605
    errno = 0;
587
    while ((res = getpwnam(name)) == NULL && errno == EINTR) {
606
    while ((res = getpwnam(name)) == NULL && errno == EINTR) {
588
	handle_pending_signals();
607
	if (handle_pending_signals())
608
	    break;
589
	errno = 0;
609
	errno = 0;
590
    }
610
    }
591
    return res;
611
    return res;
Lines 598-604 Link Here
598
618
599
    errno = 0;
619
    errno = 0;
600
    while ((res = getpwuid(xuid)) == NULL && errno == EINTR) {
620
    while ((res = getpwuid(xuid)) == NULL && errno == EINTR) {
601
	handle_pending_signals();
621
	if (handle_pending_signals())
622
	    break;
602
	errno = 0;
623
	errno = 0;
603
    }
624
    }
604
    return res;
625
    return res;
Lines 611-617 Link Here
611
632
612
    if ((oflag & O_CREAT) == 0) {
633
    if ((oflag & O_CREAT) == 0) {
613
	while ((res = open(path, oflag)) == -1 && errno == EINTR)
634
	while ((res = open(path, oflag)) == -1 && errno == EINTR)
614
	    handle_pending_signals();
635
	    if (handle_pending_signals())
636
		break;
615
    } else {
637
    } else {
616
	va_list ap;
638
	va_list ap;
617
	mode_t mode;
639
	mode_t mode;
Lines 623-629 Link Here
623
	mode = va_arg(ap, int);
645
	mode = va_arg(ap, int);
624
	va_end(ap);
646
	va_end(ap);
625
	while ((res = open(path, oflag, mode)) == -1 && errno == EINTR)
647
	while ((res = open(path, oflag, mode)) == -1 && errno == EINTR)
626
	    handle_pending_signals();
648
	    if (handle_pending_signals())
649
		break;
627
    }
650
    }
628
    return res;
651
    return res;
629
}
652
}
Lines 636-642 Link Here
636
    /* This is where we will be blocked most of the time, so handle signals
659
    /* This is where we will be blocked most of the time, so handle signals
637
       that didn't interrupt any system call. */
660
       that didn't interrupt any system call. */
638
    do
661
    do
639
      handle_pending_signals();
662
      if (handle_pending_signals())
663
	  break;
640
    while ((res = read(fildes, buf, nbyte)) == -1 && errno == EINTR);
664
    while ((res = read(fildes, buf, nbyte)) == -1 && errno == EINTR);
641
    return res;
665
    return res;
642
}
666
}
Lines 649-655 Link Here
649
673
650
    while ((res = tcsetattr(fildes, optional_actions, termios_p)) == -1 &&
674
    while ((res = tcsetattr(fildes, optional_actions, termios_p)) == -1 &&
651
	   errno == EINTR)
675
	   errno == EINTR)
652
	handle_pending_signals();
676
	if (handle_pending_signals())
677
	    break;
653
    return res;
678
    return res;
654
}
679
}
655
#endif
680
#endif
Lines 662-668 Link Here
662
    /* This is where we will be blocked most of the time, so handle signals
687
    /* This is where we will be blocked most of the time, so handle signals
663
       that didn't interrupt any system call. */
688
       that didn't interrupt any system call. */
664
    do
689
    do
665
      handle_pending_signals();
690
      if (handle_pending_signals())
691
	  break;
666
    while ((res = write(fildes, buf, nbyte)) == -1 && errno == EINTR);
692
    while ((res = write(fildes, buf, nbyte)) == -1 && errno == EINTR);
667
    return res;
693
    return res;
668
}
694
}
(-)contrib/tcsh/sh.print.c (-7 / +7 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.print.c,v 3.36 2011/05/25 20:17:20 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.print.c,v 3.37 2015/05/10 13:29:28 christos Exp $ */
2
/*
2
/*
3
 * sh.print.c: Primitive Output routines.
3
 * sh.print.c: Primitive Output routines.
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.print.c,v 3.36 2011/05/25 20:17:20 christos Exp $")
35
RCSID("$tcsh: sh.print.c,v 3.37 2015/05/10 13:29:28 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
38
Lines 231-243 Link Here
231
	return;
231
	return;
232
    if (GettingInput && !Tty_raw_mode && linp < &linbuf[sizeof linbuf - 10])
232
    if (GettingInput && !Tty_raw_mode && linp < &linbuf[sizeof linbuf - 10])
233
	return;
233
	return;
234
    if (handle_intr)
234
    if (handle_interrupt)
235
	exitset = 1;
235
       exitset = 1;
236
236
237
    if (interrupted) {
237
    if (interrupted) {
238
	interrupted = 0;
238
	interrupted = 0;
239
	linp = linbuf;		/* avoid recursion as stderror calls flush */
239
	linp = linbuf;		/* avoid recursion as stderror calls flush */
240
	if (handle_intr)
240
	if (handle_interrupt)
241
	    fixerror();
241
	    fixerror();
242
	else
242
	else
243
	    stderror(ERR_SILENT);
243
	    stderror(ERR_SILENT);
Lines 298-308 Link Here
298
	case EDQUOT:
298
	case EDQUOT:
299
#endif
299
#endif
300
	/* Nothing to do, but die */
300
	/* Nothing to do, but die */
301
	    if (handle_intr == 0)
301
	    if (handle_interrupt == 0)
302
		xexit(1);
302
		xexit(1);
303
	    /*FALLTHROUGH*/
303
	    /*FALLTHROUGH*/
304
	default:
304
	default:
305
	    if (handle_intr)
305
	    if (handle_interrupt)
306
		fixerror();
306
		fixerror();
307
	    else
307
	    else
308
		stderror(ERR_SILENT);
308
		stderror(ERR_SILENT);
(-)contrib/tcsh/sh.proc.c (-12 / +45 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.c,v 3.121 2012/01/25 15:34:41 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.c,v 3.134 2016/09/23 19:17:28 christos Exp $ */
2
/*
2
/*
3
 * sh.proc.c: Job manipulations
3
 * sh.proc.c: Job manipulations
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.proc.c,v 3.121 2012/01/25 15:34:41 christos Exp $")
35
RCSID("$tcsh: sh.proc.c,v 3.134 2016/09/23 19:17:28 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tc.h"
38
#include "tc.h"
Lines 47-57 Link Here
47
# define HZ 16
47
# define HZ 16
48
#endif /* aiws */
48
#endif /* aiws */
49
49
50
#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
50
#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid)
51
# if !defined(__ANDROID__)
51
# define BSDWAIT
52
#  define BSDWAIT
52
#endif /* _BSD || (IRIS4D && __STDC__) || __lucid */
53
# endif
54
#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
55
#ifndef WTERMSIG
53
#ifndef WTERMSIG
56
# define WTERMSIG(w)	(((union wait *) &(w))->w_termsig)
54
# define WTERMSIG(w)	(((union wait *) &(w))->w_termsig)
57
# ifndef BSDWAIT
55
# ifndef BSDWAIT
Lines 191-198 Link Here
191
#   else
189
#   else
192
    /* both a wait3 and rusage */
190
    /* both a wait3 and rusage */
193
#    if !defined(BSDWAIT) || defined(NeXT) || defined(MACH) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || (defined(IRIS4D) && SYSVREL <= 3) || defined(__lucid) || defined(__osf__)
191
#    if !defined(BSDWAIT) || defined(NeXT) || defined(MACH) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || (defined(IRIS4D) && SYSVREL <= 3) || defined(__lucid) || defined(__osf__)
192
#ifdef __ANDROID__ /* no wait3, only wait4 */
193
    pid = wait4(-1, &w,
194
       (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
195
#else
194
    pid = wait3(&w,
196
    pid = wait3(&w,
195
       (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
197
       (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
198
#endif /* __ANDROID__ */
196
#    else /* BSDWAIT */
199
#    else /* BSDWAIT */
197
    pid = wait3(&w.w_status,
200
    pid = wait3(&w.w_status,
198
       (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
201
       (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
Lines 507-512 Link Here
507
    cleanup_push(&oset, sigprocmask_cleanup);
510
    cleanup_push(&oset, sigprocmask_cleanup);
508
    pause_mask = oset;
511
    pause_mask = oset;
509
    sigdelset(&pause_mask, SIGCHLD);
512
    sigdelset(&pause_mask, SIGCHLD);
513
    sigaddset(&pause_mask, SIGINT);
510
    for (;;) {
514
    for (;;) {
511
	(void)handle_pending_signals();
515
	(void)handle_pending_signals();
512
	jobflags = 0;
516
	jobflags = 0;
Lines 593-614 Link Here
593
dowait(Char **v, struct command *c)
597
dowait(Char **v, struct command *c)
594
{
598
{
595
    struct process *pp;
599
    struct process *pp;
600
601
    /* the current block mask to be able to restore */
602
    sigset_t old_mask;
603
604
    /* block mask for critical section: OLD_MASK U {SIGCHLD} */
605
    sigset_t block_mask;
606
607
    /* ignore those during blocking sigsuspend:
608
       OLD_MASK / {SIGCHLD, possibly(SIGINT)} */
596
    sigset_t pause_mask;
609
    sigset_t pause_mask;
610
597
    int opintr_disabled, gotsig;
611
    int opintr_disabled, gotsig;
598
612
599
    USE(c);
613
    USE(c);
600
    USE(v);
614
    USE(v);
601
    pjobs++;
615
    pjobs++;
616
602
    sigprocmask(SIG_BLOCK, NULL, &pause_mask);
617
    sigprocmask(SIG_BLOCK, NULL, &pause_mask);
603
    sigdelset(&pause_mask, SIGCHLD);
618
    sigdelset(&pause_mask, SIGCHLD);
604
    if (setintr)
619
    if (setintr)
605
	sigdelset(&pause_mask, SIGINT);
620
	sigdelset(&pause_mask, SIGINT);
621
622
    /* critical section, block also SIGCHLD */
623
    sigprocmask(SIG_BLOCK, NULL, &block_mask);
624
    sigaddset(&block_mask, SIGCHLD);
625
    sigprocmask(SIG_BLOCK, &block_mask, &old_mask);
626
627
    /* detect older SIGCHLDs and remove PRUNNING flag from proclist */
628
    (void)handle_pending_signals();
629
606
loop:
630
loop:
607
    for (pp = proclist.p_next; pp; pp = pp->p_next)
631
    for (pp = proclist.p_next; pp; pp = pp->p_next)
608
	if (pp->p_procid &&	/* pp->p_procid == pp->p_jobid && */
632
	if (pp->p_procid &&	/* pp->p_procid == pp->p_jobid && */
609
	    pp->p_flags & PRUNNING) {
633
	    pp->p_flags & PRUNNING) {
610
	    (void)handle_pending_signals();
634
	    /* wait for (or pick up alredy blocked) SIGCHLD */
611
	    sigsuspend(&pause_mask);
635
	    sigsuspend(&pause_mask);
636
637
	    /* make the 'wait' interuptable by CTRL-C */
612
	    opintr_disabled = pintr_disabled;
638
	    opintr_disabled = pintr_disabled;
613
	    pintr_disabled = 0;
639
	    pintr_disabled = 0;
614
	    gotsig = handle_pending_signals();
640
	    gotsig = handle_pending_signals();
Lines 618-623 Link Here
618
	    goto loop;
644
	    goto loop;
619
	}
645
	}
620
    pjobs = 0;
646
    pjobs = 0;
647
648
    sigprocmask(SIG_SETMASK, &old_mask, NULL);
621
}
649
}
622
650
623
/*
651
/*
Lines 963-968 Link Here
963
    struct process *tp;
991
    struct process *tp;
964
    int     jobflags, pstatus, pcond;
992
    int     jobflags, pstatus, pcond;
965
    const char *format;
993
    const char *format;
994
    int ohaderr;
966
995
967
#ifdef BACKPIPE
996
#ifdef BACKPIPE
968
    struct process *pipehead = NULL, *pipetail = NULL, *pmarker = NULL;
997
    struct process *pipehead = NULL, *pipetail = NULL, *pmarker = NULL;
Lines 978-983 Link Here
978
    tp = pp;
1007
    tp = pp;
979
    status = reason = -1;
1008
    status = reason = -1;
980
    jobflags = 0;
1009
    jobflags = 0;
1010
    ohaderr = haderr;
1011
    /* Print status to stderr, except for jobs built-in */
1012
    haderr = !(flag & JOBLIST);
981
    do {
1013
    do {
982
#ifdef BACKPIPE
1014
#ifdef BACKPIPE
983
	/*
1015
	/*
Lines 1186-1191 Link Here
1186
	    xprintf("       ");
1218
	    xprintf("       ");
1187
	ptprint(tp);
1219
	ptprint(tp);
1188
    }
1220
    }
1221
    haderr = ohaderr;
1189
    return (jobflags);
1222
    return (jobflags);
1190
}
1223
}
1191
1224
Lines 1284-1290 Link Here
1284
dojobs(Char **v, struct command *c)
1317
dojobs(Char **v, struct command *c)
1285
{
1318
{
1286
    struct process *pp;
1319
    struct process *pp;
1287
    int flag = NUMBER | NAME | REASON;
1320
    int flag = NUMBER | NAME | REASON | JOBLIST;
1288
    int     i;
1321
    int     i;
1289
1322
1290
    USE(c);
1323
    USE(c);
Lines 1833-1844 Link Here
1833
	    (void) signal(SIGHUP, SIG_IGN);
1866
	    (void) signal(SIGHUP, SIG_IGN);
1834
	if (t->t_dflg & F_NICE) {
1867
	if (t->t_dflg & F_NICE) {
1835
	    int nval = SIGN_EXTEND_CHAR(t->t_nice);
1868
	    int nval = SIGN_EXTEND_CHAR(t->t_nice);
1836
#ifdef HAVE_SETPRIORITY
1869
#if defined(HAVE_SETPRIORITY) && defined(PRIO_PROCESS)
1837
	    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
1870
	    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
1838
		stderror(ERR_SYSTEM, "setpriority", strerror(errno));
1871
		stderror(ERR_SYSTEM, "setpriority", strerror(errno));
1839
#else /* !HAVE_SETPRIORITY */
1872
#else /* !HAVE_SETPRIORITY || !PRIO_PROCESS */
1840
	    (void) nice(nval);
1873
	    (void) nice(nval);
1841
#endif /* !HAVE_SETPRIORITY */
1874
#endif /* HAVE_SETPRIORITY  && PRIO_PROCESS */
1842
	}
1875
	}
1843
#ifdef F_VER
1876
#ifdef F_VER
1844
        if (t->t_dflg & F_VER) {
1877
        if (t->t_dflg & F_VER) {
(-)contrib/tcsh/sh.proc.h (-9 / +10 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.h,v 3.15 2011/04/14 18:25:25 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.h,v 3.16 2016/05/24 17:41:12 christos Exp $ */
2
/*
2
/*
3
 * sh.proc.h: Process data structures and variables
3
 * sh.proc.h: Process data structures and variables
4
 */
4
 */
Lines 106-119 Link Here
106
#define PBRACE		(1<<18)	/* Process is {} evaluation */
106
#define PBRACE		(1<<18)	/* Process is {} evaluation */
107
107
108
/* defines for arguments to pprint */
108
/* defines for arguments to pprint */
109
#define	NUMBER		01
109
#define	NUMBER		0x001
110
#define	NAME		02
110
#define	NAME		0x002
111
#define	REASON		04
111
#define	REASON		0x004
112
#define	AMPERSAND	010
112
#define	AMPERSAND	0x008
113
#define	FANCY		020
113
#define	FANCY		0x010
114
#define	SHELLDIR	040	/* print shell's dir if not the same */
114
#define	SHELLDIR	0x020	/* print shell's dir if not the same */
115
#define	JOBDIR		0100	/* print job's dir if not the same */
115
#define	JOBDIR		0x040	/* print job's dir if not the same */
116
#define	AREASON		0200
116
#define	AREASON		0x080
117
#define	JOBLIST		0x100
117
118
118
EXTERN struct process proclist IZERO_STRUCT;/* list head of all processes */
119
EXTERN struct process proclist IZERO_STRUCT;/* list head of all processes */
119
120
(-)contrib/tcsh/sh.sem.c (-10 / +35 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.sem.c,v 3.86 2011/02/25 23:24:19 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.sem.c,v 3.90 2015/10/31 18:54:42 christos Exp $ */
2
/*
2
/*
3
 * sh.sem.c: I/O redirections and job forking. A touchy issue!
3
 * sh.sem.c: I/O redirections and job forking. A touchy issue!
4
 *	     Most stuff with builtins is incorrect
4
 *	     Most stuff with builtins is incorrect
Lines 33-39 Link Here
33
 */
33
 */
34
#include "sh.h"
34
#include "sh.h"
35
35
36
RCSID("$tcsh: sh.sem.c,v 3.86 2011/02/25 23:24:19 christos Exp $")
36
RCSID("$tcsh: sh.sem.c,v 3.90 2015/10/31 18:54:42 christos Exp $")
37
37
38
#include "tc.h"
38
#include "tc.h"
39
#include "tw.h"
39
#include "tw.h"
Lines 212-219 Link Here
212
	 * If noexec then this is all we do.
212
	 * If noexec then this is all we do.
213
	 */
213
	 */
214
	if (t->t_dflg & F_READ) {
214
	if (t->t_dflg & F_READ) {
215
	    int old_pintr_disabled;
216
215
	    xclose(0);
217
	    xclose(0);
218
	    if (setintr)
219
		pintr_push_enable(&old_pintr_disabled);
216
	    heredoc(t->t_dlef);
220
	    heredoc(t->t_dlef);
221
	    if (setintr)
222
		cleanup_until(&old_pintr_disabled);
217
	    if (noexec)
223
	    if (noexec)
218
		xclose(0);
224
		xclose(0);
219
	}
225
	}
Lines 346-355 Link Here
346
	 * not pipedout, niced, nohupped, or &'d. It would be nice(?) to not
352
	 * not pipedout, niced, nohupped, or &'d. It would be nice(?) to not
347
	 * fork in some of these cases.
353
	 * fork in some of these cases.
348
	 */
354
	 */
349
	/*
350
	 * Prevent forking cd, pushd, popd, chdir cause this will cause the
351
	 * shell not to change dir!
352
	 */
353
#ifdef BACKPIPE
355
#ifdef BACKPIPE
354
	/*
356
	/*
355
	 * Can't have NOFORK for the tail of a pipe - because it is not the
357
	 * Can't have NOFORK for the tail of a pipe - because it is not the
Lines 358-368 Link Here
358
	 */
360
	 */
359
	if (t->t_dflg & F_PIPEIN)
361
	if (t->t_dflg & F_PIPEIN)
360
	    t->t_dflg &= ~(F_NOFORK);
362
	    t->t_dflg &= ~(F_NOFORK);
363
#else
364
	/*
365
	 * "command | builtin" may cause major misbehaviour as noted in
366
	 * in the BUGS file entry
367
	 * Subject: Redirected input to built-in functions misbehaves badly
368
	 * forking when the builtin is the end of the pipe corrects the
369
	 * problem.
370
	 */
371
	if (bifunc && (t->t_dflg & F_PIPEIN))
372
	    t->t_dflg &= ~(F_NOFORK);
361
#endif /* BACKPIPE */
373
#endif /* BACKPIPE */
374
	/*
375
	 * Prevent forking cd, pushd, popd, chdir cause this will cause the
376
	 * shell not to change dir! (XXX: but only for nice?)
377
	 */
362
	if (bifunc && (bifunc->bfunct == (bfunc_t)dochngd ||
378
	if (bifunc && (bifunc->bfunct == (bfunc_t)dochngd ||
363
		       bifunc->bfunct == (bfunc_t)dopushd ||
379
		       bifunc->bfunct == (bfunc_t)dopushd ||
364
		       bifunc->bfunct == (bfunc_t)dopopd))
380
		       bifunc->bfunct == (bfunc_t)dopopd))
365
	    t->t_dflg &= ~(F_NICE);
381
	    t->t_dflg &= ~(F_NICE);
382
366
	if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
383
	if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
367
	     (!bifunc || t->t_dflg &
384
	     (!bifunc || t->t_dflg &
368
	      (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP | F_HUP)))) ||
385
	      (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP | F_HUP)))) ||
Lines 560-572 Link Here
560
			(void) signal(SIGHUP, SIG_DFL);
577
			(void) signal(SIGHUP, SIG_DFL);
561
		    if (t->t_dflg & F_NICE) {
578
		    if (t->t_dflg & F_NICE) {
562
			int nval = SIGN_EXTEND_CHAR(t->t_nice);
579
			int nval = SIGN_EXTEND_CHAR(t->t_nice);
563
# ifdef HAVE_SETPRIORITY
580
# if defined(HAVE_SETPRIORITY) && defined(PRIO_PROCESS)
564
			if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
581
			if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
565
				stderror(ERR_SYSTEM, "setpriority",
582
				stderror(ERR_SYSTEM, "setpriority",
566
				    strerror(errno));
583
				    strerror(errno));
567
# else /* !HAVE_SETPRIORITY */
584
# else /* !HAVE_SETPRIORITY || !PRIO_PROCESS */
568
			(void) nice(nval);
585
			(void) nice(nval);
569
# endif /* HAVE_SETPRIORITY */
586
# endif /* HAVE_SETPRIORITY && PRIO_PROCESS */
570
		    }
587
		    }
571
# ifdef F_VER
588
# ifdef F_VER
572
		    if (t->t_dflg & F_VER) {
589
		    if (t->t_dflg & F_VER) {
Lines 898-904 Link Here
898
	else
915
	else
899
	    fd = 0;
916
	    fd = 0;
900
	if ((flags & F_APPEND) == 0 || fd == -1) {
917
	if ((flags & F_APPEND) == 0 || fd == -1) {
901
	    if (!(flags & F_OVERWRITE) && adrof(STRnoclobber)) {
918
	    if (!(flags & F_OVERWRITE) && no_clobber) {
902
		if (flags & F_APPEND)
919
		if (flags & F_APPEND)
903
		    stderror(ERR_SYSTEM, tmp, strerror(errno));
920
		    stderror(ERR_SYSTEM, tmp, strerror(errno));
904
		chkclob(tmp);
921
		chkclob(tmp);
Lines 970-974 Link Here
970
	return;
987
	return;
971
    if (S_ISCHR(stb.st_mode))
988
    if (S_ISCHR(stb.st_mode))
972
	return;
989
	return;
990
    if (no_clobber & NOCLOBBER_NOTEMPTY && stb.st_size == 0)
991
	return;
992
    if (no_clobber & NOCLOBBER_ASK) {
993
	if (getYN(CGETS(22, 15,
994
	    "Do you really want to overwrite an existing file? [N/y] ")))
995
	    return;
996
    }
997
973
    stderror(ERR_EXISTS, cp);
998
    stderror(ERR_EXISTS, cp);
974
}
999
}
(-)contrib/tcsh/sh.set.c (-2 / +59 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.set.c,v 3.83 2012/01/15 17:15:28 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.set.c,v 3.89 2015/09/08 15:49:53 christos Exp $ */
2
/*
2
/*
3
 * sh.set.c: Setting and Clearing of variables
3
 * sh.set.c: Setting and Clearing of variables
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.set.c,v 3.83 2012/01/15 17:15:28 christos Exp $")
35
RCSID("$tcsh: sh.set.c,v 3.89 2015/09/08 15:49:53 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 55-60 Link Here
55
static	void		 unsetv1	(struct varent *);
55
static	void		 unsetv1	(struct varent *);
56
static	void		 exportpath	(Char **);
56
static	void		 exportpath	(Char **);
57
static	void		 balance	(struct varent *, int, int);
57
static	void		 balance	(struct varent *, int, int);
58
static	int		 set_noclobber  (Char **);
58
59
59
/*
60
/*
60
 * C Shell
61
 * C Shell
Lines 72-77 Link Here
72
	    dohash(NULL, NULL);
73
	    dohash(NULL, NULL);
73
	}
74
	}
74
    }
75
    }
76
    else if (eq(vp, STRnoclobber)) {
77
	struct varent *p = adrof(STRnoclobber);
78
	if (p == NULL)
79
	    stderror(ERR_NAME | ERR_UNDVAR);
80
	else
81
	    no_clobber = set_noclobber(p->vec);
82
    }
75
    else if (eq(vp, STRhistchars)) {
83
    else if (eq(vp, STRhistchars)) {
76
	Char *pn = varval(vp);
84
	Char *pn = varval(vp);
77
85
Lines 165-170 Link Here
165
	noediting = 0;
173
	noediting = 0;
166
	/* PWP: add more stuff in here later */
174
	/* PWP: add more stuff in here later */
167
    }
175
    }
176
    else if (eq(vp, STRvimode)) {
177
	VImode = 1;
178
	update_wordchars();
179
    }
168
    else if (eq(vp, STRshlvl)) {
180
    else if (eq(vp, STRshlvl)) {
169
	tsetenv(STRKSHLVL, varval(vp));
181
	tsetenv(STRKSHLVL, varval(vp));
170
    }
182
    }
Lines 195-200 Link Here
195
    else if (eq(vp, STRkillring)) {
207
    else if (eq(vp, STRkillring)) {
196
	SetKillRing((int)getn(varval(vp)));
208
	SetKillRing((int)getn(varval(vp)));
197
    }
209
    }
210
    else if (eq(vp, STRhistory)) {
211
	sethistory((int)getn(varval(vp)));
212
    }
198
#ifndef HAVENOUTMP
213
#ifndef HAVENOUTMP
199
    else if (eq(vp, STRwatch)) {
214
    else if (eq(vp, STRwatch)) {
200
	resetwatch();
215
	resetwatch();
Lines 203-208 Link Here
203
    else if (eq(vp, STRimplicitcd)) {
218
    else if (eq(vp, STRimplicitcd)) {
204
	implicit_cd = ((eq(varval(vp), STRverbose)) ? 2 : 1);
219
	implicit_cd = ((eq(varval(vp), STRverbose)) ? 2 : 1);
205
    }
220
    }
221
    else if (eq(vp, STRcdtohome)) {
222
	cdtohome = 1;
223
    }
206
#ifdef COLOR_LS_F
224
#ifdef COLOR_LS_F
207
    else if (eq(vp, STRcolor)) {
225
    else if (eq(vp, STRcolor)) {
208
	set_color_context();
226
	set_color_context();
Lines 762-767 Link Here
762
	PRCH = tcsh ? '>' : '%';
780
	PRCH = tcsh ? '>' : '%';
763
	PRCHROOT = '#';
781
	PRCHROOT = '#';
764
    }
782
    }
783
    if (adrof(STRnoclobber) == 0)
784
	no_clobber = 0;
765
    if (adrof(STRhistlit) == 0)
785
    if (adrof(STRhistlit) == 0)
766
	HistLit = 0;
786
	HistLit = 0;
767
    if (adrof(STRloginsh) == 0)
787
    if (adrof(STRloginsh) == 0)
Lines 780-791 Link Here
780
	symlinks = 0;
800
	symlinks = 0;
781
    if (adrof(STRimplicitcd) == 0)
801
    if (adrof(STRimplicitcd) == 0)
782
	implicit_cd = 0;
802
	implicit_cd = 0;
803
    if (adrof(STRcdtohome) == 0)
804
	cdtohome = 0;
783
    if (adrof(STRkillring) == 0)
805
    if (adrof(STRkillring) == 0)
784
	SetKillRing(0);
806
	SetKillRing(0);
785
    if (did_edit && noediting && adrof(STRedit) == 0)
807
    if (did_edit && noediting && adrof(STRedit) == 0)
786
	noediting = 0;
808
	noediting = 0;
809
    if (adrof(STRvimode) == 0)
810
	VImode = 0;
787
    if (did_roe && adrof(STRrecognize_only_executables) == 0)
811
    if (did_roe && adrof(STRrecognize_only_executables) == 0)
788
	tw_cmd_free();
812
	tw_cmd_free();
813
    if (adrof(STRhistory) == 0)
814
	sethistory(0);
789
#ifdef COLOR_LS_F
815
#ifdef COLOR_LS_F
790
    if (adrof(STRcolor) == 0)
816
    if (adrof(STRcolor) == 0)
791
	set_color_context();
817
	set_color_context();
Lines 793-798 Link Here
793
#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
819
#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
794
    update_dspmbyte_vars();
820
    update_dspmbyte_vars();
795
#endif
821
#endif
822
    update_wordchars();
796
#ifdef NLS_CATALOGS
823
#ifdef NLS_CATALOGS
797
    nlsclose();
824
    nlsclose();
798
    nlsinit();
825
    nlsinit();
Lines 920-925 Link Here
920
    cleanup_until(exppath);
947
    cleanup_until(exppath);
921
}
948
}
922
949
950
static int
951
set_noclobber(Char **val)
952
{
953
    Char *option;
954
    int nc = NOCLOBBER_DEFAULT;
955
956
    if (val == NULL)
957
	return nc;
958
    while (*val) {
959
	if (*val == 0 || eq(*val, STRRparen))
960
	    return nc;
961
962
	option = *val++;
963
964
	if (eq(option, STRnotempty))
965
	    nc |= NOCLOBBER_NOTEMPTY;
966
	else if (eq(option, STRask))
967
	    nc |= NOCLOBBER_ASK;
968
    }
969
    return nc;
970
}
971
923
#ifndef lint
972
#ifndef lint
924
 /*
973
 /*
925
  * Lint thinks these have null effect
974
  * Lint thinks these have null effect
Lines 1301-1303 Link Here
1301
}
1350
}
1302
#endif
1351
#endif
1303
#endif
1352
#endif
1353
1354
void
1355
update_wordchars(void)
1356
{
1357
    if ((word_chars == STR_WORD_CHARS) || (word_chars == STR_WORD_CHARS_VI)) {
1358
	word_chars = (VImode ? STR_WORD_CHARS_VI : STR_WORD_CHARS);
1359
    }
1360
}
(-)contrib/tcsh/sh.time.c (-5 / +10 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.time.c,v 3.35 2010/12/09 15:39:29 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/sh.time.c,v 3.37 2016/07/09 00:45:29 christos Exp $ */
2
/*
2
/*
3
 * sh.time.c: Shell time keeping and printing.
3
 * sh.time.c: Shell time keeping and printing.
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: sh.time.c,v 3.35 2010/12/09 15:39:29 christos Exp $")
35
RCSID("$tcsh: sh.time.c,v 3.37 2016/07/09 00:45:29 christos Exp $")
36
36
37
#ifdef SUNOS4
37
#ifdef SUNOS4
38
# include <machine/param.h>
38
# include <machine/param.h>
Lines 158-169 Link Here
158
	nval = 4;
158
	nval = 4;
159
    else if (*v	== 0 &&	any("+-", cp[0]))
159
    else if (*v	== 0 &&	any("+-", cp[0]))
160
	nval = getn(cp);
160
	nval = getn(cp);
161
#ifdef HAVE_SETPRIORITY
161
#if defined(HAVE_SETPRIORITY) && defined(PRIO_PROCESS)
162
    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
162
    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
163
	stderror(ERR_SYSTEM, "setpriority", strerror(errno));
163
	stderror(ERR_SYSTEM, "setpriority", strerror(errno));
164
#else /* !HAVE_SETPRIORITY */
164
#else /* !HAVE_SETPRIORITY || !PRIO_PROCESS */
165
    (void) nice(nval);
165
    (void) nice(nval);
166
#endif /* HAVE_SETPRIORITY */
166
#endif /* HAVE_SETPRIORITY && PRIO_PROCESS */
167
}
167
}
168
168
169
#ifdef BSDTIMES
169
#ifdef BSDTIMES
Lines 293-298 Link Here
293
# endif	/* _SEQUENT_ */
293
# endif	/* _SEQUENT_ */
294
#endif /* BSDTIMES */
294
#endif /* BSDTIMES */
295
{
295
{
296
    int ohaderr = haderr;
296
#ifdef BSDTIMES
297
#ifdef BSDTIMES
297
    time_t t =
298
    time_t t =
298
    (r1->ru_utime.tv_sec - r0->ru_utime.tv_sec)	* 100 +
299
    (r1->ru_utime.tv_sec - r0->ru_utime.tv_sec)	* 100 +
Lines 334-339 Link Here
334
    ((e->tv_sec	- b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
335
    ((e->tv_sec	- b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
335
336
336
    cp = "%Uu %Ss %E %P	%X+%Dk %I+%Oio %Fpf+%Ww";
337
    cp = "%Uu %Ss %E %P	%X+%Dk %I+%Oio %Fpf+%Ww";
338
    haderr = 0;
337
#else /* !BSDTIMES */
339
#else /* !BSDTIMES */
338
# ifdef	_SEQUENT_
340
# ifdef	_SEQUENT_
339
    int	    ms = (int)
341
    int	    ms = (int)
Lines 340-345 Link Here
340
    ((e->tv_sec	- b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
342
    ((e->tv_sec	- b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
341
343
342
    cp = "%Uu %Ss %E %P	%I+%Oio	%Fpf+%Ww";
344
    cp = "%Uu %Ss %E %P	%I+%Oio	%Fpf+%Ww";
345
    haderr = 0;
343
# else /* !_SEQUENT_ */
346
# else /* !_SEQUENT_ */
344
#  ifndef POSIX
347
#  ifndef POSIX
345
    time_t ms = ((time_t)((e - b) / HZ) * 100) +
348
    time_t ms = ((time_t)((e - b) / HZ) * 100) +
Lines 350-355 Link Here
350
#  endif /* POSIX */
353
#  endif /* POSIX */
351
354
352
    cp = "%Uu %Ss %E %P";
355
    cp = "%Uu %Ss %E %P";
356
    haderr = 0;
353
357
354
    /*
358
    /*
355
     * the tms stuff is	not very precise, so we	fudge it.
359
     * the tms stuff is	not very precise, so we	fudge it.
Lines 678-683 Link Here
678
		break;
682
		break;
679
	    }
683
	    }
680
    xputchar('\n');
684
    xputchar('\n');
685
    haderr = ohaderr;
681
}
686
}
682
687
683
#if defined(BSDTIMES) || defined(_SEQUENT_)
688
#if defined(BSDTIMES) || defined(_SEQUENT_)
(-)contrib/tcsh/tc.alloc.c (-19 / +29 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.alloc.c,v 3.50 2011/12/30 20:55:24 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.alloc.c,v 3.56 2016/03/08 12:47:43 christos Exp $ */
2
/*
2
/*
3
 * tc.alloc.c (Caltech) 2/21/82
3
 * tc.alloc.c (Caltech) 2/21/82
4
 * Chris Kingsley, kingsley@cit-20.
4
 * Chris Kingsley, kingsley@cit-20.
Lines 42-49 Link Here
42
#ifdef HAVE_MALLINFO
42
#ifdef HAVE_MALLINFO
43
#include <malloc.h>
43
#include <malloc.h>
44
#endif
44
#endif
45
#if defined(HAVE_SBRK) && !defined(__APPLE__)
46
#define USE_SBRK
47
#endif
45
48
46
RCSID("$tcsh: tc.alloc.c,v 3.50 2011/12/30 20:55:24 christos Exp $")
49
RCSID("$tcsh: tc.alloc.c,v 3.56 2016/03/08 12:47:43 christos Exp $")
47
50
48
#define RCHECK
51
#define RCHECK
49
#define DEBUG
52
#define DEBUG
Lines 66-72 Link Here
66
{
69
{
67
    static const char msg[] = "Out of memory\n";
70
    static const char msg[] = "Out of memory\n";
68
71
69
    write(didfds ? 2 : SHDIAG, msg, strlen(msg));
72
    TCSH_IGNORE(write(didfds ? 2 : SHDIAG, msg, strlen(msg)));
70
    _exit(1);
73
    _exit(1);
71
}
74
}
72
#endif
75
#endif
Lines 131-137 Link Here
131
#endif
134
#endif
132
135
133
136
137
#ifdef _LP64
138
#define ROUNDUP	15
139
#else
134
#define ROUNDUP	7
140
#define ROUNDUP	7
141
#endif
135
142
136
/*
143
/*
137
 * nextf[i] is the pointer to the next free block of size 2^(i+3).  The
144
 * nextf[i] is the pointer to the next free block of size 2^(i+3).  The
Lines 345-354 Link Here
345
{
352
{
346
#ifndef lint
353
#ifndef lint
347
    char *cp;
354
    char *cp;
355
    volatile size_t k;
348
356
349
    i *= j;
357
    i *= j;
350
    cp = xmalloc(i);
358
    cp = xmalloc(i);
351
    memset(cp, 0, i);
359
    /* Stop gcc 5.x from optimizing malloc+memset = calloc */
360
    k = i;
361
    memset(cp, 0, k);
352
362
353
    return ((memalign_t) cp);
363
    return ((memalign_t) cp);
354
#else
364
#else
Lines 459-465 Link Here
459
    const union overhead *op = (const union overhead *)
469
    const union overhead *op = (const union overhead *)
460
	(((const char *) ptr) - MEMALIGN(sizeof(*op)));
470
	(((const char *) ptr) - MEMALIGN(sizeof(*op)));
461
    if (op->ov_magic == MAGIC)
471
    if (op->ov_magic == MAGIC)
462
	    return 1 << (op->ov_index + 2);
472
	    return 1 << (op->ov_index + 3);
463
    else
473
    else
464
	    return 0;
474
	    return 0;
465
}
475
}
Lines 513-531 Link Here
513
523
514
    n = n ? n : 1;
524
    n = n ? n : 1;
515
525
516
#ifdef HAVE_SBRK
526
#ifdef USE_SBRK
517
    if (membot == NULL)
527
    if (membot == NULL)
518
	membot = sbrk(0);
528
	membot = sbrk(0);
519
#endif /* HAVE_SBRK */
529
#endif /* USE_SBRK */
520
530
521
    if ((ptr = malloc(n)) == NULL)
531
    if ((ptr = malloc(n)) == NULL)
522
	out_of_memory();
532
	out_of_memory();
523
#ifndef HAVE_SBRK
533
#ifndef USE_SBRK
524
    if (memtop < ((char *) ptr) + n)
534
    if (memtop < ((char *) ptr) + n)
525
	memtop = ((char *) ptr) + n;
535
	memtop = ((char *) ptr) + n;
526
    if (membot == NULL)
536
    if (membot == NULL)
527
	membot = ptr;
537
	membot = ptr;
528
#endif /* !HAVE_SBRK */
538
#endif /* !USE_SBRK */
529
    return ((memalign_t) ptr);
539
    return ((memalign_t) ptr);
530
}
540
}
531
541
Lines 536-554 Link Here
536
546
537
    n = n ? n : 1;
547
    n = n ? n : 1;
538
548
539
#ifdef HAVE_SBRK
549
#ifdef USE_SBRK
540
    if (membot == NULL)
550
    if (membot == NULL)
541
	membot = sbrk(0);
551
	membot = sbrk(0);
542
#endif /* HAVE_SBRK */
552
#endif /* USE_SBRK */
543
553
544
    if ((ptr = (p ? realloc(p, n) : malloc(n))) == NULL)
554
    if ((ptr = (p ? realloc(p, n) : malloc(n))) == NULL)
545
	out_of_memory();
555
	out_of_memory();
546
#ifndef HAVE_SBRK
556
#ifndef USE_SBRK
547
    if (memtop < ((char *) ptr) + n)
557
    if (memtop < ((char *) ptr) + n)
548
	memtop = ((char *) ptr) + n;
558
	memtop = ((char *) ptr) + n;
549
    if (membot == NULL)
559
    if (membot == NULL)
550
	membot = ptr;
560
	membot = ptr;
551
#endif /* !HAVE_SBRK */
561
#endif /* !USE_SBRK */
552
    return ((memalign_t) ptr);
562
    return ((memalign_t) ptr);
553
}
563
}
554
564
Lines 560-569 Link Here
560
    n *= s;
570
    n *= s;
561
    n = n ? n : 1;
571
    n = n ? n : 1;
562
572
563
#ifdef HAVE_SBRK
573
#ifdef USE_SBRK
564
    if (membot == NULL)
574
    if (membot == NULL)
565
	membot = sbrk(0);
575
	membot = sbrk(0);
566
#endif /* HAVE_SBRK */
576
#endif /* USE_SBRK */
567
577
568
    if ((ptr = malloc(n)) == NULL)
578
    if ((ptr = malloc(n)) == NULL)
569
	out_of_memory();
579
	out_of_memory();
Lines 570-581 Link Here
570
580
571
    memset (ptr, 0, n);
581
    memset (ptr, 0, n);
572
582
573
#ifndef HAVE_SBRK
583
#ifndef USE_SBRK
574
    if (memtop < ((char *) ptr) + n)
584
    if (memtop < ((char *) ptr) + n)
575
	memtop = ((char *) ptr) + n;
585
	memtop = ((char *) ptr) + n;
576
    if (membot == NULL)
586
    if (membot == NULL)
577
	membot = ptr;
587
	membot = ptr;
578
#endif /* !HAVE_SBRK */
588
#endif /* !USE_SBRK */
579
589
580
    return ((memalign_t) ptr);
590
    return ((memalign_t) ptr);
581
}
591
}
Lines 625-633 Link Here
625
	    (unsigned long) sbrk(0));
635
	    (unsigned long) sbrk(0));
626
#else /* SYSMALLOC */
636
#else /* SYSMALLOC */
627
#ifndef HAVE_MALLINFO
637
#ifndef HAVE_MALLINFO
628
#ifdef HAVE_SBRK
638
#ifdef USE_SBRK
629
    memtop = sbrk(0);
639
    memtop = sbrk(0);
630
#endif /* HAVE_SBRK */
640
#endif /* USE_SBRK */
631
    xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
641
    xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
632
	    (unsigned long) membot, (unsigned long) memtop, 
642
	    (unsigned long) membot, (unsigned long) memtop, 
633
	    (unsigned long) (memtop - membot));
643
	    (unsigned long) (memtop - membot));
(-)contrib/tcsh/tc.bind.c (-4 / +10 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.bind.c,v 3.45 2009/06/25 21:15:37 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.bind.c,v 3.46 2015/08/13 08:54:04 christos Exp $ */
2
/*
2
/*
3
 * tc.bind.c: Key binding functions
3
 * tc.bind.c: Key binding functions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.bind.c,v 3.45 2009/06/25 21:15:37 christos Exp $")
35
RCSID("$tcsh: tc.bind.c,v 3.46 2015/08/13 08:54:04 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "ed.defns.h"
38
#include "ed.defns.h"
Lines 506-513 Link Here
506
	    "    -v   bind all keys to vi bindings\n"));
506
	    "    -v   bind all keys to vi bindings\n"));
507
    xprintf("%s", CGETS(20, 18,
507
    xprintf("%s", CGETS(20, 18,
508
	    "    -e   bind all keys to emacs bindings\n"));
508
	    "    -e   bind all keys to emacs bindings\n"));
509
    xprintf("%s", CGETS(20, 19,
509
    xprintf(CGETS(20, 19,
510
	    "    -d   bind all keys to default editor's bindings\n"));
510
	    "    -d   bind all keys to default editor's bindings (%s)\n"),
511
#ifdef VIDEFAULT
512
	    "vi"
513
#else /* EMACSDEFAULT */
514
	    "emacs"
515
#endif /* VIDEFAULT */
516
	    );
511
    xprintf("%s", CGETS(20, 20,
517
    xprintf("%s", CGETS(20, 20,
512
	    "    -l   list editor commands with descriptions\n"));
518
	    "    -l   list editor commands with descriptions\n"));
513
    xprintf("%s", CGETS(20, 21,
519
    xprintf("%s", CGETS(20, 21,
(-)contrib/tcsh/tc.const.c (-6 / +13 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.const.c,v 3.98 2011/04/14 18:25:26 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.const.c,v 3.107 2015/09/08 15:49:53 christos Exp $ */
2
/*
2
/*
3
 * sh.const.c: String constants for tcsh.
3
 * sh.const.c: String constants for tcsh.
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.const.c,v 3.98 2011/04/14 18:25:26 christos Exp $")
35
RCSID("$tcsh: tc.const.c,v 3.107 2015/09/08 15:49:53 christos Exp $")
36
36
37
Char STRlogout[]	= { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
37
Char STRlogout[]	= { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
38
Char STRautologout[]	= { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't', 
38
Char STRautologout[]	= { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't', 
Lines 85-90 Link Here
85
Char STRMACHTYPE[]	= { 'M', 'A', 'C', 'H', 'T', 'Y', 'P', 'E', '\0' };
85
Char STRMACHTYPE[]	= { 'M', 'A', 'C', 'H', 'T', 'Y', 'P', 'E', '\0' };
86
Char STROSTYPE[]	= { 'O', 'S', 'T', 'Y', 'P', 'E', '\0' };
86
Char STROSTYPE[]	= { 'O', 'S', 'T', 'Y', 'P', 'E', '\0' };
87
Char STRedit[]		= { 'e', 'd', 'i', 't', '\0' };
87
Char STRedit[]		= { 'e', 'd', 'i', 't', '\0' };
88
Char STReditors[]	= { 'e', 'd', 'i', 't', 'o', 'r', 's', '\0' };
89
Char STRvimode[]	= { 'v', 'i', 'm', 'o', 'd', 'e', '\0' };
88
Char STRaddsuffix[]	= { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x',
90
Char STRaddsuffix[]	= { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x',
89
			    '\0' };
91
			    '\0' };
90
Char STRcsubstnonl[]	= { 'c', 's', 'u', 'b', 's', 't', 'n', 'o', 'n', 'l',
92
Char STRcsubstnonl[]	= { 'c', 's', 'u', 'b', 's', 't', 'n', 'o', 'n', 'l',
Lines 113-118 Link Here
113
Char STRmm[]		= { '-', 'm', '\0' };
115
Char STRmm[]		= { '-', 'm', '\0' };
114
Char STRmr[]		= { '-', 'r', '\0' };
116
Char STRmr[]		= { '-', 'r', '\0' };
115
Char STRmerge[]		= { 'm', 'e', 'r', 'g', 'e', '\0' };
117
Char STRmerge[]		= { 'm', 'e', 'r', 'g', 'e', '\0' };
118
Char STRlock[]		= { 'l', 'o', 'c', 'k', '\0' };
116
Char STRtildothist[]	= { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
119
Char STRtildothist[]	= { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
117
			    'y', '\0' };
120
			    'y', '\0' };
118
121
Lines 369-374 Link Here
369
Char STRsldotlogin[]	= { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' };
372
Char STRsldotlogin[]	= { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' };
370
Char STRignoreeof[]	= { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
373
Char STRignoreeof[]	= { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
371
Char STRnoclobber[]	= { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
374
Char STRnoclobber[]	= { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
375
Char STRnotempty[]	= { 'n', 'o', 't', 'e', 'm', 'p', 't', 'y', '\0' };
376
Char STRask[]		= { 'a', 's', 'k', '\0' };
372
Char STRhelpcommand[]	= { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n', 
377
Char STRhelpcommand[]	= { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n', 
373
			    'd', '\0' };
378
			    'd', '\0' };
374
Char STRfignore[]	= { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
379
Char STRfignore[]	= { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
Lines 430-437 Link Here
430
Char STRrm[]		= { 'r', 'm', '\0' };
435
Char STRrm[]		= { 'r', 'm', '\0' };
431
Char STRhighlight[]	= { 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't', '\0' };
436
Char STRhighlight[]	= { 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't', '\0' };
432
437
433
Char STRimplicitcd[] = { 'i', 'm', 'p', 'l', 'i', 'c', 'i', 't',
438
Char STRimplicitcd[]	= { 'i', 'm', 'p', 'l', 'i', 'c', 'i', 't',
434
                         'c', 'd', '\0' };
439
			    'c', 'd', '\0' };
440
Char STRcdtohome[]	= { 'c', 'd', 't', 'o', 'h', 'o', 'm', 'e', '\0' };
435
Char STRkillring[] 	= { 'k', 'i', 'l', 'l', 'r', 'i', 'n', 'g', '\0' };
441
Char STRkillring[] 	= { 'k', 'i', 'l', 'l', 'r', 'i', 'n', 'g', '\0' };
436
Char STRkilldup[] 	= { 'k', 'i', 'l', 'l', 'd', 'u', 'p', '\0' };
442
Char STRkilldup[] 	= { 'k', 'i', 'l', 'l', 'd', 'u', 'p', '\0' };
437
Char STRshlvl[]		= { 's', 'h', 'l', 'v', 'l', '\0' };
443
Char STRshlvl[]		= { 's', 'h', 'l', 'v', 'l', '\0' };
Lines 450-461 Link Here
450
			    'R', 'Y', '\0' };
456
			    'R', 'Y', '\0' };
451
Char STRNOREBIND[] 	= { 'N', 'O', 'R', 'E', 'B', 'I', 'N', 'D', '\0' };
457
Char STRNOREBIND[] 	= { 'N', 'O', 'R', 'E', 'B', 'I', 'N', 'D', '\0' };
452
458
453
#if defined(SIG_WINDOW) || defined (_VMS_POSIX)	 
459
#if defined(SIG_WINDOW) || defined(SIGWINCH) || defined(SIGWINDOW) || defined (_VMS_POSIX) || defined(_SIGWINCH)
454
/* atp - problem with declaration of str{lines,columns} in sh.func.c (1277) */
460
/* atp - problem with declaration of str{lines,columns} in sh.func.c (1277) */
455
Char STRLINES[]		= { 'L', 'I', 'N', 'E', 'S', '\0'};
461
Char STRLINES[]		= { 'L', 'I', 'N', 'E', 'S', '\0'};
456
Char STRCOLUMNS[]	= { 'C', 'O', 'L', 'U', 'M', 'N', 'S', '\0'};
462
Char STRCOLUMNS[]	= { 'C', 'O', 'L', 'U', 'M', 'N', 'S', '\0'};
457
Char STRTERMCAP[]	= { 'T', 'E', 'R', 'M', 'C', 'A', 'P', '\0'};
463
Char STRTERMCAP[]	= { 'T', 'E', 'R', 'M', 'C', 'A', 'P', '\0'};
458
#endif /* SIG_WINDOW  || _VMS_POSIX */
464
#endif /* SIG_WINDOW  || SIGWINCH || SIGWINDOW || _VMS_POSIX */
459
465
460
#if defined (_OSD_POSIX)  /* BS2000 needs this variable set to "SHELL" */
466
#if defined (_OSD_POSIX)  /* BS2000 needs this variable set to "SHELL" */
461
Char STRPROGRAM_ENVIRONMENT[] = { 'P', 'R', 'O', 'G', 'R', 'A', 'M',
467
Char STRPROGRAM_ENVIRONMENT[] = { 'P', 'R', 'O', 'G', 'R', 'A', 'M',
Lines 491-496 Link Here
491
Char STRmmcolormauto[]	= { '-', '-', 'c', 'o', 'l', 'o', 'r', '=', 'a', 'u', 't', 'o', '\0' };
497
Char STRmmcolormauto[]	= { '-', '-', 'c', 'o', 'l', 'o', 'r', '=', 'a', 'u', 't', 'o', '\0' };
492
#endif /* BSD_STYLE_COLORLS */
498
#endif /* BSD_STYLE_COLORLS */
493
Char STRLS_COLORS[]	= { 'L', 'S', '_', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
499
Char STRLS_COLORS[]	= { 'L', 'S', '_', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
500
Char STRLSCOLORS[]	= { 'L', 'S', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
494
#endif /* COLOR_LS_F */
501
#endif /* COLOR_LS_F */
495
502
496
Char STRls[]		= { 'l', 's', '\0' };
503
Char STRls[]		= { 'l', 's', '\0' };
(-)contrib/tcsh/tc.decls.h (-5 / +5 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.decls.h,v 3.65 2010/02/09 20:26:13 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.decls.h,v 3.66 2012/06/21 18:49:11 christos Exp $ */
2
/*
2
/*
3
 * tc.decls.h: Function declarations from all the tcsh modules
3
 * tc.decls.h: Function declarations from all the tcsh modules
4
 */
4
 */
Lines 226-240 Link Here
226
#ifndef __GNUC__
226
#ifndef __GNUC__
227
#define __attribute__(a)
227
#define __attribute__(a)
228
#endif
228
#endif
229
extern	pret_t		  xprintf	(const char *, ...)
229
extern	int		  xprintf	(const char *, ...)
230
    __attribute__((__format__(__printf__, 1, 2)));
230
    __attribute__((__format__(__printf__, 1, 2)));
231
extern	pret_t		  xsnprintf	(char *, size_t, const char *, ...)
231
extern	int		  xsnprintf	(char *, size_t, const char *, ...)
232
    __attribute__((__format__(__printf__, 3, 4)));
232
    __attribute__((__format__(__printf__, 3, 4)));
233
extern	char		 *xasprintf	(const char *, ...)
233
extern	char		 *xasprintf	(const char *, ...)
234
    __attribute__((__format__(__printf__, 1, 2)));
234
    __attribute__((__format__(__printf__, 1, 2)));
235
extern	pret_t		  xvprintf	(const char *, va_list)
235
extern	int		  xvprintf	(const char *, va_list)
236
    __attribute__((__format__(__printf__, 1, 0)));
236
    __attribute__((__format__(__printf__, 1, 0)));
237
extern	pret_t		  xvsnprintf	(char *, size_t, const char *, va_list)
237
extern	int		  xvsnprintf	(char *, size_t, const char *, va_list)
238
    __attribute__((__format__(__printf__, 3, 0)));
238
    __attribute__((__format__(__printf__, 3, 0)));
239
extern	char		 *xvasprintf	(const char *, va_list)
239
extern	char		 *xvasprintf	(const char *, va_list)
240
    __attribute__((__format__(__printf__, 1, 0)));
240
    __attribute__((__format__(__printf__, 1, 0)));
(-)contrib/tcsh/tc.func.c (-43 / +72 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.func.c,v 3.148 2011/12/14 16:36:44 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.func.c,v 3.158 2016/05/13 15:08:12 christos Exp $ */
2
/*
2
/*
3
 * tc.func.c: New tcsh builtins.
3
 * tc.func.c: New tcsh builtins.
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.func.c,v 3.148 2011/12/14 16:36:44 christos Exp $")
35
RCSID("$tcsh: tc.func.c,v 3.158 2016/05/13 15:08:12 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "ed.defns.h"		/* for the function names */
38
#include "ed.defns.h"		/* for the function names */
Lines 120-130 Link Here
120
		if ((*s & QUOTE)
120
		if ((*s & QUOTE)
121
		    && (((*s & TRIM) == HIST && HIST != '\0') ||
121
		    && (((*s & TRIM) == HIST && HIST != '\0') ||
122
			(((*s & TRIM) == '\'') && (prev_c != '\\')) ||
122
			(((*s & TRIM) == '\'') && (prev_c != '\\')) ||
123
			(((*s & TRIM) == '\"') && (prev_c != '\\')) ||
123
			(((*s & TRIM) == '\"') && (prev_c != '\\')))) {
124
			(((*s & TRIM) == '\\') && (prev_c != '\\')))) {
125
		    Strbuf_append1(&buf, '\\');
124
		    Strbuf_append1(&buf, '\\');
126
		}
125
		}
126
#if INVALID_BYTE != 0
127
		if ((*s & INVALID_BYTE) != INVALID_BYTE) /* *s < INVALID_BYTE */
128
		    Strbuf_append1(&buf, *s & TRIM);
129
		else
130
		    Strbuf_append1(&buf, *s);
131
#else
127
		Strbuf_append1(&buf, *s & TRIM);
132
		Strbuf_append1(&buf, *s & TRIM);
133
#endif
128
		prev_c = *s;
134
		prev_c = *s;
129
	    }
135
	    }
130
	    Strbuf_append1(&buf, ' ');
136
	    Strbuf_append1(&buf, ' ');
Lines 193-199 Link Here
193
dolist(Char **v, struct command *c)
199
dolist(Char **v, struct command *c)
194
{
200
{
195
    Char **globbed;
201
    Char **globbed;
196
    int     i, k;
202
    int     i, k, ret = 0;
197
    struct stat st;
203
    struct stat st;
198
204
199
    USE(c);
205
    USE(c);
Lines 333-340 Link Here
333
			xputchar('\n');
339
			xputchar('\n');
334
		    print_by_column(STRNULL, &v[i], k - i, FALSE);
340
		    print_by_column(STRNULL, &v[i], k - i, FALSE);
335
		}
341
		}
342
		haderr = 1;
336
		xprintf("%S: %s.\n", tmp, strerror(err));
343
		xprintf("%S: %s.\n", tmp, strerror(err));
344
		haderr = 0;
337
		i = k + 1;
345
		i = k + 1;
346
		ret = 1;
338
	    }
347
	    }
339
	    else if (S_ISDIR(st.st_mode)) {
348
	    else if (S_ISDIR(st.st_mode)) {
340
		Char   *cp;
349
		Char   *cp;
Lines 372-377 Link Here
372
		xputchar('\n');
381
		xputchar('\n');
373
	    print_by_column(STRNULL, &v[i], k - i, FALSE);
382
	    print_by_column(STRNULL, &v[i], k - i, FALSE);
374
	}
383
	}
384
	if (ret)
385
	    stderror(ERR_SILENT);
375
    }
386
    }
376
387
377
    cleanup_until(globbed);
388
    cleanup_until(globbed);
Lines 481-486 Link Here
481
	setcopy(STRstatus, STR1, VAR_READWRITE);
492
	setcopy(STRstatus, STR1, VAR_READWRITE);
482
}
493
}
483
494
495
static int
496
findvv(Char **vv, const char *cp)
497
{
498
    for (; vv && *vv; vv++) {
499
	size_t i;
500
	for (i = 0; (*vv)[i] && (*vv)[i] == cp[i]; i++)
501
	    continue;
502
	if ((*vv)[i] == '\0' && cp[i] == '\0')
503
	    return 1;
504
    }
505
    return 0;
506
}
507
484
/* PWP: a hack to start up your stopped editor on a single keystroke */
508
/* PWP: a hack to start up your stopped editor on a single keystroke */
485
/* jbs - fixed hack so it worked :-) 3/28/89 */
509
/* jbs - fixed hack so it worked :-) 3/28/89 */
486
510
Lines 488-520 Link Here
488
find_stop_ed(void)
512
find_stop_ed(void)
489
{
513
{
490
    struct process *pp, *retp;
514
    struct process *pp, *retp;
491
    const char *ep, *vp;
515
    const char *ep = NULL, *vp = NULL;
492
    char *cp, *p;
516
    char *cp, *p;
493
    size_t epl, vpl;
517
    size_t epl = 0, vpl = 0;
494
    int pstatus;
518
    int pstatus;
519
    struct varent *varp;
520
    Char **vv;
495
521
496
    if ((ep = getenv("EDITOR")) != NULL) {	/* if we have a value */
522
    if (pcurrent == NULL)	/* see if we have any jobs */
497
	if ((p = strrchr(ep, '/')) != NULL) 	/* if it has a path */
523
	return NULL;		/* nope */
498
	    ep = p + 1;		/* then we want only the last part */
499
    }
500
    else 
501
	ep = "ed";
502
524
503
    if ((vp = getenv("VISUAL")) != NULL) {	/* if we have a value */
525
    if ((varp = adrof(STReditors)) != NULL)
504
	if ((p = strrchr(vp, '/')) != NULL) 	/* and it has a path */
526
	vv = varp->vec;
505
	    vp = p + 1;		/* then we want only the last part */
527
    else
506
    }
528
	vv = NULL;
507
    else 
508
	vp = "vi";
509
529
510
    for (vpl = 0; vp[vpl] && !isspace((unsigned char)vp[vpl]); vpl++)
530
    if (! vv) {
511
	continue;
531
	if ((ep = getenv("EDITOR")) != NULL) {	/* if we have a value */
512
    for (epl = 0; ep[epl] && !isspace((unsigned char)ep[epl]); epl++)
532
	    if ((p = strrchr(ep, '/')) != NULL) 	/* if it has a path */
513
	continue;
533
		ep = p + 1;		/* then we want only the last part */
534
	}
535
	else
536
	    ep = "ed";
514
537
515
    if (pcurrent == NULL)	/* see if we have any jobs */
538
	if ((vp = getenv("VISUAL")) != NULL) {	/* if we have a value */
516
	return NULL;		/* nope */
539
	    if ((p = strrchr(vp, '/')) != NULL) 	/* and it has a path */
540
		vp = p + 1;		/* then we want only the last part */
541
	}
542
	else
543
	    vp = "vi";
517
544
545
	for (vpl = 0; vp[vpl] && !isspace((unsigned char)vp[vpl]); vpl++)
546
	    continue;
547
	for (epl = 0; ep[epl] && !isspace((unsigned char)ep[epl]); epl++)
548
	    continue;
549
    }
550
518
    retp = NULL;
551
    retp = NULL;
519
    for (pp = proclist.p_next; pp; pp = pp->p_next)
552
    for (pp = proclist.p_next; pp; pp = pp->p_next)
520
	if (pp->p_procid == pp->p_jobid) {
553
	if (pp->p_procid == pp->p_jobid) {
Lines 540-549 Link Here
540
	    else
573
	    else
541
		cp = p;			/* else we get all of it */
574
		cp = p;			/* else we get all of it */
542
575
543
	    /* if we find either in the current name, fg it */
576
	    /*
544
	    if (strncmp(ep, cp, epl) == 0 ||
577
	     * If we find the current name in the $editors array (if set)
545
		strncmp(vp, cp, vpl) == 0) {
578
	     * or as $EDITOR or $VISUAL (if $editors not set), fg it.
546
579
	     */
580
	    if ((vv && findvv(vv, cp)) ||
581
	        (epl && strncmp(ep, cp, epl) == 0 && cp[epl] == '\0') ||
582
		(vpl && strncmp(vp, cp, vpl) == 0 && cp[vpl] == '\0')) {
547
		/*
583
		/*
548
		 * If there is a choice, then choose the current process if
584
		 * If there is a choice, then choose the current process if
549
		 * available, or the previous process otherwise, or else
585
		 * available, or the previous process otherwise, or else
Lines 733-739 Link Here
733
	pp = xgetpass("Password:");
769
	pp = xgetpass("Password:");
734
770
735
	crpp = XCRYPT(pw, pp, srpp);
771
	crpp = XCRYPT(pw, pp, srpp);
736
	if ((strcmp(crpp, srpp) == 0)
772
	if ((crpp && strcmp(crpp, srpp) == 0)
737
#ifdef AFS
773
#ifdef AFS
738
	    || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
774
	    || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
739
					   afsname,     /* name */
775
					   afsname,     /* name */
Lines 1108-1115 Link Here
1108
    Char   *tag;
1144
    Char   *tag;
1109
#endif /* RMDEBUG */
1145
#endif /* RMDEBUG */
1110
    Char   *charac;
1146
    Char   *charac;
1111
    char    c;
1147
    int     ask, doit, star = 0, silent = 0, opintr_disabled;
1112
    int     ask, doit, star = 0, silent = 0;
1113
1148
1114
    if (!adrof(STRrmstar))
1149
    if (!adrof(STRrmstar))
1115
	return;
1150
	return;
Lines 1119-1124 Link Here
1119
    we = cp->next;
1154
    we = cp->next;
1120
    while (*we->word == ';' && we != cp)
1155
    while (*we->word == ';' && we != cp)
1121
	we = we->next;
1156
	we = we->next;
1157
    opintr_disabled = pintr_disabled;
1158
    pintr_disabled = 0;
1122
    while (we != cp) {
1159
    while (we != cp) {
1123
#ifdef RMDEBUG
1160
#ifdef RMDEBUG
1124
	if (*tag)
1161
	if (*tag)
Lines 1139-1155 Link Here
1139
		    if (!Strcmp(args->word, STRstar))
1176
		    if (!Strcmp(args->word, STRstar))
1140
			star = 1;
1177
			star = 1;
1141
		if (ask && star) {
1178
		if (ask && star) {
1142
		    xprintf("%s", CGETS(22, 8,
1179
		    doit = getYN(CGETS(22, 8,
1143
			    "Do you really want to delete all files? [n/y] "));
1180
			"Do you really want to delete all files? [N/y] "));
1144
		    flush();
1145
		    (void) force_read(SHIN, &c, 1);
1146
		    /* 
1147
		     * Perhaps we should use the yesexpr from the
1148
		     * actual locale
1149
		     */
1150
		    doit = (strchr(CGETS(22, 14, "Yy"), c) != NULL);
1151
		    while (c != '\n' && force_read(SHIN, &c, 1) == 1)
1152
			continue;
1153
		    if (!doit) {
1181
		    if (!doit) {
1154
			/* remove the command instead */
1182
			/* remove the command instead */
1155
#ifdef RMDEBUG
1183
#ifdef RMDEBUG
Lines 1195-1200 Link Here
1195
	    xprintf("%S ", we->word);
1223
	    xprintf("%S ", we->word);
1196
    }
1224
    }
1197
#endif /* RMDEBUG */
1225
#endif /* RMDEBUG */
1226
    pintr_disabled = opintr_disabled;
1198
    return;
1227
    return;
1199
}
1228
}
1200
1229
(-)contrib/tcsh/tc.nls.c (-15 / +35 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.nls.c,v 3.23 2010/02/12 22:17:20 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.nls.c,v 3.27 2016/07/17 15:02:44 christos Exp $ */
2
/*
2
/*
3
 * tc.nls.c: NLS handling
3
 * tc.nls.c: NLS handling
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.nls.c,v 3.23 2010/02/12 22:17:20 christos Exp $")
35
RCSID("$tcsh: tc.nls.c,v 3.27 2016/07/17 15:02:44 christos Exp $")
36
36
37
37
38
#ifdef WIDE_STRINGS
38
#ifdef WIDE_STRINGS
Lines 64-70 Link Here
64
{
64
{
65
# ifdef HAVE_WCWIDTH
65
# ifdef HAVE_WCWIDTH
66
    int l;
66
    int l;
67
#if INVALID_BYTE != 0
68
    if ((c & INVALID_BYTE) == INVALID_BYTE)	/* c >= INVALID_BYTE */
69
#else
67
    if (c & INVALID_BYTE)
70
    if (c & INVALID_BYTE)
71
#endif
68
	return 1;
72
	return 1;
69
    l = xwcwidth((wchar_t) c);
73
    l = xwcwidth((wchar_t) c);
70
    return l >= 0 ? l : 0;
74
    return l >= 0 ? l : 0;
Lines 116-129 Link Here
116
}
120
}
117
121
118
int
122
int
119
NLSClassify(Char c, int nocomb)
123
NLSClassify(Char c, int nocomb, int drawPrompt)
120
{
124
{
121
    int w;
125
    int w;
122
    if (c & INVALID_BYTE)
126
#ifndef SHORT_STRINGS
127
    if ((c & 0x80) != 0)		/* c >= 0x80 */
123
	return NLSCLASS_ILLEGAL;
128
	return NLSCLASS_ILLEGAL;
124
    w = NLSWidth(c);
129
#endif
125
    if ((w > 0 && !(Iscntrl(c) && (c & CHAR) < 0x100)) || (Isprint(c) && !nocomb))
130
    if (!drawPrompt) {			/* draw command-line */
126
	return w;
131
#if INVALID_BYTE != 0
132
	if ((c & INVALID_BYTE) == INVALID_BYTE)		/* c >= INVALID_BYTE */
133
	    return NLSCLASS_ILLEGAL;
134
	if ((c & INVALID_BYTE) == QUOTE && (c & 0x80) == 0)	/* c >= QUOTE */
135
	    return 1;
136
	if (c >= 0x10000000)		/* U+10000000 = FC 90 80 80 80 80 */
137
	    return NLSCLASS_ILLEGAL5;
138
	if (c >= 0x1000000)		/*  U+1000000 = F9 80 80 80 80 */
139
	    return NLSCLASS_ILLEGAL4;
140
	if (c >= 0x100000)		/*   U+100000 = F4 80 80 80 */
141
	    return NLSCLASS_ILLEGAL3;
142
#endif
143
	if (c >= 0x10000)		/*    U+10000 = F0 90 80 80 */
144
	    return NLSCLASS_ILLEGAL2;
145
    }
127
    if (Iscntrl(c) && (c & CHAR) < 0x100) {
146
    if (Iscntrl(c) && (c & CHAR) < 0x100) {
128
	if (c == '\n')
147
	if (c == '\n')
129
	    return NLSCLASS_NL;
148
	    return NLSCLASS_NL;
Lines 131-143 Link Here
131
	    return NLSCLASS_TAB;
150
	    return NLSCLASS_TAB;
132
	return NLSCLASS_CTRL;
151
	return NLSCLASS_CTRL;
133
    }
152
    }
134
#ifdef WIDE_STRINGS
153
    w = NLSWidth(c);
135
    if (c >= 0x1000000)
154
    if (drawPrompt) {			/* draw prompt */
136
	return NLSCLASS_ILLEGAL4;
155
	if (w > 0)
137
    if (c >= 0x10000)
156
	    return w;
138
	return NLSCLASS_ILLEGAL3;
157
	if (w == 0)
139
#endif
158
	    return 1;
140
    if (c >= 0x100)
159
    }
141
	return NLSCLASS_ILLEGAL2;
160
    if ((w > 0 && !(Iscntrl(c) && (c & CHAR) < 0x100)) || (Isprint(c) && !nocomb))
161
	return w;
142
    return NLSCLASS_ILLEGAL;
162
    return NLSCLASS_ILLEGAL;
143
}
163
}
(-)contrib/tcsh/tc.nls.h (-2 / +3 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.nls.h,v 3.14 2011/02/25 23:57:21 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.nls.h,v 3.17 2015/06/06 21:19:08 christos Exp $ */
2
/*
2
/*
3
 * tc.nls.h: NLS support
3
 * tc.nls.h: NLS support
4
 *
4
 *
Lines 43-49 Link Here
43
#endif
43
#endif
44
44
45
extern Char *NLSChangeCase (const Char *, int);
45
extern Char *NLSChangeCase (const Char *, int);
46
extern int NLSClassify (Char, int);
46
extern int NLSClassify (Char, int, int);
47
47
48
#define NLSCLASS_CTRL		(-1)
48
#define NLSCLASS_CTRL		(-1)
49
#define NLSCLASS_TAB		(-2)
49
#define NLSCLASS_TAB		(-2)
Lines 52-57 Link Here
52
#define NLSCLASS_ILLEGAL2	(-5)
52
#define NLSCLASS_ILLEGAL2	(-5)
53
#define NLSCLASS_ILLEGAL3	(-6)
53
#define NLSCLASS_ILLEGAL3	(-6)
54
#define NLSCLASS_ILLEGAL4	(-7)
54
#define NLSCLASS_ILLEGAL4	(-7)
55
#define NLSCLASS_ILLEGAL5	(-8)
55
56
56
#define NLSCLASS_ILLEGAL_SIZE(x) (-(x) - (-(NLSCLASS_ILLEGAL) - 1))
57
#define NLSCLASS_ILLEGAL_SIZE(x) (-(x) - (-(NLSCLASS_ILLEGAL) - 1))
57
58
(-)contrib/tcsh/tc.os.c (-24 / +2 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.os.c,v 3.72 2011/01/25 13:58:19 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.os.c,v 3.73 2016/04/16 15:44:18 christos Exp $ */
2
/*
2
/*
3
 * tc.os.c: OS Dependent builtin functions
3
 * tc.os.c: OS Dependent builtin functions
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.os.c,v 3.72 2011/01/25 13:58:19 christos Exp $")
35
RCSID("$tcsh: tc.os.c,v 3.73 2016/04/16 15:44:18 christos Exp $")
36
36
37
#include "tw.h"
37
#include "tw.h"
38
#include "ed.h"
38
#include "ed.h"
Lines 1585-1612 Link Here
1585
}
1585
}
1586
#endif
1586
#endif
1587
1587
1588
#ifdef __ANDROID__
1589
#include <stdio.h>
1590
/* Android (<= 2.1?) has an incomplete ttyname implementation. */
1591
char *
1592
ttyname(int fd)
1593
{
1594
    char path[64];
1595
    ssize_t siz;
1596
    static char ttyname[32];
1597
1598
    if (!isatty(fd))
1599
	return NULL;
1600
1601
    (void)snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
1602
    siz = readlink(path, ttyname, sizeof(ttyname));
1603
    if (siz < 0 || siz == sizeof(ttyname))
1604
	return NULL;
1605
    ttyname[siz] = '\0';
1606
    return ttyname;
1607
}
1608
#endif /* __ANDROID__ */
1609
1610
#if defined(__CYGWIN__) && !defined(NO_CRYPT)
1588
#if defined(__CYGWIN__) && !defined(NO_CRYPT)
1611
#undef CHAR		/* Collides with Win32 API */
1589
#undef CHAR		/* Collides with Win32 API */
1612
#define WIN32_LEAN_AND_MEAN
1590
#define WIN32_LEAN_AND_MEAN
(-)contrib/tcsh/tc.printf.c (-45 / +73 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.printf.c,v 3.35 2006/03/02 18:46:45 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.printf.c,v 3.38 2015/06/06 21:19:08 christos Exp $ */
2
/*
2
/*
3
 * tc.printf.c: A public-domain, minimal printf/sprintf routine that prints
3
 * tc.printf.c: A public-domain, minimal printf/sprintf routine that prints
4
 *	       through the putchar() routine.  Feel free to use for
4
 *	       through the putchar() routine.  Feel free to use for
Lines 34-40 Link Here
34
 */
34
 */
35
#include "sh.h"
35
#include "sh.h"
36
36
37
RCSID("$tcsh: tc.printf.c,v 3.35 2006/03/02 18:46:45 christos Exp $")
37
RCSID("$tcsh: tc.printf.c,v 3.38 2015/06/06 21:19:08 christos Exp $")
38
38
39
#ifdef lint
39
#ifdef lint
40
#undef va_arg
40
#undef va_arg
Lines 46-54 Link Here
46
static char snil[] = "(nil)";
46
static char snil[] = "(nil)";
47
47
48
static	void	xaddchar	(int);
48
static	void	xaddchar	(int);
49
static	void	doprnt		(void (*) (int), const char *, va_list);
49
static	int	doprnt		(void (*) (int), const char *, va_list);
50
50
51
static void
51
static int
52
doprnt(void (*addchar) (int), const char *sfmt, va_list ap)
52
doprnt(void (*addchar) (int), const char *sfmt, va_list ap)
53
{
53
{
54
    char *bp;
54
    char *bp;
Lines 68-75 Link Here
68
    int fmt;
68
    int fmt;
69
    unsigned char pad = ' ';
69
    unsigned char pad = ' ';
70
    int     flush_left = 0, f_width = 0, prec = INF, hash = 0;
70
    int     flush_left = 0, f_width = 0, prec = INF, hash = 0;
71
    int	    do_long = 0, do_size_t = 0;
71
    int	    do_long = 0, do_size_t = 0, do_ptrdiff_t = 0;
72
    int     sign = 0;
72
    int     sign = 0, count = 0;
73
    int     attributes = 0;
73
    int     attributes = 0;
74
74
75
75
Lines 77-82 Link Here
77
    for (; *f; f++) {
77
    for (; *f; f++) {
78
	if (*f != '%') {	/* then just out the char */
78
	if (*f != '%') {	/* then just out the char */
79
	    (*addchar) (((unsigned char)*f) | attributes);
79
	    (*addchar) (((unsigned char)*f) | attributes);
80
	    count++;
80
	}
81
	}
81
	else {
82
	else {
82
	    f++;		/* skip the % */
83
	    f++;		/* skip the % */
Lines 131-136 Link Here
131
		do_size_t++;
132
		do_size_t++;
132
		f++;
133
		f++;
133
	    }
134
	    }
135
	    if (*f == 't') {	/* ptrdiff_t format */
136
		do_ptrdiff_t++;
137
		f++;
138
	    }
134
139
135
	    fmt = (unsigned char) *f;
140
	    fmt = (unsigned char) *f;
136
	    if (fmt != 'S' && fmt != 'Q' && isupper(fmt)) {
141
	    if (fmt != 'S' && fmt != 'Q' && isupper(fmt)) {
Lines 171-183 Link Here
171
		    *bp++ = '-';
176
		    *bp++ = '-';
172
		f_width = f_width - (int) (bp - buf);
177
		f_width = f_width - (int) (bp - buf);
173
		if (!flush_left)
178
		if (!flush_left)
174
		    while (f_width-- > 0) 
179
		    while (f_width-- > 0)  {
175
			(*addchar) (pad | attributes);
180
			(*addchar) (pad | attributes);
176
		for (bp--; bp >= buf; bp--) 
181
			count++;
182
		    }
183
		for (bp--; bp >= buf; bp--)  {
177
		    (*addchar) (((unsigned char) *bp) | attributes);
184
		    (*addchar) (((unsigned char) *bp) | attributes);
185
		    count++;
186
		}
178
		if (flush_left)
187
		if (flush_left)
179
		    while (f_width-- > 0)
188
		    while (f_width-- > 0) {
180
			(*addchar) (' ' | attributes);
189
			(*addchar) (' ' | attributes);
190
			count++;
191
		    }
181
		break;
192
		break;
182
193
183
	    case 'p':
194
	    case 'p':
Lines 192-197 Link Here
192
		case 0:
203
		case 0:
193
		    if (do_size_t)
204
		    if (do_size_t)
194
			u = va_arg(ap, size_t);
205
			u = va_arg(ap, size_t);
206
		    else if (do_ptrdiff_t)
207
			u = va_arg(ap, ptrdiff_t);
195
		    else
208
		    else
196
			u = va_arg(ap, unsigned int);
209
			u = va_arg(ap, unsigned int);
197
		    break;
210
		    break;
Lines 234-246 Link Here
234
		}
247
		}
235
		i = f_width - (int) (bp - buf);
248
		i = f_width - (int) (bp - buf);
236
		if (!flush_left)
249
		if (!flush_left)
237
		    while (i-- > 0)
250
		    while (i-- > 0) {
238
			(*addchar) (pad | attributes);
251
			(*addchar) (pad | attributes);
252
			count++;
253
		    }
239
		for (bp--; bp >= buf; bp--)
254
		for (bp--; bp >= buf; bp--)
240
		    (*addchar) (((unsigned char) *bp) | attributes);
255
		    (*addchar) (((unsigned char) *bp) | attributes);
241
		if (flush_left)
256
		if (flush_left)
242
		    while (i-- > 0)
257
		    while (i-- > 0) {
243
			(*addchar) (' ' | attributes);
258
			(*addchar) (' ' | attributes);
259
			count++;
260
		    }
244
		break;
261
		break;
245
262
246
263
Lines 247-252 Link Here
247
	    case 'c':
264
	    case 'c':
248
		i = va_arg(ap, int);
265
		i = va_arg(ap, int);
249
		(*addchar) (i | attributes);
266
		(*addchar) (i | attributes);
267
		count++;
250
		break;
268
		break;
251
269
252
	    case 'S':
270
	    case 'S':
Lines 259-281 Link Here
259
	        }
277
	        }
260
		f_width = f_width - Strlen(Bp);
278
		f_width = f_width - Strlen(Bp);
261
		if (!flush_left)
279
		if (!flush_left)
262
		    while (f_width-- > 0)
280
		    while (f_width-- > 0) {
263
			(*addchar) ((int) (pad | attributes));
281
			(*addchar) ((int) (pad | attributes));
282
			count++;
283
		    }
264
		for (i = 0; *Bp && i < prec; i++) {
284
		for (i = 0; *Bp && i < prec; i++) {
265
		    char cbuf[MB_LEN_MAX];
285
		    char cbuf[MB_LEN_MAX];
266
		    size_t pos, len;
286
		    size_t pos, len;
267
287
268
		    if (fmt == 'Q' && *Bp & QUOTE)
288
		    if (fmt == 'Q' && *Bp & QUOTE) {
269
			(*addchar) ('\\' | attributes);
289
			(*addchar) ('\\' | attributes);
270
		    len = one_wctomb(cbuf, *Bp & CHAR);
290
			count++;
271
		    for (pos = 0; pos < len; pos++)
291
		    }
292
		    len = one_wctomb(cbuf, *Bp);
293
		    for (pos = 0; pos < len; pos++) {
272
			(*addchar) ((unsigned char)cbuf[pos] | attributes
294
			(*addchar) ((unsigned char)cbuf[pos] | attributes
273
				    | (*Bp & ATTRIBUTES));
295
				    | (*Bp & ATTRIBUTES));
296
			count++;
297
		    }
274
		    Bp++;
298
		    Bp++;
275
		}
299
		}
276
		if (flush_left)
300
		if (flush_left)
277
		    while (f_width-- > 0)
301
		    while (f_width-- > 0) {
278
			(*addchar) (' ' | attributes);
302
			(*addchar) (' ' | attributes);
303
			count++;
304
		    }
279
		break;
305
		break;
280
#endif /* SHORT_STRINGS */
306
#endif /* SHORT_STRINGS */
281
307
Lines 287-303 Link Here
287
		    bp = snil;
313
		    bp = snil;
288
		f_width = f_width - strlen(bp);
314
		f_width = f_width - strlen(bp);
289
		if (!flush_left)
315
		if (!flush_left)
290
		    while (f_width-- > 0)
316
		    while (f_width-- > 0) {
291
			(*addchar) (pad | attributes);
317
			(*addchar) (pad | attributes);
318
			count++;
319
		    }
292
		for (i = 0; *bp && i < prec; i++) {
320
		for (i = 0; *bp && i < prec; i++) {
293
		    if (fmt == 'q' && *bp & QUOTE)
321
		    if (fmt == 'q' && *bp & QUOTE) {
294
			(*addchar) ('\\' | attributes);
322
			(*addchar) ('\\' | attributes);
323
			count++;
324
		    }
295
		    (*addchar) (((unsigned char) *bp & TRIM) | attributes);
325
		    (*addchar) (((unsigned char) *bp & TRIM) | attributes);
326
		    count++;
296
		    bp++;
327
		    bp++;
297
		}
328
		}
298
		if (flush_left)
329
		if (flush_left)
299
		    while (f_width-- > 0)
330
		    while (f_width-- > 0) {
300
			(*addchar) (' ' | attributes);
331
			(*addchar) (' ' | attributes);
332
			count++;
333
		    }
301
		break;
334
		break;
302
335
303
	    case 'a':
336
	    case 'a':
Lines 306-311 Link Here
306
339
307
	    case '%':
340
	    case '%':
308
		(*addchar) ('%' | attributes);
341
		(*addchar) ('%' | attributes);
342
		count++;
309
		break;
343
		break;
310
344
311
	    default:
345
	    default:
Lines 312-322 Link Here
312
		break;
346
		break;
313
	    }
347
	    }
314
	    flush_left = 0, f_width = 0, prec = INF, hash = 0;
348
	    flush_left = 0, f_width = 0, prec = INF, hash = 0;
315
	    do_size_t = 0, do_long = 0;
349
	    do_ptrdiff_t = 0, do_size_t = 0, do_long = 0;
316
	    sign = 0;
350
	    sign = 0;
317
	    pad = ' ';
351
	    pad = ' ';
318
	}
352
	}
319
    }
353
    }
354
    return count;
320
}
355
}
321
356
322
357
Lines 331-386 Link Here
331
}
366
}
332
367
333
368
334
pret_t
369
int
335
/*VARARGS*/
370
/*VARARGS*/
336
xsnprintf(char *str, size_t size, const char *fmt, ...)
371
xsnprintf(char *str, size_t size, const char *fmt, ...)
337
{
372
{
373
    int count;
338
    va_list va;
374
    va_list va;
339
    va_start(va, fmt);
375
    va_start(va, fmt);
340
376
341
    xstring = str;
377
    xstring = str;
342
    xestring = str + size - 1;
378
    xestring = str + size - 1;
343
    doprnt(xaddchar, fmt, va);
379
    count = doprnt(xaddchar, fmt, va);
344
    va_end(va);
380
    va_end(va);
345
    *xstring++ = '\0';
381
    *xstring++ = '\0';
346
#ifdef PURIFY
382
    return count;
347
    return 1;
348
#endif
349
}
383
}
350
384
351
pret_t
385
int
352
/*VARARGS*/
386
/*VARARGS*/
353
xprintf(const char *fmt, ...)
387
xprintf(const char *fmt, ...)
354
{
388
{
389
    int count;
355
    va_list va;
390
    va_list va;
356
    va_start(va, fmt);
391
    va_start(va, fmt);
357
    doprnt(xputchar, fmt, va);
392
    count = doprnt(xputchar, fmt, va);
358
    va_end(va);
393
    va_end(va);
359
#ifdef PURIFY
394
    return count;
360
    return 1;
361
#endif
362
}
395
}
363
396
364
397
int
365
pret_t
366
xvprintf(const char *fmt, va_list va)
398
xvprintf(const char *fmt, va_list va)
367
{
399
{
368
    doprnt(xputchar, fmt, va);
400
    return doprnt(xputchar, fmt, va);
369
#ifdef PURIFY
370
    return 1;
371
#endif
372
}
401
}
373
402
374
pret_t
403
int
375
xvsnprintf(char *str, size_t size, const char *fmt, va_list va)
404
xvsnprintf(char *str, size_t size, const char *fmt, va_list va)
376
{
405
{
406
    int count;
377
    xstring = str;
407
    xstring = str;
378
    xestring = str + size - 1;
408
    xestring = str + size - 1;
379
    doprnt(xaddchar, fmt, va);
409
    count = doprnt(xaddchar, fmt, va);
380
    *xstring++ = '\0';
410
    *xstring++ = '\0';
381
#ifdef PURIFY
411
    return count;
382
    return 1;
383
#endif
384
}
412
}
385
413
386
char *
414
char *
Lines 435-452 Link Here
435
int 
463
int 
436
fprintf(FILE *fp, const char* fmt, ...)
464
fprintf(FILE *fp, const char* fmt, ...)
437
{
465
{
466
    int count;
438
    va_list va;
467
    va_list va;
439
    va_start(va, fmt);
468
    va_start(va, fmt);
440
    doprnt(xputchar, fmt, va);
469
    count = doprnt(xputchar, fmt, va);
441
    va_end(va);
470
    va_end(va);
442
    return 1;
471
    return count;
443
}
472
}
444
473
445
int 
474
int 
446
vfprintf(FILE *fp, const char *fmt, va_list va)
475
vfprintf(FILE *fp, const char *fmt, va_list va)
447
{
476
{
448
    doprnt(xputchar, fmt, va);
477
    return doprnt(xputchar, fmt, va);
449
    return 1;
450
}
478
}
451
479
452
#endif	/* PURIFY */
480
#endif	/* PURIFY */
(-)contrib/tcsh/tc.prompt.c (-2 / +17 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.prompt.c,v 3.70 2011/10/27 22:41:06 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.prompt.c,v 3.71 2014/08/23 09:07:57 christos Exp $ */
2
/*
2
/*
3
 * tc.prompt.c: Prompt printing stuff
3
 * tc.prompt.c: Prompt printing stuff
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.prompt.c,v 3.70 2011/10/27 22:41:06 christos Exp $")
35
RCSID("$tcsh: tc.prompt.c,v 3.71 2014/08/23 09:07:57 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 213-219 Link Here
213
		}
213
		}
214
		break;
214
		break;
215
	    case '#':
215
	    case '#':
216
#ifdef __CYGWIN__
217
		/* Check for being member of the Administrators group */
218
		{
219
			gid_t grps[NGROUPS_MAX];
220
			int grp, gcnt;
221
222
			gcnt = getgroups(NGROUPS_MAX, grps);
223
# define DOMAIN_GROUP_RID_ADMINS 544
224
			for (grp = 0; grp < gcnt; ++grp)
225
				if (grps[grp] == DOMAIN_GROUP_RID_ADMINS)
226
					break;
227
			Scp = (grp < gcnt) ? PRCHROOT : PRCH;
228
		}
229
#else
216
		Scp = (uid == 0 || euid == 0) ? PRCHROOT : PRCH;
230
		Scp = (uid == 0 || euid == 0) ? PRCHROOT : PRCH;
231
#endif
217
		if (Scp != '\0')
232
		if (Scp != '\0')
218
		    Strbuf_append1(&buf, attributes | Scp);
233
		    Strbuf_append1(&buf, attributes | Scp);
219
		break;
234
		break;
(-)contrib/tcsh/tc.str.c (-11 / +29 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.str.c,v 3.42 2012/01/10 21:34:31 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.str.c,v 3.47 2015/06/06 21:19:08 christos Exp $ */
2
/*
2
/*
3
 * tc.str.c: Short string package
3
 * tc.str.c: Short string package
4
 * 	     This has been a lesson of how to write buggy code!
4
 * 	     This has been a lesson of how to write buggy code!
Lines 36-42 Link Here
36
#include <assert.h>
36
#include <assert.h>
37
#include <limits.h>
37
#include <limits.h>
38
38
39
RCSID("$tcsh: tc.str.c,v 3.42 2012/01/10 21:34:31 christos Exp $")
39
RCSID("$tcsh: tc.str.c,v 3.47 2015/06/06 21:19:08 christos Exp $")
40
40
41
#define MALLOC_INCR	128
41
#define MALLOC_INCR	128
42
#ifdef WIDE_STRINGS
42
#ifdef WIDE_STRINGS
Lines 66-75 Link Here
66
{
66
{
67
    int len;
67
    int len;
68
68
69
    if (wchar & INVALID_BYTE) {
69
#if INVALID_BYTE != 0
70
	s[0] = wchar & 0xFF;
70
    if ((wchar & INVALID_BYTE) == INVALID_BYTE) {    /* wchar >= INVALID_BYTE */
71
	/* invalid char
72
	 * exmaple)
73
	 * if wchar = f0000090(=90|INVALID_BYTE), then *s = ffffff90 */
74
	*s = (char)wchar;
71
	len = 1;
75
	len = 1;
76
#else
77
    if (wchar & (CHAR & INVALID_BYTE)) {
78
	s[0] = wchar & (CHAR & 0xFF);
79
	len = 1;
80
#endif
72
    } else {
81
    } else {
82
#if INVALID_BYTE != 0
83
	wchar &= MAX_UTF32;
84
#else
85
	wchar &= CHAR;
86
#endif
73
#ifdef UTF16_STRINGS
87
#ifdef UTF16_STRINGS
74
	if (wchar >= 0x10000) {
88
	if (wchar >= 0x10000) {
75
	    /* UTF-16 systems can't handle these values directly in calls to
89
	    /* UTF-16 systems can't handle these values directly in calls to
Lines 224-230 Link Here
224
    dst = sdst;
238
    dst = sdst;
225
    edst = &dst[dstsize];
239
    edst = &dst[dstsize];
226
    while (*src) {
240
    while (*src) {
227
	dst += one_wctomb(dst, *src & CHAR);
241
	dst += one_wctomb(dst, *src);
228
	src++;
242
	src++;
229
	if (dst >= edst) {
243
	if (dst >= edst) {
230
	    char *wdst = dst;
244
	    char *wdst = dst;
Lines 544-550 Link Here
544
		dst = &edst[-MALLOC_INCR];
558
		dst = &edst[-MALLOC_INCR];
545
	    }
559
	    }
546
	}
560
	}
547
	dst += one_wctomb(dst, *src & CHAR);
561
	dst += one_wctomb(dst, *src);
548
	src++;
562
	src++;
549
	if (dst >= edst) {
563
	if (dst >= edst) {
550
	    ptrdiff_t i = dst - edst;
564
	    ptrdiff_t i = dst - edst;
Lines 559-565 Link Here
559
}
573
}
560
574
561
struct blk_buf *
575
struct blk_buf *
562
bb_alloc()
576
bb_alloc(void)
563
{
577
{
564
    return xcalloc(1, sizeof(struct blk_buf));
578
    return xcalloc(1, sizeof(struct blk_buf));
565
}
579
}
Lines 590-599 Link Here
590
    struct blk_buf *bb;
604
    struct blk_buf *bb;
591
    size_t i;
605
    size_t i;
592
606
593
    bb = xbb;
607
    bb = (struct blk_buf *)xbb;
594
    for (i = 0; i < bb->len; i++)
608
    if (bb->vec) {
595
	xfree(bb->vec[i]);
609
	for (i = 0; i < bb->len; i++)
596
    xfree(bb->vec);
610
	    xfree(bb->vec[i]);
611
	xfree(bb->vec);
612
    }
613
    bb->vec = NULL;
614
    bb->len = 0;
597
}
615
}
598
616
599
void
617
void
(-)contrib/tcsh/tc.who.c (-2 / +4 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.who.c,v 3.57 2012/01/17 20:53:38 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tc.who.c,v 3.59 2012/11/15 02:55:08 christos Exp $ */
2
/*
2
/*
3
 * tc.who.c: Watch logins and logouts...
3
 * tc.who.c: Watch logins and logouts...
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tc.who.c,v 3.57 2012/01/17 20:53:38 christos Exp $")
35
RCSID("$tcsh: tc.who.c,v 3.59 2012/11/15 02:55:08 christos Exp $")
36
36
37
#include "tc.h"
37
#include "tc.h"
38
38
Lines 65-70 Link Here
65
#  define TCSH_PATH_UTMP "/var/run/utx.active"
65
#  define TCSH_PATH_UTMP "/var/run/utx.active"
66
# elif defined(__hpux)
66
# elif defined(__hpux)
67
#  define TCSH_PATH_UTMP "/etc/utmpx"
67
#  define TCSH_PATH_UTMP "/etc/utmpx"
68
# elif defined(IBMAIX) && defined(UTMP_FILE)
69
#  define TCSH_PATH_UTMP UTMP_FILE
68
# endif
70
# endif
69
# if defined(TCSH_PATH_UTMP) || !defined(HAVE_UTMP_H)
71
# if defined(TCSH_PATH_UTMP) || !defined(HAVE_UTMP_H)
70
#  define utmp utmpx
72
#  define utmp utmpx
(-)contrib/tcsh/tcsh.man (-85 / +223 lines)
Lines 1-3 Link Here
1
.\" $tcsh: tcsh.man,v 3.266 2016/11/24 15:04:52 christos Exp $
2
.\"
1
.\" Copyright (c) 1980, 1990, 1993
3
.\" Copyright (c) 1980, 1990, 1993
2
.\"	The Regents of the University of California.  All rights reserved.
4
.\"	The Regents of the University of California.  All rights reserved.
3
.\"
5
.\"
Lines 42-47 Link Here
42
.\" 
44
.\" 
43
.\" - Use `', not '' or "", except of course in shell syntax examples.
45
.\" - Use `', not '' or "", except of course in shell syntax examples.
44
.\"   '' at the beginning of a line will vanish!
46
.\"   '' at the beginning of a line will vanish!
47
.\"
48
.\" - Use \` for literal back-quote (`).
49
.\"
50
.\" - Use \e for literal backslash (\).
45
.\" 
51
.\" 
46
.\" - Use \-, not -.
52
.\" - Use \-, not -.
47
.\" 
53
.\" 
Lines 72-78 Link Here
72
.\"   used here if you can. In particular, please don't use nroff commands
78
.\"   used here if you can. In particular, please don't use nroff commands
73
.\"   which aren't already used herein.
79
.\"   which aren't already used herein.
74
.\" 
80
.\" 
75
.TH TCSH 1 "14 February 2012" "Astron 6.18.01"
81
.TH TCSH 1 "24 November 2016" "Astron 6.20.00"
76
.SH NAME
82
.SH NAME
77
tcsh \- C shell with file name completion and command line editing
83
tcsh \- C shell with file name completion and command line editing
78
.SH SYNOPSIS
84
.SH SYNOPSIS
Lines 160-166 Link Here
160
Command input is taken from the standard input.
166
Command input is taken from the standard input.
161
.TP 4
167
.TP 4
162
.B \-t
168
.B \-t
163
The shell reads and executes a single line of input.  A `\\' may be used to
169
The shell reads and executes a single line of input.  A `\e' may be used to
164
escape the newline at the end of this line and continue onto another line.
170
escape the newline at the end of this line and continue onto another line.
165
.TP 4
171
.TP 4
166
.B \-v
172
.B \-v
Lines 201-207 Link Here
201
It then executes commands from files in the user's \fBhome\fR directory:
207
It then executes commands from files in the user's \fBhome\fR directory:
202
first \fI~/.tcshrc\fR (+)
208
first \fI~/.tcshrc\fR (+)
203
or, if \fI~/.tcshrc\fR is not found, \fI~/.cshrc\fR,
209
or, if \fI~/.tcshrc\fR is not found, \fI~/.cshrc\fR,
204
then \fI~/.history\fR (or the value of the \fBhistfile\fR shell variable),
210
then the contents of \fI~/.history\fR (or the value of the \fBhistfile\fR shell variable) are loaded into memory,
205
then \fI~/.login\fR,
211
then \fI~/.login\fR,
206
and finally \fI~/.cshdirs\fR (or the value of the \fBdirsfile\fR shell variable) (+).
212
and finally \fI~/.cshdirs\fR (or the value of the \fBdirsfile\fR shell variable) (+).
207
The shell may read \fI/etc/csh.login\fR before instead of after
213
The shell may read \fI/etc/csh.login\fR before instead of after
Lines 251-263 Link Here
251
the editor commands specific to the shell and their default bindings.
257
the editor commands specific to the shell and their default bindings.
252
.SS "The command-line editor (+)"
258
.SS "The command-line editor (+)"
253
Command-line input can be edited using key sequences much like those used in
259
Command-line input can be edited using key sequences much like those used in
254
GNU Emacs or \fIvi\fR(1).
260
\fIemacs\fR(1) or \fIvi\fR(1).
255
The editor is active only when the \fBedit\fR shell variable is set, which
261
The editor is active only when the \fBedit\fR shell variable is set, which
256
it is by default in interactive shells.
262
it is by default in interactive shells.
257
The \fIbindkey\fR builtin can display and change key bindings.
263
The \fIbindkey\fR builtin can display and change key bindings.
258
Emacs-style key bindings are used by default
264
\fIemacs\fR(1)\-style key bindings are used by default
259
(unless the shell was compiled otherwise; see the \fBversion\fR shell variable),
265
(unless the shell was compiled otherwise; see the \fBversion\fR shell variable),
260
but \fIbindkey\fR can change the key bindings to \fIvi\fR-style bindings en masse.
266
but \fIbindkey\fR can change the key bindings to \fIvi\fR(1)\-style bindings en masse.
261
.PP
267
.PP
262
The shell always binds the arrow keys (as defined in the \fBTERMCAP\fR
268
The shell always binds the arrow keys (as defined in the \fBTERMCAP\fR
263
environment variable) to
269
environment variable) to
Lines 284-293 Link Here
284
to prevent these bindings.
290
to prevent these bindings.
285
The ANSI/VT100 sequences for arrow keys are always bound.
291
The ANSI/VT100 sequences for arrow keys are always bound.
286
.PP
292
.PP
287
Other key bindings are, for the most part, what Emacs and \fIvi\fR(1)
293
Other key bindings are, for the most part, what \fIemacs\fR(1) and \fIvi\fR(1)
288
users would expect and can easily be displayed by \fIbindkey\fR, so there
294
users would expect and can easily be displayed by \fIbindkey\fR, so there
289
is no need to list them here.  Likewise, \fIbindkey\fR can list the editor
295
is no need to list them here.  Likewise, \fIbindkey\fR can list the editor
290
commands with a short description of each.
296
commands with a short description of each.
297
Certain key bindings have different behavior depending if \fIemacs\fR(1) or \fIvi\fR(1)
298
style bindings are being used; see \fBvimode\fR for more information.
291
.PP
299
.PP
292
Note that editor commands do not have the same notion of a ``word'' as does the
300
Note that editor commands do not have the same notion of a ``word'' as does the
293
shell.  The editor delimits words with any non-alphanumeric characters not in
301
shell.  The editor delimits words with any non-alphanumeric characters not in
Lines 408-414 Link Here
408
.br
416
.br
409
condiments.h    main.c~
417
condiments.h    main.c~
410
.br
418
.br
411
> set fignore = (.o \\~)
419
> set fignore = (.o \e~)
412
.br
420
.br
413
> emacs ma[^D]
421
> emacs ma[^D]
414
.br
422
.br
Lines 420-426 Link Here
420
.PP
428
.PP
421
`main.c~' and `main.o' are ignored by completion (but not listing),
429
`main.c~' and `main.o' are ignored by completion (but not listing),
422
because they end in suffixes in \fBfignore\fR.
430
because they end in suffixes in \fBfignore\fR.
423
Note that a `\\' was needed in front of `~' to prevent it from being
431
Note that a `\e' was needed in front of `~' to prevent it from being
424
expanded to \fBhome\fR as described under \fBFilename substitution\fR.
432
expanded to \fBhome\fR as described under \fBFilename substitution\fR.
425
\fBfignore\fR is ignored if only one completion is possible.
433
\fBfignore\fR is ignored if only one completion is possible.
426
.PP
434
.PP
Lines 534-543 Link Here
534
Like completion, spelling correction works anywhere in the line,
542
Like completion, spelling correction works anywhere in the line,
535
pushing the rest of the line to the right and possibly leaving
543
pushing the rest of the line to the right and possibly leaving
536
extra characters to the right of the cursor.
544
extra characters to the right of the cursor.
537
.PP
538
Beware: spelling correction is not guaranteed to work the way one intends,
539
and is provided mostly as an experimental feature.
540
Suggestions and improvements are welcome.
541
.SS "Editor commands (+)"
545
.SS "Editor commands (+)"
542
`bindkey' lists key bindings and `bindkey \-l' lists and briefly describes
546
`bindkey' lists key bindings and `bindkey \-l' lists and briefly describes
543
editor commands.
547
editor commands.
Lines 552-557 Link Here
552
to letters by default are bound to both lower- and uppercase letters for
556
to letters by default are bound to both lower- and uppercase letters for
553
convenience.
557
convenience.
554
.TP 8
558
.TP 8
559
.B backward-char \fR(^B, left)
560
Move back a character.
561
Cursor behavior modified by \fBvimode\fR.
562
.TP 8
563
.B backward-delete-word \fR(M-^H, M-^?)
564
Cut from beginning of current word to cursor \- saved in cut buffer.
565
Word boundary behavior modified by \fBvimode\fR.
566
.TP 8
567
.B backward-word \fR(M-b, M-B)
568
Move to beginning of current word.
569
Word boundary and cursor behavior modified by \fBvimode\fR.
570
.TP 8
571
.B beginning-of-line \fR(^A, home)
572
Move to beginning of line.
573
Cursor behavior modified by \fBvimode\fR.
574
.TP 8
575
.B capitalize-word \fR(M-c, M-C)
576
Capitalize the characters from cursor to end of current word.
577
Word boundary behavior modified by \fBvimode\fR.
578
.TP 8
555
.B complete-word \fR(tab)
579
.B complete-word \fR(tab)
556
Completes a word as described under \fBCompletion and listing\fR.
580
Completes a word as described under \fBCompletion and listing\fR.
557
.TP 8
581
.TP 8
Lines 569-574 Link Here
569
.B copy-prev-word \fR(M-^_)
593
.B copy-prev-word \fR(M-^_)
570
Copies the previous word in the current line into the input buffer.
594
Copies the previous word in the current line into the input buffer.
571
See also \fIinsert-last-word\fR.
595
See also \fIinsert-last-word\fR.
596
Word boundary behavior modified by \fBvimode\fR.
572
.TP 8
597
.TP 8
573
.B dabbrev-expand \fR(M-/)
598
.B dabbrev-expand \fR(M-/)
574
Expands the current word to the most recent preceding one for which
599
Expands the current word to the most recent preceding one for which
Lines 581-591 Link Here
581
.B delete-char \fR(not bound)
606
.B delete-char \fR(not bound)
582
Deletes the character under the cursor.
607
Deletes the character under the cursor.
583
See also \fIdelete-char-or-list-or-eof\fR.
608
See also \fIdelete-char-or-list-or-eof\fR.
609
Cursor behavior modified by \fBvimode\fR.
584
.TP 8
610
.TP 8
585
.B delete-char-or-eof \fR(not bound)
611
.B delete-char-or-eof \fR(not bound)
586
Does \fIdelete-char\fR if there is a character under the cursor
612
Does \fIdelete-char\fR if there is a character under the cursor
587
or \fIend-of-file\fR on an empty line.
613
or \fIend-of-file\fR on an empty line.
588
See also \fIdelete-char-or-list-or-eof\fR.
614
See also \fIdelete-char-or-list-or-eof\fR.
615
Cursor behavior modified by \fBvimode\fR.
589
.TP 8
616
.TP 8
590
.B delete-char-or-list \fR(not bound)
617
.B delete-char-or-list \fR(not bound)
591
Does \fIdelete-char\fR if there is a character under the cursor
618
Does \fIdelete-char\fR if there is a character under the cursor
Lines 600-613 Link Here
600
\fIdelete-char-or-eof\fR, \fIdelete-char-or-list\fR and \fIlist-or-eof\fR,
627
\fIdelete-char-or-eof\fR, \fIdelete-char-or-list\fR and \fIlist-or-eof\fR,
601
each of which does a different two out of the three.
628
each of which does a different two out of the three.
602
.TP 8
629
.TP 8
630
.B delete-word \fR(M-d, M-D)
631
Cut from cursor to end of current word \- save in cut buffer.
632
Word boundary behavior modified by \fBvimode\fR.
633
.TP 8
603
.B down-history \fR(down-arrow, ^N)
634
.B down-history \fR(down-arrow, ^N)
604
Like \fIup-history\fR, but steps down, stopping at the original input line.
635
Like \fIup-history\fR, but steps down, stopping at the original input line.
605
.TP 8
636
.TP 8
637
.B downcase-word \fR(M-l, M-L)
638
Lowercase the characters from cursor to end of current word.
639
Word boundary behavior modified by \fBvimode\fR.
640
.TP 8
606
.B end-of-file \fR(not bound)
641
.B end-of-file \fR(not bound)
607
Signals an end of file, causing the shell to exit unless the \fBignoreeof\fR
642
Signals an end of file, causing the shell to exit unless the \fBignoreeof\fR
608
shell variable (q.v.) is set to prevent this.
643
shell variable (q.v.) is set to prevent this.
609
See also \fIdelete-char-or-list-or-eof\fR.
644
See also \fIdelete-char-or-list-or-eof\fR.
610
.TP 8
645
.TP 8
646
.B end-of-line \fR(^E, end)
647
Move cursor to end of line.
648
Cursor behavior modified by \fBvimode\fR.
649
.TP 8
611
.B expand-history \fR(M-space)
650
.B expand-history \fR(M-space)
612
Expands history substitutions in the current word.
651
Expands history substitutions in the current word.
613
See \fBHistory substitution\fR.
652
See \fBHistory substitution\fR.
Lines 626-631 Link Here
626
Expands the variable to the left of the cursor.
665
Expands the variable to the left of the cursor.
627
See \fBVariable substitution\fR.
666
See \fBVariable substitution\fR.
628
.TP 8
667
.TP 8
668
.B forward-char \fR(^F, right)
669
Move forward one character.
670
Cursor behavior modified by \fBvimode\fR.
671
.TP 8
672
.B forward-word \fR(M-f, M-F)
673
Move forward to end of current word.
674
Word boundary and cursor behavior modified by \fBvimode\fR.
675
.TP 8
629
.B history-search-backward \fR(M-p, M-P)
676
.B history-search-backward \fR(M-p, M-P)
630
Searches backwards through the history list for a command beginning with
677
Searches backwards through the history list for a command beginning with
631
the current contents of the input buffer up to the cursor and copies it
678
the current contents of the input buffer up to the cursor and copies it
Lines 674-685 Link Here
674
search, leaving the current line in the input buffer, and
721
search, leaving the current line in the input buffer, and
675
is then interpreted as normal input.  In particular, a carriage return
722
is then interpreted as normal input.  In particular, a carriage return
676
causes the current line to be executed.
723
causes the current line to be executed.
677
Emacs mode only.
678
See also \fIi-search-fwd\fR and \fIhistory-search-backward\fR.
724
See also \fIi-search-fwd\fR and \fIhistory-search-backward\fR.
725
Word boundary behavior modified by \fBvimode\fR.
679
.RE
726
.RE
680
.TP 8
727
.TP 8
681
.B i-search-fwd \fR(not bound)
728
.B i-search-fwd \fR(not bound)
682
Like \fIi-search-back\fR, but searches forward.
729
Like \fIi-search-back\fR, but searches forward.
730
Word boundary behavior modified by \fBvimode\fR.
683
.TP 8
731
.TP 8
684
.B insert-last-word \fR(M-_)
732
.B insert-last-word \fR(M-_)
685
Inserts the last word of the previous input line (`!$') into the input buffer.
733
Inserts the last word of the previous input line (`!$') into the input buffer.
Lines 722-730 Link Here
722
.TP 8
770
.TP 8
723
.B run-fg-editor \fR(M-^Z)
771
.B run-fg-editor \fR(M-^Z)
724
Saves the current input line and
772
Saves the current input line and
725
looks for a stopped job with a name equal to the last component of the
773
looks for a stopped job where the file name portion of its first word
726
file name part of the \fBEDITOR\fR or \fBVISUAL\fR environment variables,
774
is found in the \fBeditors\fR shell variable.
727
or, if neither is set, `ed' or `vi'.
775
If \fBeditors\fR is not set, then the file name portion of the
776
\fBEDITOR\fR environment variable (`ed' if unset)
777
and the
778
\fBVISUAL\fR environment variable (`vi' if unset)
779
will be used.
728
If such a job is found, it is restarted as if `fg %\fIjob\fR' had been
780
If such a job is found, it is restarted as if `fg %\fIjob\fR' had been
729
typed.  This is used to toggle back and forth between an editor and
781
typed.  This is used to toggle back and forth between an editor and
730
the shell easily.  Some people bind this command to `^Z' so they
782
the shell easily.  Some people bind this command to `^Z' so they
Lines 760-766 Link Here
760
.B spell-line \fR(M-$)
812
.B spell-line \fR(M-$)
761
Attempts to correct the spelling of each word in the input buffer, like
813
Attempts to correct the spelling of each word in the input buffer, like
762
\fIspell-word\fR, but ignores words whose first character is one of
814
\fIspell-word\fR, but ignores words whose first character is one of
763
`\-', `!', `^' or `%', or which contain `\\', `*' or `?', to avoid problems
815
`\-', `!', `^' or `%', or which contain `\e', `*' or `?', to avoid problems
764
with switches, substitutions and the like.
816
with switches, substitutions and the like.
765
See \fBSpelling correction\fR.
817
See \fBSpelling correction\fR.
766
.TP 8
818
.TP 8
Lines 781-786 Link Here
781
If \fBhistlit\fR is set, uses the literal form of the entry.
833
If \fBhistlit\fR is set, uses the literal form of the entry.
782
May be repeated to step up through the history list, stopping at the top.
834
May be repeated to step up through the history list, stopping at the top.
783
.TP 8
835
.TP 8
836
.B upcase-word \fR(M-u, M-U)
837
Uppercase the characters from cursor to end of current word.
838
Word boundary behavior modified by \fBvimode\fR.
839
.TP 8
840
.B vi-beginning-of-next-word \fR(not bound)
841
Vi goto the beginning of next word.
842
Word boundary and cursor behavior modified by \fBvimode\fR.
843
.TP 8
844
.B vi-eword \fR(not bound)
845
Vi move to the end of the current word.
846
Word boundary behavior modified by \fBvimode\fR.
847
.TP 8
784
.B vi-search-back \fR(?)
848
.B vi-search-back \fR(?)
785
Prompts with `?' for a search string (which may be a glob-pattern, as with
849
Prompts with `?' for a search string (which may be a glob-pattern, as with
786
\fIhistory-search-backward\fR), searches for it and copies it into the
850
\fIhistory-search-backward\fR), searches for it and copies it into the
Lines 816-823 Link Here
816
.PP
880
.PP
817
A special character (including a blank or tab) may be prevented from having
881
A special character (including a blank or tab) may be prevented from having
818
its special meaning, and possibly made part of another word, by preceding it
882
its special meaning, and possibly made part of another word, by preceding it
819
with a backslash (`\\') or enclosing it in single (`''), double (`"') or
883
with a backslash (`\e') or enclosing it in single (`''), double (`"') or
820
backward (``') quotes.  When not otherwise quoted a newline preceded by a `\\'
884
backward (`\`') quotes.  When not otherwise quoted a newline preceded by a `\e'
821
is equivalent to a blank, but inside quotes this sequence results in a
885
is equivalent to a blank, but inside quotes this sequence results in a
822
newline.
886
newline.
823
.PP
887
.PP
Lines 824-831 Link Here
824
Furthermore, all \fBSubstitutions\fR (see below) except \fBHistory substitution\fR
888
Furthermore, all \fBSubstitutions\fR (see below) except \fBHistory substitution\fR
825
can be prevented by enclosing the strings (or parts of strings)
889
can be prevented by enclosing the strings (or parts of strings)
826
in which they appear with single quotes or by quoting the crucial character(s)
890
in which they appear with single quotes or by quoting the crucial character(s)
827
(e.g., `$' or ``' for \fBVariable substitution\fR or \fBCommand substitution\fR respectively)
891
(e.g., `$' or `\`' for \fBVariable substitution\fR or \fBCommand substitution\fR respectively)
828
with `\\'.  (\fBAlias substitution\fR is no exception: quoting in any way any
892
with `\e'.  (\fBAlias substitution\fR is no exception: quoting in any way any
829
character of a word for which an \fIalias\fR has been defined prevents
893
character of a word for which an \fIalias\fR has been defined prevents
830
substitution of the alias.  The usual way of quoting an alias is to precede it
894
substitution of the alias.  The usual way of quoting an alias is to precede it
831
with a backslash.) \fBHistory substitution\fR is prevented by
895
with a backslash.) \fBHistory substitution\fR is prevented by
Lines 847-853 Link Here
847
to do so if appropriate.
911
to do so if appropriate.
848
.PP
912
.PP
849
The \fBbackslash_quote\fR shell variable (q.v.) can be set to make backslashes
913
The \fBbackslash_quote\fR shell variable (q.v.) can be set to make backslashes
850
always quote `\\', `'', and `"'.  (+) This may make complex quoting tasks
914
always quote `\e', `'', and `"'.  (+) This may make complex quoting tasks
851
easier, but it can cause syntax errors in \fIcsh\fR(1) scripts.
915
easier, but it can cause syntax errors in \fIcsh\fR(1) scripts.
852
.SS Substitutions
916
.SS Substitutions
853
We now describe the various transformations the shell performs on the input in
917
We now describe the various transformations the shell performs on the input in
Lines 880-886 Link Here
880
command with little typing and a high degree of confidence.
944
command with little typing and a high degree of confidence.
881
.PP
945
.PP
882
History substitutions begin with the character `!'.  They may begin anywhere in
946
History substitutions begin with the character `!'.  They may begin anywhere in
883
the input stream, but they do not nest.  The `!' may be preceded by a `\\' to
947
the input stream, but they do not nest.  The `!' may be preceded by a `\e' to
884
prevent its special meaning; for convenience, a `!' is passed unchanged when it
948
prevent its special meaning; for convenience, a `!' is passed unchanged when it
885
is followed by a blank, tab, newline, `=' or `('.  History substitutions also
949
is followed by a blank, tab, newline, `=' or `('.  History substitutions also
886
occur when an input line begins with `^'.  This special abbreviation will be
950
occur when an input line begins with `^'.  This special abbreviation will be
Lines 1046-1053 Link Here
1046
\fIl\fR is simply a string like \fIr\fR, not a regular expression as in
1110
\fIl\fR is simply a string like \fIr\fR, not a regular expression as in
1047
the eponymous \fIed\fR(1) command.
1111
the eponymous \fIed\fR(1) command.
1048
Any character may be used as the delimiter in place of `/';
1112
Any character may be used as the delimiter in place of `/';
1049
a `\\' can be used to quote the delimiter inside \fIl\fR and \fIr\fR.
1113
a `\e' can be used to quote the delimiter inside \fIl\fR and \fIr\fR.
1050
The character `&' in the \fIr\fR is replaced by \fIl\fR; `\\' also quotes `&'.
1114
The character `&' in the \fIr\fR is replaced by \fIl\fR; `\e' also quotes `&'.
1051
If \fIl\fR is empty (``''), the \fIl\fR from a previous substitution or the
1115
If \fIl\fR is empty (``''), the \fIl\fR from a previous substitution or the
1052
\fIs\fR from a previous search or event number in event specification is used.
1116
\fIs\fR from a previous search or event number in event specification is used.
1053
The trailing delimiter may be omitted if it is immediately followed by a newline.
1117
The trailing delimiter may be omitted if it is immediately followed by a newline.
Lines 1187-1193 Link Here
1187
executed, variable substitution is performed keyed by `$' characters.  This
1251
executed, variable substitution is performed keyed by `$' characters.  This
1188
expansion can be prevented by preceding the `$' with a `\e' except within `"'s
1252
expansion can be prevented by preceding the `$' with a `\e' except within `"'s
1189
where it \fIalways\fR occurs, and within `''s where it \fInever\fR occurs.
1253
where it \fIalways\fR occurs, and within `''s where it \fInever\fR occurs.
1190
Strings quoted by ``' are interpreted later (see \fBCommand substitution\fR
1254
Strings quoted by `\`' are interpreted later (see \fBCommand substitution\fR
1191
below) so `$' substitution does not occur there until later,
1255
below) so `$' substitution does not occur there until later,
1192
if at all.  A `$' is passed unchanged if followed by a blank, tab, or
1256
if at all.  A `$' is passed unchanged if followed by a blank, tab, or
1193
end-of-line.
1257
end-of-line.
Lines 1316-1322 Link Here
1316
occurs very late, after input-output redirection is performed, and in a child
1380
occurs very late, after input-output redirection is performed, and in a child
1317
of the main shell.
1381
of the main shell.
1318
.SS "Command substitution"
1382
.SS "Command substitution"
1319
Command substitution is indicated by a command enclosed in ``'.  The output
1383
Command substitution is indicated by a command enclosed in `\`'.  The output
1320
from such a command is broken into separate words at blanks, tabs and newlines,
1384
from such a command is broken into separate words at blanks, tabs and newlines,
1321
and null words are discarded.  The output is variable and command substituted
1385
and null words are discarded.  The output is variable and command substituted
1322
and put in place of the original string.
1386
and put in place of the original string.
Lines 1401-1407 Link Here
1401
a file glob pattern that matches any string of characters including `/',
1465
a file glob pattern that matches any string of characters including `/',
1402
recursively traversing any existing sub-directories.  For example, 
1466
recursively traversing any existing sub-directories.  For example, 
1403
`ls **.c' will list all the .c files in the current directory tree.
1467
`ls **.c' will list all the .c files in the current directory tree.
1404
If used by itself, it will match match zero or more sub-directories
1468
If used by itself, it will match zero or more sub-directories
1405
(e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
1469
(e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
1406
in the /usr/include directory tree; `ls /usr/include/**time.h' will match 
1470
in the /usr/include directory tree; `ls /usr/include/**time.h' will match 
1407
any file in the /usr/include directory tree ending in `time.h'; and
1471
any file in the /usr/include directory tree ending in `time.h'; and
Lines 1549-1557 Link Here
1549
Read the shell input up to a line which is identical to \fIword\fR.  \fIword\fR
1613
Read the shell input up to a line which is identical to \fIword\fR.  \fIword\fR
1550
is not subjected to variable, filename or command substitution, and each input
1614
is not subjected to variable, filename or command substitution, and each input
1551
line is compared to \fIword\fR before any substitutions are done on this input
1615
line is compared to \fIword\fR before any substitutions are done on this input
1552
line.  Unless a quoting `\e', `"', `' or ``' appears in \fIword\fR variable and
1616
line.  Unless a quoting `\e', `"', `' or `\`' appears in \fIword\fR variable and
1553
command substitution is performed on the intervening lines, allowing `\e' to
1617
command substitution is performed on the intervening lines, allowing `\e' to
1554
quote `$', `\e' and ``'.  Commands which are substituted have all blanks, tabs,
1618
quote `$', `\e' and `\`'.  Commands which are substituted have all blanks, tabs,
1555
and newlines preserved, except for the final newline which is dropped.  The
1619
and newlines preserved, except for the final newline which is dropped.  The
1556
resultant text is placed in an anonymous temporary file which is given to the
1620
resultant text is placed in an anonymous temporary file which is given to the
1557
command as standard input.
1621
command as standard input.
Lines 1573-1578 Link Here
1573
character special file (e.g., a terminal or `/dev/null') or an error results.
1637
character special file (e.g., a terminal or `/dev/null') or an error results.
1574
This helps prevent accidental destruction of files.  In this case the `!' forms
1638
This helps prevent accidental destruction of files.  In this case the `!' forms
1575
can be used to suppress this check.
1639
can be used to suppress this check.
1640
If \fBnotempty\fR is given in \fBnoclobber\fR, `>' is allowed on empty files;
1641
if \fBask\fR is set, an interacive confirmation is presented, rather than an
1642
error.
1576
.PP
1643
.PP
1577
The forms involving `&' route the diagnostic output into the specified file as
1644
The forms involving `&' route the diagnostic output into the specified file as
1578
well as the standard output.  \fIname\fR is expanded in the same way as `<'
1645
well as the standard output.  \fIname\fR is expanded in the same way as `<'
Lines 1746-1752 Link Here
1746
see if it has the specified relationship to the real user.  If \fIfile\fR
1813
see if it has the specified relationship to the real user.  If \fIfile\fR
1747
does not exist or is inaccessible or, for the operators indicated by `*',
1814
does not exist or is inaccessible or, for the operators indicated by `*',
1748
if the specified file type does not exist on the current system,
1815
if the specified file type does not exist on the current system,
1749
then all enquiries return false, i.e., `0'.
1816
then all inquiries return false, i.e., `0'.
1750
.PP
1817
.PP
1751
These operators may be combined for conciseness: `\-\fIxy file\fR' is
1818
These operators may be combined for conciseness: `\-\fIxy file\fR' is
1752
equivalent to `\-\fIx file\fR && \-\fIy file\fR'.  (+) For example, `\-fx' is true
1819
equivalent to `\-\fIx file\fR && \-\fIy file\fR'.  (+) For example, `\-fx' is true
Lines 2174-2190 Link Here
2174
Lists all editor commands and a short description of each.
2241
Lists all editor commands and a short description of each.
2175
.TP 4
2242
.TP 4
2176
.B \-d
2243
.B \-d
2177
Binds all keys to the standard bindings for the default editor.
2244
Binds all keys to the standard bindings for the default editor,
2245
as per \fB-e\fR and \fB-v\fR below.
2178
.TP 4
2246
.TP 4
2179
.B \-e
2247
.B \-e
2180
Binds all keys to the standard GNU Emacs-like bindings.
2248
Binds all keys to \fIemacs\fR(1)\-style bindings.
2249
Unsets \fBvimode\fR.
2181
.TP 4
2250
.TP 4
2182
.B \-v
2251
.B \-v
2183
Binds all keys to the standard \fIvi\fR(1)-like bindings.
2252
Binds all keys to \fIvi\fR(1)\-style bindings.
2253
Sets \fBvimode\fR.
2184
.TP 4
2254
.TP 4
2185
.B \-a
2255
.B \-a
2186
Lists or changes key-bindings in the alternative key map.
2256
Lists or changes key-bindings in the alternative key map.
2187
This is the key map used in \fIvi\fR command mode.
2257
This is the key map used in \fBvimode\fR command mode.
2188
.TP 4
2258
.TP 4
2189
.B \-b
2259
.B \-b
2190
\fIkey\fR is interpreted as
2260
\fIkey\fR is interpreted as
Lines 2262-2268 Link Here
2262
.RE
2332
.RE
2263
.PP
2333
.PP
2264
`\e' nullifies the special meaning of the following character, if it has
2334
`\e' nullifies the special meaning of the following character, if it has
2265
any, notably `\\' and `^'.
2335
any, notably `\e' and `^'.
2266
.RE
2336
.RE
2267
.TP 8
2337
.TP 8
2268
.B bs2cmd \fIbs2000-command\fR (+)
2338
.B bs2cmd \fIbs2000-command\fR (+)
Lines 2293-2299 Link Here
2293
.TP 8
2363
.TP 8
2294
.B cd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] [\I--\fR] [\fIname\fR]
2364
.B cd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] [\I--\fR] [\fIname\fR]
2295
If a directory \fIname\fR is given, changes the shell's working directory
2365
If a directory \fIname\fR is given, changes the shell's working directory
2296
to \fIname\fR.  If not, changes to \fBhome\fR.
2366
to \fIname\fR.  If not, changes to \fBhome\fR, unless the \fBcdtohome\fR
2367
variable is not set, in which case a \fIname\fR is required.
2297
If \fIname\fR is `\-' it is interpreted as the previous working directory
2368
If \fIname\fR is `\-' it is interpreted as the previous working directory
2298
(see \fBOther substitutions\fR).  (+)
2369
(see \fBOther substitutions\fR).  (+)
2299
If \fIname\fR is not a subdirectory of the current directory
2370
If \fIname\fR is not a subdirectory of the current directory
Lines 2300-2306 Link Here
2300
(and does not begin with `/', `./' or `../'), each component of the variable
2371
(and does not begin with `/', `./' or `../'), each component of the variable
2301
\fBcdpath\fR is checked to see if it has a subdirectory \fIname\fR.  Finally, if
2372
\fBcdpath\fR is checked to see if it has a subdirectory \fIname\fR.  Finally, if
2302
all else fails but \fIname\fR is a shell variable whose value
2373
all else fails but \fIname\fR is a shell variable whose value
2303
begins with `/', then this is tried to see if it is a directory.
2374
begins with `/' or '.', then this is tried to see if it is a directory, and
2375
the \fB\-p\fR option is implied.
2304
.RS +8
2376
.RS +8
2305
.PP
2377
.PP
2306
With \fB\-p\fR, prints the final directory stack, just like \fIdirs\fR.
2378
With \fB\-p\fR, prints the final directory stack, just like \fIdirs\fR.
Lines 2309-2315 Link Here
2309
Using \fB\-\-\fR forces a break from option processing so the next word
2381
Using \fB\-\-\fR forces a break from option processing so the next word
2310
is taken as the directory \fIname\fR even if it begins with '\-'. (+)
2382
is taken as the directory \fIname\fR even if it begins with '\-'. (+)
2311
.PP
2383
.PP
2312
See also the \fBimplicitcd\fR shell variable.
2384
See also the \fBimplicitcd\fR and \fBcdtohome\fR shell variables.
2313
.RE
2385
.RE
2314
.TP 8
2386
.TP 8
2315
.B chdir
2387
.B chdir
Lines 2428-2434 Link Here
2428
(...)
2500
(...)
2429
Words from the given list
2501
Words from the given list
2430
.TP 8
2502
.TP 8
2431
`...`
2503
\`...\`
2432
Words from the output of command
2504
Words from the output of command
2433
.PD
2505
.PD
2434
.RE
2506
.RE
Lines 2445-2451 Link Here
2445
case the fourth delimiter can also be omitted), a slash is appended to
2517
case the fourth delimiter can also be omitted), a slash is appended to
2446
directories and a space to other words.
2518
directories and a space to other words.
2447
.PP
2519
.PP
2448
\fIcommand\fR invoked from `...` version has additional environment
2520
\fIcommand\fR invoked from \`...\` version has additional environment
2449
variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
2521
variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
2450
contains (as its name indicates) contents of the current (already
2522
contains (as its name indicates) contents of the current (already
2451
typed in) command line. One can examine and use contents of the
2523
typed in) command line. One can examine and use contents of the
Lines 2526-2532 Link Here
2526
.PP
2598
.PP
2527
or from a command run at completion time:
2599
or from a command run at completion time:
2528
.IP "" 4
2600
.IP "" 4
2529
> complete kill 'p/*/`ps | awk \\{print\\ \\$1\\}`/'
2601
> complete kill 'p/*/\`ps | awk \e{print\e \e$1\e}\`/'
2530
.br
2602
.br
2531
> kill \-9 [^D]
2603
> kill \-9 [^D]
2532
.br
2604
.br
Lines 2587-2593 Link Here
2587
.PP
2659
.PP
2588
Finally, here's a complex example for inspiration:
2660
Finally, here's a complex example for inspiration:
2589
.IP "" 4
2661
.IP "" 4
2590
> complete find \\
2662
> complete find \e
2591
.br
2663
.br
2592
\&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
2664
\&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
2593
.br
2665
.br
Lines 2618-2625 Link Here
2618
.PP
2690
.PP
2619
Remember that programmed completions are ignored if the word being completed
2691
Remember that programmed completions are ignored if the word being completed
2620
is a tilde substitution (beginning with `~') or a variable (beginning with `$').
2692
is a tilde substitution (beginning with `~') or a variable (beginning with `$').
2621
\fIcomplete\fR is an experimental feature, and the syntax may change
2622
in future versions of the shell.
2623
See also the \fIuncomplete\fR builtin command.
2693
See also the \fIuncomplete\fR builtin command.
2624
.RE
2694
.RE
2625
.TP 8
2695
.TP 8
Lines 2684-2690 Link Here
2684
from a shell script less verbose on slow terminals, or limit command
2754
from a shell script less verbose on slow terminals, or limit command
2685
output to the number of lines on the screen:
2755
output to the number of lines on the screen:
2686
.IP "" 4
2756
.IP "" 4
2687
> set history=`echotc lines`
2757
> set history=\`echotc lines\`
2688
.br
2758
.br
2689
> @ history\-\-
2759
> @ history\-\-
2690
.PP
2760
.PP
Lines 2693-2701 Link Here
2693
capability string, as in the following example that places the date in
2763
capability string, as in the following example that places the date in
2694
the status line:
2764
the status line:
2695
.IP "" 4
2765
.IP "" 4
2696
> set tosl="`echotc ts 0`"
2766
> set tosl="\`echotc ts 0\`"
2697
.br
2767
.br
2698
> set frsl="`echotc fs`"
2768
> set frsl="\`echotc fs\`"
2699
.br
2769
.br
2700
> echo \-n "$tosl";date; echo \-n "$frsl"
2770
> echo \-n "$tosl";date; echo \-n "$frsl"
2701
.PP
2771
.PP
Lines 2814-2821 Link Here
2814
existing history file instead of replacing it (if there is one) and
2884
existing history file instead of replacing it (if there is one) and
2815
sorted by time stamp.  (+) Merging is intended for an environment like
2885
sorted by time stamp.  (+) Merging is intended for an environment like
2816
the X Window System
2886
the X Window System
2817
with several shells in simultaneous use.  Currently it succeeds
2887
with several shells in simultaneous use.  If the second word of \fBsavehist\fR
2818
only when the shells quit nicely one after another.
2888
is `merge' and the third word is set to `lock', the history file update
2889
will be serialized with other shell sessions that would possibly like
2890
to merge history at exactly the same time.
2819
.PP
2891
.PP
2820
With \fB\-L\fR, the shell appends \fIfilename\fR, which is presumably a
2892
With \fB\-L\fR, the shell appends \fIfilename\fR, which is presumably a
2821
history list saved by the \fB\-S\fR option or the \fBsavehist\fR mechanism,
2893
history list saved by the \fB\-S\fR option or the \fBsavehist\fR mechanism,
Lines 2958-2963 Link Here
2958
\fIdescriptors\fR or \fIopenfiles\fR
3030
\fIdescriptors\fR or \fIopenfiles\fR
2959
the maximum number of open files for this process
3031
the maximum number of open files for this process
2960
.TP
3032
.TP
3033
\fIpseudoterminals\fR
3034
the maximum number of pseudo-terminals for this user
3035
.TP
3036
\fIkqueues\fR
3037
the maximum number of kqueues allocated for this process
3038
.TP
2961
\fIconcurrency\fR
3039
\fIconcurrency\fR
2962
the maximum number of threads for this process
3040
the maximum number of threads for this process
2963
.TP
3041
.TP
Lines 2967-2972 Link Here
2967
\fImaxproc\fR
3045
\fImaxproc\fR
2968
the maximum number of simultaneous processes for this user id
3046
the maximum number of simultaneous processes for this user id
2969
.TP
3047
.TP
3048
\fImaxthread\fR
3049
the maximum number of simultaneous threads (lightweight processes) for this
3050
user id
3051
.TP
3052
\fIthreads\fR
3053
the maximum number of threads for this process
3054
.TP
2970
\fIsbsize\fR
3055
\fIsbsize\fR
2971
the maximum size of socket buffer usage for this user
3056
the maximum size of socket buffer usage for this user
2972
.TP
3057
.TP
Lines 2976-2981 Link Here
2976
\fImaxlocks\fR
3061
\fImaxlocks\fR
2977
the maximum number of locks for this user
3062
the maximum number of locks for this user
2978
.TP
3063
.TP
3064
\fIposixlocks\fR
3065
the maximum number of POSIX advisory locks for this user
3066
.TP
2979
\fImaxsignal\fR
3067
\fImaxsignal\fR
2980
the maximum number of pending signals for this user
3068
the maximum number of pending signals for this user
2981
.TP
3069
.TP
Lines 3212-3223 Link Here
3212
.PD
3300
.PD
3213
.RS +8
3301
.RS +8
3214
.IP "" 4
3302
.IP "" 4
3215
> sched 11:00 echo It\\'s eleven o\\'clock.
3303
> sched 11:00 echo It\e's eleven o\e'clock.
3216
.PP
3304
.PP
3217
causes the shell to echo `It's eleven o'clock.' at 11 AM.
3305
causes the shell to echo `It's eleven o'clock.' at 11 AM.
3218
The time may be in 12-hour AM/PM format
3306
The time may be in 12-hour AM/PM format
3219
.IP "" 4
3307
.IP "" 4
3220
> sched 5pm set prompt='[%h] It\\'s after 5; go home: >'
3308
.\" TODO
3309
> sched 5pm set prompt='[%h] It\e's after 5; go home: >'
3221
.PP
3310
.PP
3222
or may be relative to the current time:
3311
or may be relative to the current time:
3223
.IP "" 4
3312
.IP "" 4
Lines 3615-3621 Link Here
3615
shell variable to match (unless the shell variable is read-only) and vice
3704
shell variable to match (unless the shell variable is read-only) and vice
3616
versa.  Note that although \fBcwd\fR and \fBPWD\fR have identical meanings, they
3705
versa.  Note that although \fBcwd\fR and \fBPWD\fR have identical meanings, they
3617
are not synchronized in this manner, and that the shell automatically
3706
are not synchronized in this manner, and that the shell automatically
3618
interconverts the different formats of \fBpath\fR and \fBPATH\fR.
3707
converts between the different formats of \fBpath\fR and \fBPATH\fR.
3619
.TP 8
3708
.TP 8
3620
.B addsuffix \fR(+)
3709
.B addsuffix \fR(+)
3621
If set, filename completion adds `/' to the end of directories and a space
3710
If set, filename completion adds `/' to the end of directories and a space
Lines 3629-3634 Link Here
3629
.B ampm \fR(+)
3718
.B ampm \fR(+)
3630
If set, all times are shown in 12-hour AM/PM format.
3719
If set, all times are shown in 12-hour AM/PM format.
3631
.TP 8
3720
.TP 8
3721
.B anyerror \fR(+)
3722
This variable selects what is propagated to the value of the
3723
\fBstatus\fR variable. For more information see the description of the
3724
\fBstatus\fR variable below.
3725
.TP 8
3632
.B argv
3726
.B argv
3633
The arguments to the shell.  Positional parameters are taken from \fBargv\fR,
3727
The arguments to the shell.  Positional parameters are taken from \fBargv\fR,
3634
i.e., `$1' is replaced by `$argv[1]', etc.
3728
i.e., `$1' is replaced by `$argv[1]', etc.
Lines 3672-3678 Link Here
3672
cases.
3766
cases.
3673
.TP 8
3767
.TP 8
3674
.B backslash_quote \fR(+)
3768
.B backslash_quote \fR(+)
3675
If set, backslashes (`\\') always quote `\\', `'', and `"'.  This may make
3769
.\" TODO
3770
If set, backslashes (`\e') always quote `\e', `'', and `"'.  This may make
3676
complex quoting tasks easier, but it can cause syntax errors in \fIcsh\fR(1)
3771
complex quoting tasks easier, but it can cause syntax errors in \fIcsh\fR(1)
3677
scripts.
3772
scripts.
3678
.TP 8
3773
.TP 8
Lines 3685-3690 Link Here
3685
A list of directories in which \fIcd\fR should search for
3780
A list of directories in which \fIcd\fR should search for
3686
subdirectories if they aren't found in the current directory.
3781
subdirectories if they aren't found in the current directory.
3687
.TP 8
3782
.TP 8
3783
.B cdtohome \fR(+)
3784
If not set, \fIcd\fR requires a directory \fIname\fR, and will not go to the
3785
\fBhome\fR directory if it's omitted.
3786
This is set by default.
3787
.TP 8
3688
.B color
3788
.B color
3689
If set, it enables color display for the builtin \fBls\-F\fR and it passes
3789
If set, it enables color display for the builtin \fBls\-F\fR and it passes
3690
\fB\-\-color=auto\fR to \fBls\fR.  Alternatively, it can be set to only
3790
\fB\-\-color=auto\fR to \fBls\fR.  Alternatively, it can be set to only
Lines 3710-3716 Link Here
3710
separators.
3810
separators.
3711
If set to `Enhance', completion matches uppercase and underscore
3811
If set to `Enhance', completion matches uppercase and underscore
3712
characters explicitly and matches lowercase and hyphens in a
3812
characters explicitly and matches lowercase and hyphens in a
3713
case-insensivite manner; it will treat periods, hypens and underscores
3813
case-insensitive manner; it will treat periods, hyphens and underscores
3714
as word separators.
3814
as word separators.
3715
.TP 8
3815
.TP 8
3716
.B continue \fR(+)
3816
.B continue \fR(+)
Lines 3721-3727 Link Here
3721
Same as continue, but the shell will execute:
3821
Same as continue, but the shell will execute:
3722
.RS +8
3822
.RS +8
3723
.IP "" 4
3823
.IP "" 4
3724
echo `pwd` $argv > ~/.<cmd>_pause; %<cmd>
3824
echo \`pwd\` $argv > ~/.<cmd>_pause; %<cmd>
3725
.RE
3825
.RE
3726
.TP 8
3826
.TP 8
3727
.B correct \fR(+)
3827
.B correct \fR(+)
Lines 3831-3843 Link Here
3831
.PD 0
3931
.PD 0
3832
.TP 8
3932
.TP 8
3833
bsd
3933
bsd
3834
Don't echo a newline if the first argument is `\-n'.
3934
Don't echo a newline if the first argument is `\-n'; the default for \fIcsh\fR.
3835
.TP 8
3935
.TP 8
3836
sysv
3936
sysv
3837
Recognize backslashed escape sequences in echo strings.
3937
Recognize backslashed escape sequences in echo strings.
3838
.TP 8
3938
.TP 8
3839
both
3939
both
3840
Recognize both the `\-n' flag and backslashed escape sequences; the default.
3940
Recognize both the `\-n' flag and backslashed escape sequences; the default
3941
for \fItcsh\fR.
3841
.TP 8
3942
.TP 8
3842
none
3943
none
3843
Recognize neither.
3944
Recognize neither.
Lines 3852-3857 Link Here
3852
If set, the command-line editor is used.  Set by default in interactive
3953
If set, the command-line editor is used.  Set by default in interactive
3853
shells.
3954
shells.
3854
.TP 8
3955
.TP 8
3956
.B editors \fR(+)
3957
A list of command names for the \fIrun-fg-editor\fR editor command to match.
3958
If not set, the \fBEDITOR\fR (`ed' if unset) and \fBVISUAL\fR (`vi' if unset)
3959
environment variables will be used instead.
3960
.TP 8
3855
.B ellipsis \fR(+)
3961
.B ellipsis \fR(+)
3856
If set, the `%c'/`%.' and `%C' prompt sequences (see the \fBprompt\fR
3962
If set, the `%c'/`%.' and `%C' prompt sequences (see the \fBprompt\fR
3857
shell variable) indicate skipped directories with an ellipsis (`...')
3963
shell variable) indicate skipped directories with an ellipsis (`...')
Lines 3884-3890 Link Here
3884
If set, the `**' and `***' file glob patterns will match any string of 
3990
If set, the `**' and `***' file glob patterns will match any string of 
3885
characters including `/' traversing any existing sub-directories.  (e.g. 
3991
characters including `/' traversing any existing sub-directories.  (e.g. 
3886
`ls **.c' will list all the .c files in the current directory tree).
3992
`ls **.c' will list all the .c files in the current directory tree).
3887
If used by itself, it will match match zero or more sub-directories
3993
If used by itself, it will match zero or more sub-directories
3888
(e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
3994
(e.g. `ls /usr/include/**/time.h' will list any file named `time.h'
3889
in the /usr/include directory tree; whereas `ls /usr/include/**time.h'
3995
in the /usr/include directory tree; whereas `ls /usr/include/**time.h'
3890
will match any file in the /usr/include directory tree ending in `time.h').
3996
will match any file in the /usr/include directory tree ending in `time.h').
Lines 3937-3943 Link Here
3937
.B history
4043
.B history
3938
The first word indicates the number of history events to save.  The
4044
The first word indicates the number of history events to save.  The
3939
optional second word (+) indicates the format in which history is
4045
optional second word (+) indicates the format in which history is
3940
printed; if not given, `%h\\t%T\\t%R\\n' is used.  The format sequences
4046
printed; if not given, `%h\et%T\et%R\en' is used.  The format sequences
3941
are described below under \fBprompt\fR; note the variable meaning of
4047
are described below under \fBprompt\fR; note the variable meaning of
3942
`%R'.  Set to `100' by default.
4048
`%R'.  Set to `100' by default.
3943
.TP 8
4049
.TP 8
Lines 4278-4284 Link Here
4278
.TP 8
4384
.TP 8
4279
.B prompt2 \fR(+)
4385
.B prompt2 \fR(+)
4280
The string with which to prompt in \fIwhile\fR and \fIforeach\fR loops and
4386
The string with which to prompt in \fIwhile\fR and \fIforeach\fR loops and
4281
after lines ending in `\\'.
4387
after lines ending in `\e'.
4282
The same format sequences may be used as in \fBprompt\fR (q.v.);
4388
The same format sequences may be used as in \fBprompt\fR (q.v.);
4283
note the variable meaning of `%R'.
4389
note the variable meaning of `%R'.
4284
Set by default to `%R? ' in interactive shells.
4390
Set by default to `%R? ' in interactive shells.
Lines 4329-4342 Link Here
4329
.B savehist
4435
.B savehist
4330
If set, the shell does `history \-S' before exiting.
4436
If set, the shell does `history \-S' before exiting.
4331
If the first word is set to a number, at most that many lines are saved.
4437
If the first word is set to a number, at most that many lines are saved.
4332
(The number must be less than or equal to \fBhistory\fR.)
4438
(The number should be less than or equal to the number \fBhistory\fR entries;
4439
if it is set to greater than the number of \fBhistory\fR settings, only
4440
\fBhistory\fR entries will be saved)
4333
If the second word is set to `merge', the history list is merged with
4441
If the second word is set to `merge', the history list is merged with
4334
the existing history file instead of replacing it (if there is one) and
4442
the existing history file instead of replacing it (if there is one) and
4335
sorted by time stamp and the most recent events are retained.  (+)
4443
sorted by time stamp and the most recent events are retained.
4444
If the second word of \fBsavehist\fR is `merge' and the third word is set to
4445
`lock', the history file update will be serialized with other shell sessions
4446
that would possibly like to merge history at exactly the same time. (+)
4336
.TP 8
4447
.TP 8
4337
.B sched \fR(+)
4448
.B sched \fR(+)
4338
The format in which the \fIsched\fR builtin command prints scheduled events;
4449
The format in which the \fIsched\fR builtin command prints scheduled events;
4339
if not given, `%h\\t%T\\t%R\\n' is used.
4450
if not given, `%h\et%T\et%R\en' is used.
4340
The format sequences are described above under \fBprompt\fR;
4451
The format sequences are described above under \fBprompt\fR;
4341
note the variable meaning of `%R'.
4452
note the variable meaning of `%R'.
4342
.TP 8
4453
.TP 8
Lines 4353-4369 Link Here
4353
See also \fBloginsh\fR.
4464
See also \fBloginsh\fR.
4354
.TP 8
4465
.TP 8
4355
.B status
4466
.B status
4356
The status returned by the last command, unless the variable
4467
The exit status from the last command or backquote expansion, or any
4357
.B anyerror
4468
command in a pipeline is propagated to \fBstatus\fR.  (This is also the
4358
is set, and any error in a pipeline or a backquote expansion will be
4469
default \fBcsh\fR behavior.)
4359
propagated (this is the default
4470
This default does not match what POSIX mandates (to return the
4360
.B csh
4471
status of the last command only). To match the POSIX behavior, you need
4361
behavior, and the current
4472
to unset \fBanyerror\fR.
4362
.B tcsh
4473
.RS +8
4363
default). If it terminated
4474
.PP
4364
abnormally, then 0200 is added to the status.  Builtin commands
4475
If the \fBanyerror\fR variable is unset, the exit status of a pipeline
4365
which fail return exit status `1', all other builtin commands
4476
is determined only from the last command in the pipeline, and the exit
4366
return status `0'.
4477
status of a backquote expansion is \fInot\fR propagated to \fBstatus\fR.
4478
.PP
4479
If a command terminated abnormally, then 0200 is added to the status.
4480
Builtin commands which fail return exit status `1', all other builtin
4481
commands return status `0'.
4482
.RE
4367
.TP 8
4483
.TP 8
4368
.B symlinks \fR(+)
4484
.B symlinks \fR(+)
4369
Can be set to several different values to control symbolic link (`symlink')
4485
Can be set to several different values to control symbolic link (`symlink')
Lines 4624-4630 Link Here
4624
`.' is omitted from \fBpath\fR for security
4740
`.' is omitted from \fBpath\fR for security
4625
.TP 6
4741
.TP 6
4626
vi
4742
vi
4627
\fIvi\fR-style editing is the default rather than \fIemacs\fR
4743
\fIvi\fR(1)\-style editing is the default rather than \fIemacs\fR(1)\-style
4628
.TP 6
4744
.TP 6
4629
dtr
4745
dtr
4630
Login shells drop DTR when exiting
4746
Login shells drop DTR when exiting
Lines 4662-4667 Link Here
4662
in the local version.
4778
in the local version.
4663
.RE
4779
.RE
4664
.TP 8
4780
.TP 8
4781
.B vimode \fR(+)
4782
.RS +8
4783
If unset, various key bindings change behavior to be more \fBemacs\fR(1)\-style:
4784
word boundaries are determined by \fBwordchars\fR versus other characters.
4785
.PP
4786
If set, various key bindings change behavior to be more \fBvi\fR(1)\-style:
4787
word boundaries are determined by \fBwordchars\fR versus whitespace
4788
versus other characters;
4789
cursor behavior depends upon current vi mode (command, delete, insert, replace).
4790
.PP
4791
This variable is unset by \fIbindkey\fR \fB-e\fR and
4792
set by \fIbindkey\fR \fB-v\fR.
4793
.B vimode
4794
may be explicitly set or unset by the user after those \fIbindkey\fR
4795
operations if required.
4796
.RE
4797
.TP 8
4665
.B visiblebell \fR(+)
4798
.B visiblebell \fR(+)
4666
If set, a screen flash is used rather than the audible bell.
4799
If set, a screen flash is used rather than the audible bell.
4667
See also \fBnobeep\fR.
4800
See also \fBnobeep\fR.
Lines 4726-4732 Link Here
4726
.B wordchars \fR(+)
4859
.B wordchars \fR(+)
4727
A list of non-alphanumeric characters to be considered part of a word by the
4860
A list of non-alphanumeric characters to be considered part of a word by the
4728
\fIforward-word\fR, \fIbackward-word\fR etc., editor commands.
4861
\fIforward-word\fR, \fIbackward-word\fR etc., editor commands.
4729
If unset, `*?_\-.[]~=' is used.
4862
If unset, the default value is determined based on the state of \fBvimode\fR:
4863
if \fBvimode\fR is unset, `*?_\-.[]~=' is used as the default;
4864
if \fBvimode\fR is set, `_' is used as the default.
4730
.SH ENVIRONMENT
4865
.SH ENVIRONMENT
4731
.TP 8
4866
.TP 8
4732
.B AFSUSER \fR(+)
4867
.B AFSUSER \fR(+)
Lines 4741-4748 Link Here
4741
.TP 8
4876
.TP 8
4742
.B EDITOR
4877
.B EDITOR
4743
The pathname to a default editor.
4878
The pathname to a default editor.
4744
See also the \fBVISUAL\fR environment variable
4879
Used by the \fIrun-fg-editor\fR editor command if the
4745
and the \fIrun-fg-editor\fR editor command.
4880
the \fBeditors\fR shell variable is unset.
4881
See also the \fBVISUAL\fR environment variable.
4746
.TP 8
4882
.TP 8
4747
.B GROUP \fR(+)
4883
.B GROUP \fR(+)
4748
Equivalent to the \fBgroup\fR shell variable.
4884
Equivalent to the \fBgroup\fR shell variable.
Lines 4978-4985 Link Here
4978
.TP 8
5114
.TP 8
4979
.B VISUAL
5115
.B VISUAL
4980
The pathname to a default full-screen editor.
5116
The pathname to a default full-screen editor.
4981
See also the \fBEDITOR\fR environment variable
5117
Used by the \fIrun-fg-editor\fR editor command if the
4982
and the \fIrun-fg-editor\fR editor command.
5118
the \fBeditors\fR shell variable is unset.
5119
See also the \fBEDITOR\fR environment variable.
4983
.SH FILES
5120
.SH FILES
4984
.PD 0
5121
.PD 0
4985
.TP 16
5122
.TP 16
Lines 5047-5054 Link Here
5047
but experienced \fIcsh\fR(1) users will want to pay special attention to
5184
but experienced \fIcsh\fR(1) users will want to pay special attention to
5048
\fItcsh\fR's new features.
5185
\fItcsh\fR's new features.
5049
.PP
5186
.PP
5050
A command-line editor, which supports GNU Emacs or \fIvi\fR(1)-style
5187
A command-line editor, which supports \fIemacs\fR(1)\-style
5051
key bindings.  See \fBThe command-line editor\fR and \fBEditor commands\fR.
5188
or \fIvi\fR(1)\-style key bindings.
5189
See \fBThe command-line editor\fR and \fBEditor commands\fR.
5052
.PP
5190
.PP
5053
Programmable, interactive word completion and listing.
5191
Programmable, interactive word completion and listing.
5054
See \fBCompletion and listing\fR and the \fIcomplete\fR and \fIuncomplete\fR
5192
See \fBCompletion and listing\fR and the \fIcomplete\fR and \fIuncomplete\fR
Lines 5201-5207 Link Here
5201
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
5339
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
5202
termio(7), Introduction to the C Shell
5340
termio(7), Introduction to the C Shell
5203
.SH VERSION
5341
.SH VERSION
5204
This manual documents tcsh 6.18.01 (Astron) 2012-02-14.
5342
This manual documents tcsh 6.20.00 (Astron) 2016-11-24.
5205
.SH AUTHORS
5343
.SH AUTHORS
5206
.PD 0
5344
.PD 0
5207
.TP 2
5345
.TP 2
(-)contrib/tcsh/tw.color.c (-54 / +196 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.color.c,v 1.27 2010/08/19 05:52:19 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.color.c,v 1.33 2015/05/28 11:53:49 christos Exp $ */
2
/*
2
/*
3
 * tw.color.c: builtin color ls-F
3
 * tw.color.c: builtin color ls-F
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tw.color.c,v 1.27 2010/08/19 05:52:19 christos Exp $")
35
RCSID("$tcsh: tw.color.c,v 1.33 2015/05/28 11:53:49 christos Exp $")
36
36
37
#include "tw.h"
37
#include "tw.h"
38
#include "ed.h"
38
#include "ed.h"
Lines 91-103 Link Here
91
    VAR(NOS, "ca", "30;41"),    /* File with capability */
91
    VAR(NOS, "ca", "30;41"),    /* File with capability */
92
};
92
};
93
93
94
#define nvariables (sizeof(variables)/sizeof(variables[0]))
95
94
enum FileType {
96
enum FileType {
95
    VDir, VSym, VOrph, VPipe, VSock, VDoor, VBlock, VChr, VExe,
97
    VDir, VSym, VOrph, VPipe, VSock, VDoor, VBlock, VChr, VExe,
96
    VFile, VNormal, VMiss, VLeft, VRight, VEnd
98
    VFile, VNormal, VMiss, VLeft, VRight, VEnd, VSuid, VSgid, VSticky,
99
    VOther, Vstird, VReset, Vhard, Vhard2, VCap
97
};
100
};
98
101
99
#define nvariables (sizeof(variables)/sizeof(variables[0]))
102
/*
103
 * Map from LSCOLORS entry index to Variable array index
104
 */
105
static const uint8_t map[] = {
106
    VDir,	/* Directory */
107
    VSym,	/* Symbolic Link */
108
    VSock,	/* Socket */
109
    VPipe,	/* Named Pipe */
110
    VExe,	/* Executable */
111
    VBlock,	/* Block Special */
112
    VChr,	/* Character Special */
113
    VSuid,	/* Setuid Executable */
114
    VSgid,	/* Setgid Executable */
115
    VSticky,	/* Directory writable to others and sticky */
116
    VOther,	/* Directory writable to others but not sticky */
117
};
100
118
119
120
121
enum ansi {
122
    ANSI_RESET_ON = 0,		/* reset colors/styles (white on black) */
123
    ANSI_BOLD_ON = 1,		/* bold on */
124
    ANSI_ITALICS_ON = 3,	/* italics on */
125
    ANSI_UNDERLINE_ON = 4,	/* underline on */
126
    ANSI_INVERSE_ON = 7,	/* inverse on */
127
    ANSI_STRIKETHROUGH_ON = 9,	/* strikethrough on */
128
    ANSI_BOLD_OFF = 21,		/* bold off */
129
    ANSI_ITALICS_OFF = 23,	/* italics off */
130
    ANSI_UNDERLINE_OFF = 24,	/* underline off */
131
    ANSI_INVERSE_OFF = 27,	/* inverse off */
132
    ANSI_STRIKETHROUGH_OFF = 29,/* strikethrough off */
133
    ANSI_FG_BLACK = 30,		/* fg black */
134
    ANSI_FG_RED = 31,		/* fg red */
135
    ANSI_FG_GREEN = 32,		/* fg green */
136
    ANSI_FG_YELLOW = 33,	/* fg yellow */
137
    ANSI_FG_BLUE = 34,		/* fg blue */
138
    ANSI_FG_MAGENTA = 35,	/* fg magenta */
139
    ANSI_FG_CYAN = 36,		/* fg cyan */
140
    ANSI_FG_WHITE = 37,		/* fg white */
141
    ANSI_FG_DEFAULT = 39,	/* fg default (white) */
142
    ANSI_BG_BLACK = 40,		/* bg black */
143
    ANSI_BG_RED = 41,		/* bg red */
144
    ANSI_BG_GREEN = 42,		/* bg green */
145
    ANSI_BG_YELLOW = 43,	/* bg yellow */
146
    ANSI_BG_BLUE = 44,		/* bg blue */
147
    ANSI_BG_MAGENTA = 45,	/* bg magenta */
148
    ANSI_BG_CYAN = 46,		/* bg cyan */
149
    ANSI_BG_WHITE = 47,		/* bg white */
150
    ANSI_BG_DEFAULT = 49,	/* bg default (black) */
151
};
152
#define TCSH_BOLD	0x80
153
	
101
typedef struct {
154
typedef struct {
102
    Str	    extension;	/* file extension */
155
    Str	    extension;	/* file extension */
103
    Str	    color;	/* color string */
156
    Str	    color;	/* color string */
Lines 167-173 Link Here
167
    return *s == (Char)f;
220
    return *s == (Char)f;
168
}
221
}
169
222
223
static void
224
init(size_t colorlen, size_t extnum)
225
{
226
    size_t i;
170
227
228
    xfree(extensions);
229
    for (i = 0; i < nvariables; i++)
230
	variables[i].color = variables[i].defaultcolor;
231
    if (colorlen == 0 && extnum == 0) {
232
	extensions = NULL;
233
	colors = NULL;
234
    } else {
235
	extensions = xmalloc(colorlen + extnum * sizeof(*extensions));
236
	colors = extnum * sizeof(*extensions) + (char *)extensions;
237
    }
238
    nextensions = 0;
239
}
240
241
static int
242
color(Char x)
243
{
244
    static const char ccolors[] = "abcdefghx";
245
    char *p;
246
    if (Isupper(x)) {
247
	x = Tolower(x);
248
    }
249
250
    if (x == '\0' || (p = strchr(ccolors, x)) == NULL)
251
	return -1;
252
    return 30 + (p - ccolors);
253
}
254
255
static void
256
makecolor(char **c, int fg, int bg, Str *v)
257
{
258
    int l;
259
    if (fg & 0x80)
260
	l = xsnprintf(*c, 12, "%.2d;%.2d;%.2d;%.2d", ANSI_BOLD_ON,
261
	    fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD, ANSI_BOLD_OFF);
262
	l = xsnprintf(*c, 6, "%.2d;%.2d",
263
	    fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD);
264
265
    v->s = *c;
266
    v->len = l;
267
    *c += l + 1;
268
}
269
270
/* parseLSCOLORS():
271
 * 	Parse the LSCOLORS environment variable
272
 */
273
static const Char *xv;	/* setjmp clobbering */
274
void
275
parseLSCOLORS(const Char *value)
276
{
277
    size_t i, len, clen;
278
    jmp_buf_t osetexit;
279
    size_t omark;
280
    xv = value;
281
282
    if (xv == NULL) {
283
	init(0, 0);
284
	return;
285
    }
286
287
    len = Strlen(xv);
288
    len >>= 1;
289
    clen = len * 12;	/* "??;??;??;??\0" */
290
    init(clen, 0);
291
292
    /* Prevent from crashing if unknown parameters are given. */
293
    omark = cleanup_push_mark();
294
    getexit(osetexit);
295
296
    /* init pointers */
297
298
    if (setexit() == 0) {
299
	const Char *v = xv;
300
	char *c = colors;
301
302
	int fg, bg;
303
	for (i = 0; i < len; i++) {
304
	    fg = color(*v++);
305
	    if (fg == -1)
306
		stderror(ERR_BADCOLORVAR, v[-1], '?');
307
308
	    bg = color(*v++);
309
	    if (bg == -1)
310
		stderror(ERR_BADCOLORVAR, '?', v[-1]);
311
	    makecolor(&c, fg, bg, &variables[map[i]].color);
312
	}
313
314
    }
315
    cleanup_pop_mark(omark);
316
    resexit(osetexit);
317
}
318
171
/* parseLS_COLORS():
319
/* parseLS_COLORS():
172
 *	Parse the LS_COLORS environment variable
320
 *	Parse the LS_COLORS environment variable
173
 */
321
 */
Lines 183-198 Link Here
183
331
184
    (void) &e;
332
    (void) &e;
185
333
186
    /* init */
187
    xfree(extensions);
188
    for (i = 0; i < nvariables; i++)
189
	variables[i].color = variables[i].defaultcolor;
190
    colors = NULL;
191
    extensions = NULL;
192
    nextensions = 0;
193
334
194
    if (value == NULL)
335
    if (value == NULL) {
336
	init(0, 0);
195
	return;
337
	return;
338
    }
196
339
197
    len = Strlen(value);
340
    len = Strlen(value);
198
    /* allocate memory */
341
    /* allocate memory */
Lines 200-213 Link Here
200
    for (v = value; *v; v++)
343
    for (v = value; *v; v++)
201
	if ((*v & CHAR) == ':')
344
	if ((*v & CHAR) == ':')
202
	    i++;
345
	    i++;
203
    extensions = xmalloc(len + i * sizeof(Extension));
204
    colors = i * sizeof(Extension) + (char *)extensions;
205
    nextensions = 0;
206
346
347
    init(len, i);
348
207
    /* init pointers */
349
    /* init pointers */
208
    v = value;
350
    v = value;
209
    c = colors;
351
    c = colors;
210
    e = &extensions[0];
352
    e = extensions;
211
353
212
    /* Prevent from crashing if unknown parameters are given. */
354
    /* Prevent from crashing if unknown parameters are given. */
213
355
Lines 216-259 Link Here
216
358
217
    if (setexit() == 0) {
359
    if (setexit() == 0) {
218
360
219
    /* parse */
361
	/* parse */
220
    while (*v) {
362
	while (*v) {
221
	switch (*v & CHAR) {
363
	    switch (*v & CHAR) {
222
	case ':':
364
	    case ':':
223
	    v++;
224
	    continue;
225
226
	case '*':		/* :*ext=color: */
227
	    v++;
228
	    if (getstring(&c, &v, &e->extension, '=') &&
229
		0 < e->extension.len) {
230
		v++;
365
		v++;
231
		getstring(&c, &v, &e->color, ':');
232
		e++;
233
		continue;
366
		continue;
234
	    }
235
	    break;
236
367
237
	default:		/* :vl=color: */
368
	    case '*':		/* :*ext=color: */
238
	    if (v[0] && v[1] && (v[2] & CHAR) == '=') {
369
		v++;
239
		for (i = 0; i < nvariables; i++)
370
		if (getstring(&c, &v, &e->extension, '=') &&
240
		    if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
371
		    0 < e->extension.len) {
241
			(Char)variables[i].variable[1] == (v[1] & CHAR))
372
		    v++;
242
			break;
373
		    getstring(&c, &v, &e->color, ':');
243
		if (i < nvariables) {
374
		    e++;
244
		    v += 3;
245
		    getstring(&c, &v, &variables[i].color, ':');
246
		    continue;
375
		    continue;
247
		}
376
		}
248
		else
377
		break;
249
		    stderror(ERR_BADCOLORVAR, v[0], v[1]);
378
379
	    default:		/* :vl=color: */
380
		if (v[0] && v[1] && (v[2] & CHAR) == '=') {
381
		    for (i = 0; i < nvariables; i++)
382
			if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
383
			    (Char)variables[i].variable[1] == (v[1] & CHAR))
384
			    break;
385
		    if (i < nvariables) {
386
			v += 3;
387
			getstring(&c, &v, &variables[i].color, ':');
388
			continue;
389
		    }
390
		    else
391
			stderror(ERR_BADCOLORVAR, v[0], v[1]);
392
		}
393
		break;
250
	    }
394
	    }
251
	    break;
395
	    while (*v && (*v & CHAR) != ':')
396
		v++;
252
	}
397
	}
253
	while (*v && (*v & CHAR) != ':')
254
	    v++;
255
    }
398
    }
256
    }
257
399
258
    cleanup_pop_mark(omark);
400
    cleanup_pop_mark(omark);
259
    resexit(osetexit);
401
    resexit(osetexit);
Lines 264-278 Link Here
264
/* put_color():
406
/* put_color():
265
 */
407
 */
266
static void
408
static void
267
put_color(const Str *color)
409
put_color(const Str *colorp)
268
{
410
{
269
    size_t  i;
411
    size_t  i;
270
    const char	 *c = color->s;
412
    const char	 *c = colorp->s;
271
    int	   original_output_raw = output_raw;
413
    int	   original_output_raw = output_raw;
272
414
273
    output_raw = TRUE;
415
    output_raw = TRUE;
274
    cleanup_push(&original_output_raw, output_raw_restore);
416
    cleanup_push(&original_output_raw, output_raw_restore);
275
    for (i = color->len; 0 < i; i--)
417
    for (i = colorp->len; 0 < i; i--)
276
	xputchar(*c++);
418
	xputchar(*c++);
277
    cleanup_until(&original_output_raw);
419
    cleanup_until(&original_output_raw);
278
}
420
}
Lines 286-297 Link Here
286
    size_t  i;
428
    size_t  i;
287
    char   *filename = short2str(fname);
429
    char   *filename = short2str(fname);
288
    char   *last = filename + len;
430
    char   *last = filename + len;
289
    Str	   *color = &variables[VFile].color;
431
    Str	   *colorp = &variables[VFile].color;
290
432
291
    switch (suffix) {
433
    switch (suffix) {
292
    case '>':			/* File is a symbolic link pointing to
434
    case '>':			/* File is a symbolic link pointing to
293
				 * a directory */
435
				 * a directory */
294
	color = &variables[VDir].color;
436
	colorp = &variables[VDir].color;
295
	break;
437
	break;
296
    case '+':			/* File is a hidden directory [aix] or
438
    case '+':			/* File is a hidden directory [aix] or
297
				 * context dependent [hpux] */
439
				 * context dependent [hpux] */
Lines 301-307 Link Here
301
	for (i = 0; i < nvariables; i++)
443
	for (i = 0; i < nvariables; i++)
302
	    if (variables[i].suffix != NOS &&
444
	    if (variables[i].suffix != NOS &&
303
		(Char)variables[i].suffix == suffix) {
445
		(Char)variables[i].suffix == suffix) {
304
		color = &variables[i].color;
446
		colorp = &variables[i].color;
305
		break;
447
		break;
306
	    }
448
	    }
307
	if (i == nvariables) {
449
	if (i == nvariables) {
Lines 310-316 Link Here
310
		    && strncmp(last - extensions[i].extension.len,
452
		    && strncmp(last - extensions[i].extension.len,
311
			       extensions[i].extension.s,
453
			       extensions[i].extension.s,
312
			       extensions[i].extension.len) == 0) {
454
			       extensions[i].extension.len) == 0) {
313
		  color = &extensions[i].color;
455
		  colorp = &extensions[i].color;
314
		break;
456
		break;
315
	    }
457
	    }
316
	}
458
	}
Lines 318-324 Link Here
318
    }
460
    }
319
461
320
    put_color(&variables[VLeft].color);
462
    put_color(&variables[VLeft].color);
321
    put_color(color);
463
    put_color(colorp);
322
    put_color(&variables[VRight].color);
464
    put_color(&variables[VRight].color);
323
}
465
}
324
466
(-)contrib/tcsh/tw.comp.c (-8 / +13 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.comp.c,v 1.42 2007/10/01 21:52:00 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.comp.c,v 1.45 2015/09/30 13:28:02 christos Exp $ */
2
/*
2
/*
3
 * tw.comp.c: File completion builtin
3
 * tw.comp.c: File completion builtin
4
 */
4
 */
Lines 32-38 Link Here
32
 */
32
 */
33
#include "sh.h"
33
#include "sh.h"
34
34
35
RCSID("$tcsh: tw.comp.c,v 1.42 2007/10/01 21:52:00 christos Exp $")
35
RCSID("$tcsh: tw.comp.c,v 1.45 2015/09/30 13:28:02 christos Exp $")
36
36
37
#include "tw.h"
37
#include "tw.h"
38
#include "ed.h"
38
#include "ed.h"
Lines 46-52 Link Here
46
static Char 		 *tw_tok	(Char *);
46
static Char 		 *tw_tok	(Char *);
47
static int	 	  tw_pos	(Char *, int);
47
static int	 	  tw_pos	(Char *, int);
48
static void	  	  tw_pr		(Char **);
48
static void	  	  tw_pr		(Char **);
49
static int	  	  tw_match	(const Char *, const Char *);
49
static int	  	  tw_match	(const Char *, const Char *, int);
50
static void	 	  tw_prlist	(struct varent *);
50
static void	 	  tw_prlist	(struct varent *);
51
static const Char	 *tw_dollar	(const Char *,Char **, size_t, Char **,
51
static const Char	 *tw_dollar	(const Char *,Char **, size_t, Char **,
52
					 Char, const char *);
52
					 Char, const char *);
Lines 248-261 Link Here
248
 *	in a prefix of the string.
248
 *	in a prefix of the string.
249
 */
249
 */
250
static int
250
static int
251
tw_match(const Char *str, const Char *pat)
251
tw_match(const Char *str, const Char *pat, int exact)
252
{
252
{
253
    const Char *estr;
253
    const Char *estr;
254
    int rv = Gnmatch(str, pat, &estr);
254
    int rv = exact ? Gmatch(estr = str, pat) : Gnmatch(str, pat, &estr);
255
#ifdef TDEBUG
255
#ifdef TDEBUG
256
    xprintf("Gnmatch(%s, ", short2str(str));
256
    xprintf("G%smatch(%s, ", exact ? "" : "n", short2str(str));
257
    xprintf("%s, ", short2str(pat));
257
    xprintf("%s, ", short2str(pat));
258
    xprintf("%s) = %d [%d]\n", short2str(estr), rv, estr - str);
258
    xprintf("%s) = %d [%" TCSH_PTRDIFF_T_FMT "d]\n", short2str(estr), rv,
259
	estr - str);
259
#endif /* TDEBUG */
260
#endif /* TDEBUG */
260
    return (int) (rv ? estr - str : -1);
261
    return (int) (rv ? estr - str : -1);
261
}
262
}
Lines 525-530 Link Here
525
	     *pos = NULL;	/* scratch pointer 			*/
526
	     *pos = NULL;	/* scratch pointer 			*/
526
	int   cmd, res;
527
	int   cmd, res;
527
        Char  sep;		/* the command and separator characters */
528
        Char  sep;		/* the command and separator characters */
529
	int   exact;
528
530
529
	if (ptr[0] == '\0')
531
	if (ptr[0] == '\0')
530
	    continue;
532
	    continue;
Lines 599-604 Link Here
599
	}
601
	}
600
#endif /* TDEBUG */
602
#endif /* TDEBUG */
601
603
604
	exact = 0;
602
	switch (cmd) {
605
	switch (cmd) {
603
	case 'p':			/* positional completion */
606
	case 'p':			/* positional completion */
604
#ifdef TDEBUG
607
#ifdef TDEBUG
Lines 614-625 Link Here
614
617
615
	case 'N':			/* match with the next-next word */
618
	case 'N':			/* match with the next-next word */
616
	case 'n':			/* match with the next word */
619
	case 'n':			/* match with the next word */
620
	    exact = 1;
621
	    /*FALLTHROUGH*/
617
	case 'c':			/* match with the current word */
622
	case 'c':			/* match with the current word */
618
	case 'C':
623
	case 'C':
619
#ifdef TDEBUG
624
#ifdef TDEBUG
620
	    xprintf("%c: ", cmd);
625
	    xprintf("%c: ", cmd);
621
#endif /* TDEBUG */
626
#endif /* TDEBUG */
622
	    if ((n = tw_match(pos, ran)) < 0) {
627
	    if ((n = tw_match(pos, ran, exact)) < 0) {
623
		cleanup_until(ran);
628
		cleanup_until(ran);
624
		continue;
629
		continue;
625
	    }
630
	    }
(-)contrib/tcsh/tw.decls.h (-1 / +2 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.decls.h,v 3.22 2006/01/12 18:15:25 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.decls.h,v 3.23 2012/06/21 17:40:40 christos Exp $ */
2
/*
2
/*
3
 * tw.decls.h: Tenex external declarations
3
 * tw.decls.h: Tenex external declarations
4
 */
4
 */
Lines 125-130 Link Here
125
extern	 void		  set_color_context	(void);
125
extern	 void		  set_color_context	(void);
126
extern	 void		  print_with_color	(const Char *, size_t, Char);
126
extern	 void		  print_with_color	(const Char *, size_t, Char);
127
extern	 void		  parseLS_COLORS	(const Char *);
127
extern	 void		  parseLS_COLORS	(const Char *);
128
extern	 void		  parseLSCOLORS		(const Char *);
128
#endif /* COLOR_LS_F */
129
#endif /* COLOR_LS_F */
129
130
130
#endif /* _h_tw_decls */
131
#endif /* _h_tw_decls */
(-)contrib/tcsh/tw.parse.c (-6 / +10 lines)
Lines 1-4 Link Here
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.133 2011/04/14 14:33:05 christos Exp $ */
1
/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.139 2015/10/16 14:59:56 christos Exp $ */
2
/*
2
/*
3
 * tw.parse.c: Everyone has taken a shot in this futile effort to
3
 * tw.parse.c: Everyone has taken a shot in this futile effort to
4
 *	       lexically analyze a csh line... Well we cannot good
4
 *	       lexically analyze a csh line... Well we cannot good
Lines 35-41 Link Here
35
 */
35
 */
36
#include "sh.h"
36
#include "sh.h"
37
37
38
RCSID("$tcsh: tw.parse.c,v 3.133 2011/04/14 14:33:05 christos Exp $")
38
RCSID("$tcsh: tw.parse.c,v 3.139 2015/10/16 14:59:56 christos Exp $")
39
39
40
#include "tw.h"
40
#include "tw.h"
41
#include "ed.h"
41
#include "ed.h"
Lines 618-624 Link Here
618
	    break;
618
	    break;
619
619
620
	wq = w & QUOTE;
620
	wq = w & QUOTE;
621
	w &= ~QUOTE;
621
#if INVALID_BYTE != 0
622
	/* add checking INVALID_BYTE for FIX UTF32 */
623
	if ((w & INVALID_BYTE) != INVALID_BYTE)		/* w < INVALID_BYTE */
624
#endif
625
	    w &= ~QUOTE;
622
626
623
	if (cmap(w, _ESC | _QF))
627
	if (cmap(w, _ESC | _QF))
624
	    wq = QUOTE;		/* quotes are always quoted */
628
	    wq = QUOTE;		/* quotes are always quoted */
Lines 1236-1242 Link Here
1236
tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
1240
tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
1237
{
1241
{
1238
    Char *ptr;
1242
    Char *ptr;
1239
    Char *dollar;
1243
    Char *dol;
1240
    struct varent *vp;
1244
    struct varent *vp;
1241
1245
1242
    (void) strip(exp_name);
1246
    (void) strip(exp_name);
Lines 1258-1265 Link Here
1258
	else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
1262
	else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
1259
	    return ' ';
1263
	    return ' ';
1260
1264
1261
	if ((dollar = Strrchr(word->s, '$')) != 0 && 
1265
	if ((dol = Strrchr(word->s, '$')) != 0 && 
1262
	    dollar[1] == '{' && Strchr(dollar, '}') == NULL)
1266
	    dol[1] == '{' && Strchr(dol, '}') == NULL)
1263
	  return '}';
1267
	  return '}';
1264
1268
1265
	return isadirectory(exp_dir, ptr) ? '/' : ' ';
1269
	return isadirectory(exp_dir, ptr) ? '/' : ' ';

Return to bug 207860