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

Collapse All | Expand All

(-)bin/csh/Makefile (-1 / +4 lines)
Lines 23-29 Link Here
23
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
23
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
24
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
24
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
25
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
25
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
26
SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
26
SRCS+=	sh.decls.h glob.c glob.h dotlock.h dotlock.c mi.termios.c \
27
	mi.wait.h mi.varargs.h
27
SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
28
SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
28
	tw.comp.c tw.color.c
29
	tw.comp.c tw.color.c
29
SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
30
SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
Lines 58-63 Link Here
58
		greek:el_GR.UTF-8 \
59
		greek:el_GR.UTF-8 \
59
		italian:it_IT.UTF-8 \
60
		italian:it_IT.UTF-8 \
60
		ja:ja_JP.UTF-8 \
61
		ja:ja_JP.UTF-8 \
62
		pl:pl_PL.UTF-8 \
61
		russian:ru_RU.UTF-8 \
63
		russian:ru_RU.UTF-8 \
62
		spanish:es_ES.UTF-8 \
64
		spanish:es_ES.UTF-8 \
63
		ukrainian:uk_UA.UTF-8
65
		ukrainian:uk_UA.UTF-8
Lines 83-88 Link Here
83
NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
85
NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
84
		it_IT.ISO8859-15
86
		it_IT.ISO8859-15
85
NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
87
NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
88
NLSLINKS_pl_PL.UTF-8 = pl_PL.ISO8859-2
86
NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
89
NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
87
NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
90
NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
88
.else
91
.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 (+6 lines)
Lines 1-4 Link Here
1
$FreeBSD$
1
$FreeBSD$
2
*/.cvsignore
3
*/.travis.yml
4
*/bar
2
*/BUGS
5
*/BUGS
3
*/config/a*
6
*/config/a*
4
*/config/bs2000
7
*/config/bs2000
Lines 5-9 Link Here
5
*/config/bsd
8
*/config/bsd
6
*/config/bsdreno
9
*/config/bsdreno
7
*/config/[c-z]*
10
*/config/[c-z]*
11
*/cygwin
12
*/m4
13
*/tcsh.vcproj
8
*/tests
14
*/tests
9
*/win32
15
*/win32
(-)contrib/tcsh/Fixes (+69 lines)
Lines 1-3 Link Here
1
 41  V6.19.00 - 20150521
2
 40. V6.18.05 - 20150510
3
 39. fix reseting when interrupted inside an eval "eval sleep 10^C"
4
     (paulo.cesar.pereira.de.andrade)
5
 38. rename handle_intr -> handle_interrupt as originally intended.
6
 37. fix input tests that need stdin on a tty
7
 36. V6.18.04 - 20150504
8
 35. revert fix echo "\1", it is incorrect.
9
 34. revert fix to PR/437, breaks short strings.
10
 33. V6.18.03 - 20150503
11
 32. PR/437: Nakajima Akira: Fix segmentation fault reading input files
12
 31. PR/291: Print job status messages to stderr.
13
 30. Fridolin Pokorny NUL in `` does not mean EOF.
14
 29. Pavel Raiskup fix hang with:
15
	while (1)
16
	   ( date & ; wait )
17
        end
18
 28. Add cdtohome special variable (Martin Tournoij)
19
 27. Fix root prompt char for windows (Corinna Vinschen)
20
 26. For "next" completion matches only consider exact matches of the previous
21
     word (Jamie Landeg-Jones)
22
 25. Fix echo "\1" for echo_style=both where the first character was
23
     not processed properly (Gary Duzan)
24
 24. V6.18.02 - 20140618
25
 23. fix ls-F /non printing exit value twice.
26
 22. rename configure.in to configure.ac, add aclocal.m4 to CVS
27
 21. set foo="aabaabaa"; echo $foo:as/a// should produce bb
28
 20. Add locked merge history support (Marcin Konarski)
29
 19. Support more resource limits from various BSD's
30
 18. Cache history count to speed up thing
31
 17. PR/240: minix support 
32
 16. revert fix for 15. Causes extra quoting, for example (foo is a program
33
     that prints its arguments):
34
	$ ./foo 'abc' *
35
	'\a\b\c'
36
 15. fix globbing for ``, stripping backslashes. Example:
37
	cat << _EOF > huh
38
	echo 'hello\;world'
39
        _EOF
40
	echo `./huh 0`
41
	echo `./huh $?`
42
 14. fix for `` that causes hang. Example:
43
	cat << _EOF > huh
44
	#!/bin/sh
45
	echo "[$@]"
46
	echo "I am running"
47
	echo "I am running ($$)" >> huh.out
48
	_EOF
49
	cat << _EOF > huh.tcsh
50
	#!/bin/tcsh -f
51
52
	./huh \
53
	    `#comment blah blah blah` \
54
	    parameter a \
55
	    `#comment blah blah blah` \
56
	    parameter b \
57
	    `#comment blah blah blah` \
58
	    parameter c
59
	echo ok
60
	_EOF
61
 13. remove AsciiOnly fix now that the real issue has been fixed (Roman Kollar)
62
 12. define utmp file for aix (Laurence Darby)
63
 11. fix if history in loops
64
 10. make ls-F print to stderr and set the exit code
65
  9. make rmstar interruptible on linux
66
  8. Get rid of pret_t and make the printf functions return the number of
67
     characters printed as the system ones do.
68
  7. Parse a FreeBSD compat $LSCOLORS. What to do when both LSCOLORS and
69
     LS_COLORS are set. I am not documenting this until we decide.
1
  6. V6.18.01 - 20120214
70
  6. V6.18.01 - 20120214
2
  5. fix interruptible wait again
71
  5. fix interruptible wait again
3
  4. ignore bogus compiler overflow message
72
  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 (-31 / +15 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.56 2014/07/24 22:52:13 christos 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-418 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/syntax.at tests/subst.at \
Lines 449-455 Link Here
449
449
450
gethost:  gethost.c sh.err.h tc.const.h sh.h
450
gethost:  gethost.c sh.err.h tc.const.h sh.h
451
	rm -f gethost
451
	rm -f gethost
452
	${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c
452
	${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} $(srcdir)/gethost.c
453
453
454
tc.defs.c:	gethost host.defs
454
tc.defs.c:	gethost host.defs
455
	@rm -f $@.tmp
455
	@rm -f $@.tmp
Lines 537-543 Link Here
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 (-6 / +10 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.99 2014/07/07 20:34:58 christos 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 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.19.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.55 2014/09/27 07:08:45 kim 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.h.in (-1 / +1 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'. */
(-)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 / +3 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.50 2015/02/22 16:31:54 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 50-56 Link Here
50
 * WIDE_STRINGS	Represent strings using wide characters
50
 * WIDE_STRINGS	Represent strings using wide characters
51
 *		Allows proper function in multibyte encodings like UTF-8
51
 *		Allows proper function in multibyte encodings like UTF-8
52
 */
52
 */
53
#if defined (SHORT_STRINGS) && defined (NLS) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
53
#if defined (SHORT_STRINGS) && defined (NLS) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX) && SIZEOF_WCHAR_T > 1
54
# define WIDE_STRINGS
54
# define WIDE_STRINGS
55
# if SIZEOF_WCHAR_T < 4
55
# if SIZEOF_WCHAR_T < 4
56
#  define UTF16_STRINGS
56
#  define UTF16_STRINGS
Lines 135-141 Link Here
135
 *		This can be much slower and no memory statistics will be
135
 *		This can be much slower and no memory statistics will be
136
 *		provided.
136
 *		provided.
137
 */
137
 */
138
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__)
138
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__)
139
# define SYSMALLOC
139
# define SYSMALLOC
140
#else
140
#else
141
# undef SYSMALLOC
141
# undef SYSMALLOC
(-)contrib/tcsh/configure (-169 / +236 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.19.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.19.00'
564
PACKAGE_STRING='tcsh 6.18.01'
584
PACKAGE_STRING='tcsh 6.19.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.19.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.19.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.19.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.19.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 4461-4466 Link Here
4461
  prefix="$acl_save_prefix"
4494
  prefix="$acl_save_prefix"
4462
4495
4463
4496
4497
4464
# Check whether --with-gnu-ld was given.
4498
# Check whether --with-gnu-ld was given.
4465
if test "${with_gnu_ld+set}" = set; then :
4499
if test "${with_gnu_ld+set}" = set; then :
4466
  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4500
  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
Lines 4471-4491 Link Here
4471
# Prepare PATH_SEPARATOR.
4505
# Prepare PATH_SEPARATOR.
4472
# The user is always right.
4506
# The user is always right.
4473
if test "${PATH_SEPARATOR+set}" != set; then
4507
if test "${PATH_SEPARATOR+set}" != set; then
4474
  echo "#! /bin/sh" >conf$$.sh
4508
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
4475
  echo  "exit 0"   >>conf$$.sh
4509
  # contains only /bin. Note that ksh looks also at the FPATH variable,
4476
  chmod +x conf$$.sh
4510
  # so we have to set that as well for the test.
4477
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
4511
  PATH_SEPARATOR=:
4478
    PATH_SEPARATOR=';'
4512
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4479
  else
4513
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
4480
    PATH_SEPARATOR=:
4514
           || PATH_SEPARATOR=';'
4481
  fi
4515
       }
4482
  rm -f conf$$.sh
4483
fi
4516
fi
4517
4484
ac_prog=ld
4518
ac_prog=ld
4485
if test "$GCC" = yes; then
4519
if test "$GCC" = yes; then
4486
  # Check if gcc -print-prog-name=ld gives a path.
4520
  # 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
4521
  { $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; }
4522
$as_echo_n "checking for ld used by $CC... " >&6; }
4489
  case $host in
4523
  case $host in
4490
  *-*-mingw*)
4524
  *-*-mingw*)
4491
    # gcc leaves a trailing carriage return which upsets mingw
4525
    # gcc leaves a trailing carriage return which upsets mingw
Lines 4495-4505 Link Here
4495
  esac
4529
  esac
4496
  case $ac_prog in
4530
  case $ac_prog in
4497
    # Accept absolute paths.
4531
    # Accept absolute paths.
4498
    [\\/]* | [A-Za-z]:[\\/]*)
4532
    [\\/]* | ?:[\\/]*)
4499
      re_direlt='/[^/][^/]*/\.\./'
4533
      re_direlt='/[^/][^/]*/\.\./'
4500
      # Canonicalize the path of ld
4534
      # Canonicalize the pathname of ld
4501
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4535
      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
4502
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4536
      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
4503
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4537
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4504
      done
4538
      done
4505
      test -z "$LD" && LD="$ac_prog"
4539
      test -z "$LD" && LD="$ac_prog"
Lines 4524-4546 Link Here
4524
  $as_echo_n "(cached) " >&6
4558
  $as_echo_n "(cached) " >&6
4525
else
4559
else
4526
  if test -z "$LD"; then
4560
  if test -z "$LD"; then
4527
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4561
  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4528
  for ac_dir in $PATH; do
4562
  for ac_dir in $PATH; do
4563
    IFS="$acl_save_ifs"
4529
    test -z "$ac_dir" && ac_dir=.
4564
    test -z "$ac_dir" && ac_dir=.
4530
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4565
    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"
4566
      acl_cv_path_LD="$ac_dir/$ac_prog"
4532
      # Check to see if the program is GNU ld.  I'd rather use --version,
4567
      # Check to see if the program is GNU ld.  I'd rather use --version,
4533
      # but apparently some GNU ld's only accept -v.
4568
      # but apparently some variants of GNU ld only accept -v.
4534
      # Break only if it was the GNU/non-GNU ld that we prefer.
4569
      # 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
4570
      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
4536
      *GNU* | *'with BFD'*)
4571
      *GNU* | *'with BFD'*)
4537
        test "$with_gnu_ld" != no && break ;;
4572
        test "$with_gnu_ld" != no && break
4573
        ;;
4538
      *)
4574
      *)
4539
        test "$with_gnu_ld" != yes && break ;;
4575
        test "$with_gnu_ld" != yes && break
4576
        ;;
4540
      esac
4577
      esac
4541
    fi
4578
    fi
4542
  done
4579
  done
4543
  IFS="$ac_save_ifs"
4580
  IFS="$acl_save_ifs"
4544
else
4581
else
4545
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
4582
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
4546
fi
4583
fi
Lines 4560-4571 Link Here
4560
if ${acl_cv_prog_gnu_ld+:} false; then :
4597
if ${acl_cv_prog_gnu_ld+:} false; then :
4561
  $as_echo_n "(cached) " >&6
4598
  $as_echo_n "(cached) " >&6
4562
else
4599
else
4563
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
4600
  # I'd rather use --version here, but apparently some GNU lds only accept -v.
4564
case `$LD -v 2>&1 </dev/null` in
4601
case `$LD -v 2>&1 </dev/null` in
4565
*GNU* | *'with BFD'*)
4602
*GNU* | *'with BFD'*)
4566
  acl_cv_prog_gnu_ld=yes ;;
4603
  acl_cv_prog_gnu_ld=yes
4604
  ;;
4567
*)
4605
*)
4568
  acl_cv_prog_gnu_ld=no ;;
4606
  acl_cv_prog_gnu_ld=no
4607
  ;;
4569
esac
4608
esac
4570
fi
4609
fi
4571
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
4610
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
Lines 4748-4754 Link Here
4748
      done
4787
      done
4749
      if test -z "$already_handled"; then
4788
      if test -z "$already_handled"; then
4750
        names_already_handled="$names_already_handled $name"
4789
        names_already_handled="$names_already_handled $name"
4751
                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4790
                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
4752
        eval value=\"\$HAVE_LIB$uppername\"
4791
        eval value=\"\$HAVE_LIB$uppername\"
4753
        if test -n "$value"; then
4792
        if test -n "$value"; then
4754
          if test "$value" = yes; then
4793
          if test "$value" = yes; then
Lines 5176-5189 Link Here
5176
    am_cv_lib_iconv=no
5215
    am_cv_lib_iconv=no
5177
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5216
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5178
/* end confdefs.h.  */
5217
/* end confdefs.h.  */
5218
5179
#include <stdlib.h>
5219
#include <stdlib.h>
5180
#include <iconv.h>
5220
#include <iconv.h>
5221
5181
int
5222
int
5182
main ()
5223
main ()
5183
{
5224
{
5184
iconv_t cd = iconv_open("","");
5225
iconv_t cd = iconv_open("","");
5185
       iconv(cd,NULL,NULL,NULL,NULL);
5226
           iconv(cd,NULL,NULL,NULL,NULL);
5186
       iconv_close(cd);
5227
           iconv_close(cd);
5187
  ;
5228
  ;
5188
  return 0;
5229
  return 0;
5189
}
5230
}
Lines 5198-5211 Link Here
5198
      LIBS="$LIBS $LIBICONV"
5239
      LIBS="$LIBS $LIBICONV"
5199
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5240
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5200
/* end confdefs.h.  */
5241
/* end confdefs.h.  */
5242
5201
#include <stdlib.h>
5243
#include <stdlib.h>
5202
#include <iconv.h>
5244
#include <iconv.h>
5245
5203
int
5246
int
5204
main ()
5247
main ()
5205
{
5248
{
5206
iconv_t cd = iconv_open("","");
5249
iconv_t cd = iconv_open("","");
5207
         iconv(cd,NULL,NULL,NULL,NULL);
5250
             iconv(cd,NULL,NULL,NULL,NULL);
5208
         iconv_close(cd);
5251
             iconv_close(cd);
5209
  ;
5252
  ;
5210
  return 0;
5253
  return 0;
5211
}
5254
}
Lines 5229-5243 Link Here
5229
  $as_echo_n "(cached) " >&6
5272
  $as_echo_n "(cached) " >&6
5230
else
5273
else
5231
5274
5232
            am_save_LIBS="$LIBS"
5275
                  am_save_LIBS="$LIBS"
5233
      if test $am_cv_lib_iconv = yes; then
5276
      if test $am_cv_lib_iconv = yes; then
5234
        LIBS="$LIBS $LIBICONV"
5277
        LIBS="$LIBS $LIBICONV"
5235
      fi
5278
      fi
5236
      if test "$cross_compiling" = yes; then :
5279
      am_cv_func_iconv_works=no
5280
      for ac_iconv_const in '' 'const'; do
5281
        if test "$cross_compiling" = yes; then :
5237
  case "$host_os" in
5282
  case "$host_os" in
5238
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
5283
             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
5239
           *)            am_cv_func_iconv_works="guessing yes" ;;
5284
             *)            am_cv_func_iconv_works="guessing yes" ;;
5240
         esac
5285
           esac
5241
else
5286
else
5242
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5287
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5243
/* end confdefs.h.  */
5288
/* end confdefs.h.  */
Lines 5244-5251 Link Here
5244
5289
5245
#include <iconv.h>
5290
#include <iconv.h>
5246
#include <string.h>
5291
#include <string.h>
5247
int main ()
5292
5293
#ifndef ICONV_CONST
5294
# define ICONV_CONST $ac_iconv_const
5295
#endif
5296
5297
int
5298
main ()
5248
{
5299
{
5300
int result = 0;
5249
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
5301
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
5250
     returns.  */
5302
     returns.  */
5251
  {
5303
  {
Lines 5252-5268 Link Here
5252
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
5304
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
5253
    if (cd_utf8_to_88591 != (iconv_t)(-1))
5305
    if (cd_utf8_to_88591 != (iconv_t)(-1))
5254
      {
5306
      {
5255
        static const char input[] = "\342\202\254"; /* EURO SIGN */
5307
        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
5256
        char buf[10];
5308
        char buf[10];
5257
        const char *inptr = input;
5309
        ICONV_CONST char *inptr = input;
5258
        size_t inbytesleft = strlen (input);
5310
        size_t inbytesleft = strlen (input);
5259
        char *outptr = buf;
5311
        char *outptr = buf;
5260
        size_t outbytesleft = sizeof (buf);
5312
        size_t outbytesleft = sizeof (buf);
5261
        size_t res = iconv (cd_utf8_to_88591,
5313
        size_t res = iconv (cd_utf8_to_88591,
5262
                            (char **) &inptr, &inbytesleft,
5314
                            &inptr, &inbytesleft,
5263
                            &outptr, &outbytesleft);
5315
                            &outptr, &outbytesleft);
5264
        if (res == 0)
5316
        if (res == 0)
5265
          return 1;
5317
          result |= 1;
5318
        iconv_close (cd_utf8_to_88591);
5266
      }
5319
      }
5267
  }
5320
  }
5268
  /* Test against Solaris 10 bug: Failures are not distinguishable from
5321
  /* 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");
5324
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
5272
    if (cd_ascii_to_88591 != (iconv_t)(-1))
5325
    if (cd_ascii_to_88591 != (iconv_t)(-1))
5273
      {
5326
      {
5274
        static const char input[] = "\263";
5327
        static ICONV_CONST char input[] = "\263";
5275
        char buf[10];
5328
        char buf[10];
5276
        const char *inptr = input;
5329
        ICONV_CONST char *inptr = input;
5277
        size_t inbytesleft = strlen (input);
5330
        size_t inbytesleft = strlen (input);
5278
        char *outptr = buf;
5331
        char *outptr = buf;
5279
        size_t outbytesleft = sizeof (buf);
5332
        size_t outbytesleft = sizeof (buf);
5280
        size_t res = iconv (cd_ascii_to_88591,
5333
        size_t res = iconv (cd_ascii_to_88591,
5281
                            (char **) &inptr, &inbytesleft,
5334
                            &inptr, &inbytesleft,
5282
                            &outptr, &outbytesleft);
5335
                            &outptr, &outbytesleft);
5283
        if (res == 0)
5336
        if (res == 0)
5284
          return 1;
5337
          result |= 2;
5338
        iconv_close (cd_ascii_to_88591);
5285
      }
5339
      }
5286
  }
5340
  }
5341
  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
5342
  {
5343
    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
5344
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5345
      {
5346
        static ICONV_CONST char input[] = "\304";
5347
        static char buf[2] = { (char)0xDE, (char)0xAD };
5348
        ICONV_CONST char *inptr = input;
5349
        size_t inbytesleft = 1;
5350
        char *outptr = buf;
5351
        size_t outbytesleft = 1;
5352
        size_t res = iconv (cd_88591_to_utf8,
5353
                            &inptr, &inbytesleft,
5354
                            &outptr, &outbytesleft);
5355
        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
5356
          result |= 4;
5357
        iconv_close (cd_88591_to_utf8);
5358
      }
5359
  }
5287
#if 0 /* This bug could be worked around by the caller.  */
5360
#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.  */
5361
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
5289
  {
5362
  {
Lines 5290-5306 Link Here
5290
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
5363
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
5291
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5364
    if (cd_88591_to_utf8 != (iconv_t)(-1))
5292
      {
5365
      {
5293
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
5366
        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
5294
        char buf[50];
5367
        char buf[50];
5295
        const char *inptr = input;
5368
        ICONV_CONST char *inptr = input;
5296
        size_t inbytesleft = strlen (input);
5369
        size_t inbytesleft = strlen (input);
5297
        char *outptr = buf;
5370
        char *outptr = buf;
5298
        size_t outbytesleft = sizeof (buf);
5371
        size_t outbytesleft = sizeof (buf);
5299
        size_t res = iconv (cd_88591_to_utf8,
5372
        size_t res = iconv (cd_88591_to_utf8,
5300
                            (char **) &inptr, &inbytesleft,
5373
                            &inptr, &inbytesleft,
5301
                            &outptr, &outbytesleft);
5374
                            &outptr, &outbytesleft);
5302
        if ((int)res > 0)
5375
        if ((int)res > 0)
5303
          return 1;
5376
          result |= 8;
5377
        iconv_close (cd_88591_to_utf8);
5304
      }
5378
      }
5305
  }
5379
  }
5306
#endif
5380
#endif
Lines 5314-5332 Link Here
5314
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
5388
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
5315
      /* Try HP-UX names.  */
5389
      /* Try HP-UX names.  */
5316
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
5390
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
5317
    return 1;
5391
    result |= 16;
5392
  return result;
5393
5394
  ;
5318
  return 0;
5395
  return 0;
5319
}
5396
}
5320
_ACEOF
5397
_ACEOF
5321
if ac_fn_c_try_run "$LINENO"; then :
5398
if ac_fn_c_try_run "$LINENO"; then :
5322
  am_cv_func_iconv_works=yes
5399
  am_cv_func_iconv_works=yes
5323
else
5324
  am_cv_func_iconv_works=no
5325
fi
5400
fi
5326
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5401
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5327
  conftest.$ac_objext conftest.beam conftest.$ac_ext
5402
  conftest.$ac_objext conftest.beam conftest.$ac_ext
5328
fi
5403
fi
5329
5404
5405
        test "$am_cv_func_iconv_works" = no || break
5406
      done
5330
      LIBS="$am_save_LIBS"
5407
      LIBS="$am_save_LIBS"
5331
5408
5332
fi
5409
fi
Lines 5373-5379 Link Here
5373
#ifdef __cplusplus
5450
#ifdef __cplusplus
5374
"C"
5451
"C"
5375
#endif
5452
#endif
5376
#if defined(__STDC__) || defined(__cplusplus)
5453
#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);
5454
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5378
#else
5455
#else
5379
size_t iconv();
5456
size_t iconv();
Lines 5406-5411 Link Here
5406
#define ICONV_CONST $am_cv_proto_iconv_arg1
5483
#define ICONV_CONST $am_cv_proto_iconv_arg1
5407
_ACEOF
5484
_ACEOF
5408
5485
5486
5409
  fi
5487
  fi
5410
5488
5411
5489
Lines 6303-6313 Link Here
6303
int
6381
int
6304
main ()
6382
main ()
6305
{
6383
{
6306
/* FIXME: Include the comments suggested by Paul. */
6384
6307
#ifndef __cplusplus
6385
#ifndef __cplusplus
6308
  /* Ultrix mips cc rejects this.  */
6386
  /* Ultrix mips cc rejects this sort of thing.  */
6309
  typedef int charset[2];
6387
  typedef int charset[2];
6310
  const charset cs;
6388
  const charset cs = { 0, 0 };
6311
  /* SunOS 4.1.1 cc rejects this.  */
6389
  /* SunOS 4.1.1 cc rejects this.  */
6312
  char const *const *pcpcc;
6390
  char const *const *pcpcc;
6313
  char **ppc;
6391
  char **ppc;
Lines 6324-6331 Link Here
6324
  ++pcpcc;
6402
  ++pcpcc;
6325
  ppc = (char**) pcpcc;
6403
  ppc = (char**) pcpcc;
6326
  pcpcc = (char const *const *) ppc;
6404
  pcpcc = (char const *const *) ppc;
6327
  { /* SCO 3.2v4 cc rejects this.  */
6405
  { /* SCO 3.2v4 cc rejects this sort of thing.  */
6328
    char *t;
6406
    char tx;
6407
    char *t = &tx;
6329
    char const *s = 0 ? (char *) 0 : (char const *) 0;
6408
    char const *s = 0 ? (char *) 0 : (char const *) 0;
6330
6409
6331
    *t++ = 0;
6410
    *t++ = 0;
Lines 6341-6350 Link Here
6341
    iptr p = 0;
6420
    iptr p = 0;
6342
    ++p;
6421
    ++p;
6343
  }
6422
  }
6344
  { /* AIX XL C 1.02.0.0 rejects this saying
6423
  { /* 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. */
6424
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
6346
    struct s { int j; const int *ap[3]; };
6425
    struct s { int j; const int *ap[3]; } bx;
6347
    struct s *b; b->j = 5;
6426
    struct s *b = &bx; b->j = 5;
6348
  }
6427
  }
6349
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6428
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6350
    const int foo = 10;
6429
    const int foo = 10;
Lines 7161-7176 Link Here
7161
    # ... but there are two gotchas:
7240
    # ... but there are two gotchas:
7162
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
7241
    # 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.
7242
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
7164
    # In both cases, we have to default to `cp -p'.
7243
    # In both cases, we have to default to `cp -pR'.
7165
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
7244
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
7166
      as_ln_s='cp -p'
7245
      as_ln_s='cp -pR'
7167
  elif ln conf$$.file conf$$ 2>/dev/null; then
7246
  elif ln conf$$.file conf$$ 2>/dev/null; then
7168
    as_ln_s=ln
7247
    as_ln_s=ln
7169
  else
7248
  else
7170
    as_ln_s='cp -p'
7249
    as_ln_s='cp -pR'
7171
  fi
7250
  fi
7172
else
7251
else
7173
  as_ln_s='cp -p'
7252
  as_ln_s='cp -pR'
7174
fi
7253
fi
7175
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
7254
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
7176
rmdir conf$$.dir 2>/dev/null
7255
rmdir conf$$.dir 2>/dev/null
Lines 7230-7258 Link Here
7230
  as_mkdir_p=false
7309
  as_mkdir_p=false
7231
fi
7310
fi
7232
7311
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
7312
7313
# as_fn_executable_p FILE
7314
# -----------------------
7315
# Test if FILE is an executable regular file.
7316
as_fn_executable_p ()
7317
{
7318
  test -f "$1" && test -x "$1"
7319
} # as_fn_executable_p
7320
as_test_x='test -x'
7321
as_executable_p=as_fn_executable_p
7322
7256
# Sed expression to map a string onto a valid CPP name.
7323
# 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'"
7324
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
7258
7325
Lines 7272-7279 Link Here
7272
# report actual input values of CONFIG_FILES etc. instead of their
7339
# report actual input values of CONFIG_FILES etc. instead of their
7273
# values after options handling.
7340
# values after options handling.
7274
ac_log="
7341
ac_log="
7275
This file was extended by tcsh $as_me 6.18.01, which was
7342
This file was extended by tcsh $as_me 6.19.00, which was
7276
generated by GNU Autoconf 2.68.  Invocation command line was
7343
generated by GNU Autoconf 2.69.  Invocation command line was
7277
7344
7278
  CONFIG_FILES    = $CONFIG_FILES
7345
  CONFIG_FILES    = $CONFIG_FILES
7279
  CONFIG_HEADERS  = $CONFIG_HEADERS
7346
  CONFIG_HEADERS  = $CONFIG_HEADERS
Lines 7338-7348 Link Here
7338
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7405
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7339
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
7406
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
7340
ac_cs_version="\\
7407
ac_cs_version="\\
7341
tcsh config.status 6.18.01
7408
tcsh config.status 6.19.00
7342
configured by $0, generated by GNU Autoconf 2.68,
7409
configured by $0, generated by GNU Autoconf 2.69,
7343
  with options \\"\$ac_cs_config\\"
7410
  with options \\"\$ac_cs_config\\"
7344
7411
7345
Copyright (C) 2010 Free Software Foundation, Inc.
7412
Copyright (C) 2012 Free Software Foundation, Inc.
7346
This config.status script is free software; the Free Software Foundation
7413
This config.status script is free software; the Free Software Foundation
7347
gives unlimited permission to copy, distribute and modify it."
7414
gives unlimited permission to copy, distribute and modify it."
7348
7415
Lines 7431-7437 Link Here
7431
_ACEOF
7498
_ACEOF
7432
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7499
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
7433
if \$ac_cs_recheck; then
7500
if \$ac_cs_recheck; then
7434
  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
7501
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
7435
  shift
7502
  shift
7436
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
7503
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
7437
  CONFIG_SHELL='$SHELL'
7504
  CONFIG_SHELL='$SHELL'
Lines 8027-8033 Link Here
8027
    "./atconfig":C) cat >./atconfig <<ATEOF
8094
    "./atconfig":C) cat >./atconfig <<ATEOF
8028
# Configurable variable values for building test suites.
8095
# Configurable variable values for building test suites.
8029
# Generated by $0.
8096
# Generated by $0.
8030
# Copyright (C) 2010 Free Software Foundation, Inc.
8097
# Copyright (C) 2012 Free Software Foundation, Inc.
8031
8098
8032
# The test suite will define top_srcdir=$at_top_srcdir/../.. etc.
8099
# The test suite will define top_srcdir=$at_top_srcdir/../.. etc.
8033
at_testdir='.'
8100
at_testdir='.'
(-)contrib/tcsh/configure.ac (+495 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.6 2015/05/21 21:38:12 christos Exp $
11
12
AC_PREREQ([2.59])dnl Minimum Autoconf version required.
13
AC_INIT([tcsh], [6.19.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 Checks for libraries
310
AC_SEARCH_LIBS(crypt, crypt)
311
AC_SEARCH_LIBS(getspnam, sec)
312
AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
313
AC_SEARCH_LIBS(gethostbyname, nsl)
314
AC_SEARCH_LIBS(connect, socket)
315
AC_SEARCH_LIBS(catgets, catgets)
316
AM_ICONV
317
318
dnl Checks for header files
319
AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl
320
		 [shadow.h stdint.h utmp.h utmpx.h])
321
AC_CHECK_HEADERS([wchar.h],
322
	[AC_CHECK_SIZEOF([wchar_t], [], [dnl
323
#include <stdio.h>
324
#include <wchar.h>])
325
	AC_CHECK_HEADERS([wctype.h])])
326
AC_HEADER_DIRENT
327
AC_HEADER_STAT
328
AC_HEADER_STDC
329
330
dnl Checks for types
331
AC_CHECK_TYPES([long long])
332
AC_TYPE_GETGROUPS
333
AC_TYPE_MODE_T
334
AC_TYPE_SIZE_T
335
AC_TYPE_UID_T
336
AC_TYPE_UINT32_T
337
338
AC_DEFUN([AC_TYPE_SSIZE_T], [
339
AC_CHECK_TYPE(ssize_t,,
340
AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
341
[
342
#include <sys/types.h>
343
])
344
])
345
AC_TYPE_SSIZE_T
346
347
AC_DEFUN([AC_TYPE_SOCKLEN_T], [
348
AC_CHECK_TYPE(socklen_t,,
349
AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
350
[
351
#include <sys/types.h>
352
#include <sys/socket.h>
353
])
354
])
355
AC_TYPE_SOCKLEN_T
356
357
358
dnl Checks for structures
359
AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
360
[#ifdef HAVE_DIRENT_H
361
# include <dirent.h>
362
#else
363
# ifdef HAVE_NDIR_H
364
#  include <ndir.h>
365
# else
366
#  include <sys/dir.h>
367
# endif
368
# define dirent direct
369
#endif])
370
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
371
		  struct utmp.ut_xtime, struct utmpx.ut_host,
372
		  struct utmpx.ut_user, struct utmpx.ut_tv,
373
		  struct utmpx.ut_xtime], , ,
374
[#include <sys/types.h>
375
#ifdef HAVE_UTMPX_H
376
#include <utmpx.h>
377
#define utmp utmpx
378
#elif defined HAVE_UTMP_H
379
#include <utmp.h>
380
#endif])
381
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
382
[#include <sys/types.h>
383
#include <sys/socket.h>])
384
385
dnl Checks for compiler characteristics
386
AC_C_CONST
387
AC_C_VOLATILE
388
389
dnl checks for library functions
390
AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
391
[#include "config_p.h"
392
AC_INCLUDES_DEFAULT([])
393
#ifdef HAVE_CRYPT_H
394
#include <crypt.h>
395
#endif
396
])
397
AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
398
AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no])
399
AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl
400
	[getutent getutxent mallinfo memmove memset mkstemp nice] dnl
401
	[nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth])
402
AC_FUNC_GETPGRP
403
AC_FUNC_MBRTOWC
404
if test "x${cross_compiling}" != xyes ; then
405
  AC_FUNC_SETPGRP
406
else
407
  ac_cv_func_setpgrp_void=yes
408
fi
409
AC_FUNC_STRCOLL
410
411
dnl This is not good enough; we need sockaddr_storage too.
412
dnl See whether we can use IPv6 related functions
413
dnl AC_DEFUN([IPv6_CHECK_FUNC], [
414
dnl changequote(, )dnl
415
dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
416
dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
417
dnl changequote([, ])dnl
418
dnl AC_CHECK_FUNC($1, [dnl
419
dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
420
dnl   ac_cv_lib_inet6_$1=no], [dnl
421
dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
422
dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
423
dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
424
dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
425
dnl 	break
426
dnl       fi
427
dnl     done])dnl
428
dnl   AC_MSG_RESULT($ipv6_cv_dir)
429
dnl   if test $ipv6_cv_dir = no; then
430
dnl     ac_cv_lib_inet6_$1=no
431
dnl   else
432
dnl     if test x$ipv6_libinet6 = x; then
433
dnl       ipv6_libinet6=no
434
dnl       SAVELDFLAGS="$LDFLAGS"
435
dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
436
dnl     fi
437
dnl     AC_CHECK_LIB(inet6, $1, [dnl
438
dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
439
dnl       if test $ipv6_libinet6 = no; then
440
dnl 	ipv6_libinet6=yes
441
dnl 	LIBS="$LIBS -linet6"
442
dnl       fi],)dnl
443
dnl     if test $ipv6_libinet6 = no; then
444
dnl       LDFLAGS="$SAVELDFLAGS"
445
dnl     fi
446
dnl   fi])dnl
447
dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
448
dnl then
449
dnl   ipv6_cv_$1=yes
450
dnl   ifelse([$2], , :, [$2])
451
dnl else
452
dnl   ipv6_cv_$1=no
453
dnl   ifelse([$3], , :, [$3])
454
dnl fi])
455
dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
456
457
AC_SUBST(DFLAGS)
458
459
dnl Checks for system services
460
if test "$have_setlocale" != no; then
461
  AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
462
	        [], [enable_nls=yes])
463
  if test "x$enable_nls" != xno; then
464
    AC_DEFINE([NLS], [1], [Support NLS.])
465
  fi
466
fi
467
468
if test "x$enable_nls" != xno -a "$have_catgets" != no -a -n "$GENCAT" ; then
469
  AC_ARG_ENABLE([nls-catalogs], AS_HELP_STRING([--disable-nls-catalogs], [Disable NLS catalog support]),
470
	        [], [enable_nls_catalogs=yes])
471
  if test "x$enable_nls_catalogs" != xno; then
472
    BUILD_CATALOGS="yes"
473
    AC_DEFINE([NLS_CATALOGS], [1], [Support NLS catalogs.])
474
  fi
475
fi
476
477
AC_ARG_WITH(hesiod,
478
  [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
479
  [hesiod="$withval"], [hesiod=no])
480
if test "$hesiod" != no; then
481
  HESLIB="-lhesiod"
482
  AC_CHECK_FUNC(res_send, :,
483
    AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
484
  HESDEF=-DHESIOD
485
  if test "$hesiod" != yes; then
486
    HESDEF="$HESDEF -I$hesiod/include"
487
    HESLIB="-L$hesiod/lib $HESLIB"
488
  fi
489
fi
490
AC_SUBST(HESDEF)
491
AC_SUBST(HESLIB)
492
AC_SUBST(BUILD_CATALOGS)
493
494
AC_CONFIG_FILES([Makefile nls/Makefile])
495
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.3 2014/03/09 00:11:54 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 (-4 / +4 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.99 2014/03/09 00:20:26 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.99 2014/03/09 00:20:26 christos Exp $")
76
76
77
#include "ed.h"
77
#include "ed.h"
78
#include "tw.h"
78
#include "tw.h"
Lines 941-947 Link Here
941
941
942
/* Save InputBuf etc in SavedBuf etc for restore after cmd exec */
942
/* Save InputBuf etc in SavedBuf etc for restore after cmd exec */
943
static void
943
static void
944
c_save_inputbuf()
944
c_save_inputbuf(void)
945
{
945
{
946
    SavedBuf.len = 0;
946
    SavedBuf.len = 0;
947
    Strbuf_append(&SavedBuf, InputBuf);
947
    Strbuf_append(&SavedBuf, InputBuf);
Lines 953-959 Link Here
953
}
953
}
954
954
955
CCRETVAL
955
CCRETVAL
956
GetHistLine()
956
GetHistLine(void)
957
{
957
{
958
    struct Hist *hp;
958
    struct Hist *hp;
959
    int     h;
959
    int     h;
(-)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 (-3 / +3 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.50 2015/05/04 15:31:13 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.50 2015/05/04 15:31:13 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
/* #define DEBUG_UPDATE */
38
/* #define DEBUG_UPDATE */
Lines 1299-1305 Link Here
1299
    CursorV = 0;		/* clear the display buffer */
1299
    CursorV = 0;		/* clear the display buffer */
1300
    CursorH = 0;
1300
    CursorH = 0;
1301
    for (i = 0; i < TermV; i++)
1301
    for (i = 0; i < TermV; i++)
1302
	(void) memset(Display[i], 0, TermH * sizeof(Display[0][0]));
1302
	(void) memset(Display[i], 0, (TermH + 1) * sizeof(Display[0][0]));
1303
    OldvcV = 0;
1303
    OldvcV = 0;
1304
    litlen = 0;
1304
    litlen = 0;
1305
}
1305
}
(-)contrib/tcsh/ed.screen.c (-6 / +6 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.81 2014/03/15 21:25:11 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.81 2014/03/15 21:25:11 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 1625-1631 Link Here
1625
	if ((tptr = getenv("TERMCAP")) != NULL) {
1626
	if ((tptr = getenv("TERMCAP")) != NULL) {
1626
	    /* Leave 64 characters slop in case we enlarge the termcap string */
1627
	    /* Leave 64 characters slop in case we enlarge the termcap string */
1627
	    Char    termcap[TC_BUFSIZE+64], backup[TC_BUFSIZE+64], *ptr;
1628
	    Char    termcap[TC_BUFSIZE+64], backup[TC_BUFSIZE+64], *ptr;
1628
	    Char buf[4];
1629
1629
1630
	    ptr = str2short(tptr);
1630
	    ptr = str2short(tptr);
1631
	    (void) Strncpy(termcap, ptr, TC_BUFSIZE);
1631
	    (void) Strncpy(termcap, ptr, TC_BUFSIZE);
(-)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/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 (+1 lines)
Lines 433-438 Link Here
433
	    dest = copy;
433
	    dest = copy;
434
	    src = pattern;
434
	    src = pattern;
435
	    while (*src != EOS) {
435
	    while (*src != EOS) {
436
		/* Don't interpret quotes. The spec does not say we should do */
436
		if (*src == QUOTE) {
437
		if (*src == QUOTE) {
437
		    if (*++src == EOS)
438
		    if (*++src == EOS)
438
			--src;
439
			--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.60 2013/03/13 15:53:38 corinna 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.60 2013/03/13 15:53:38 corinna 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)				: "x86_64"
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/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/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\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/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.185 2015/05/21 21:38:12 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 19
11
#define PATCHLEVEL 1
11
#define PATCHLEVEL 0
12
#define DATE "2012-02-14"
12
#define DATE "2015-05-21"
13
13
14
#endif /* _h_patchlevel */
14
#endif /* _h_patchlevel */
(-)contrib/tcsh/sh.c (-7 / +19 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.185 2015/05/10 13:28: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.185 2015/05/10 13:28: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 355-360 Link Here
355
357
356
    /* Default history size to 100 */
358
    /* Default history size to 100 */
357
    setcopy(STRhistory, str2short("100"), VAR_READWRITE);
359
    setcopy(STRhistory, str2short("100"), VAR_READWRITE);
360
    sethistory(100);
358
361
359
    tempv = argv;
362
    tempv = argv;
360
    ffile = SAVE(tempv[0]);
363
    ffile = SAVE(tempv[0]);
Lines 477-482 Link Here
477
     */
480
     */
478
    initdesc();
481
    initdesc();
479
482
483
    cdtohome = 1;
484
    setv(STRcdtohome, SAVE(""), VAR_READWRITE);
485
480
    /*
486
    /*
481
     * Get and set the tty now
487
     * Get and set the tty now
482
     */
488
     */
Lines 493-498 Link Here
493
    }
499
    }
494
    else
500
    else
495
	setv(STRtty, cp = SAVE(""), VAR_READWRITE);
501
	setv(STRtty, cp = SAVE(""), VAR_READWRITE);
502
496
    /*
503
    /*
497
     * Initialize the shell variables. ARGV and PROMPT are initialized later.
504
     * Initialize the shell variables. ARGV and PROMPT are initialized later.
498
     * STATUS is also munged in several places. CHILD is munged when
505
     * STATUS is also munged in several places. CHILD is munged when
Lines 797-802 Link Here
797
#ifdef COLOR_LS_F
804
#ifdef COLOR_LS_F
798
    if ((tcp = getenv("LS_COLORS")) != NULL)
805
    if ((tcp = getenv("LS_COLORS")) != NULL)
799
	parseLS_COLORS(str2short(tcp));
806
	parseLS_COLORS(str2short(tcp));
807
    if ((tcp = getenv("LSCOLORS")) != NULL)
808
	parseLSCOLORS(str2short(tcp));
800
#endif /* COLOR_LS_F */
809
#endif /* COLOR_LS_F */
801
810
802
    doldol = putn((tcsh_number_t)getpid());	/* For $$ */
811
    doldol = putn((tcsh_number_t)getpid());	/* For $$ */
Lines 818-824 Link Here
818
#else /* !WINNT_NATIVE */
827
#else /* !WINNT_NATIVE */
819
#ifdef HAVE_MKSTEMP
828
#ifdef HAVE_MKSTEMP
820
    {
829
    {
821
	char *tmpdir = getenv ("TMPDIR");
830
	const char *tmpdir = getenv ("TMPDIR");
822
	if (!tmpdir)
831
	if (!tmpdir)
823
	    tmpdir = "/tmp";
832
	    tmpdir = "/tmp";
824
	shtemp = Strspl(SAVE(tmpdir), SAVE("/sh" TMP_TEMPLATE)); /* For << */
833
	shtemp = Strspl(SAVE(tmpdir), SAVE("/sh" TMP_TEMPLATE)); /* For << */
Lines 1215-1221 Link Here
1215
1224
1216
#ifdef NeXT
1225
#ifdef NeXT
1217
	    /* NeXT 2.0 /usr/etc/rlogind, does not set our process group! */
1226
	    /* NeXT 2.0 /usr/etc/rlogind, does not set our process group! */
1218
	    if (shpgrp == 0) {
1227
	    if (f != -1 && shpgrp == 0) {
1219
	        shpgrp = getpid();
1228
	        shpgrp = getpid();
1220
		(void) setpgid(0, shpgrp);
1229
		(void) setpgid(0, shpgrp);
1221
	        (void) tcsetpgrp(f, shpgrp);
1230
	        (void) tcsetpgrp(f, shpgrp);
Lines 1222-1228 Link Here
1222
	    }
1231
	    }
1223
#endif /* NeXT */
1232
#endif /* NeXT */
1224
#ifdef BSDJOBS			/* if we have tty job control */
1233
#ifdef BSDJOBS			/* if we have tty job control */
1225
	    if (grabpgrp(f, shpgrp) != -1) {
1234
	    if (f != -1 && grabpgrp(f, shpgrp) != -1) {
1226
		/*
1235
		/*
1227
		 * Thanks to Matt Day for the POSIX references, and to
1236
		 * Thanks to Matt Day for the POSIX references, and to
1228
		 * Paul Close for the SGI clarification.
1237
		 * Paul Close for the SGI clarification.
Lines 1904-1909 Link Here
1904
    {
1913
    {
1905
	(void) Cookedmode();
1914
	(void) Cookedmode();
1906
	GettingInput = 0;
1915
	GettingInput = 0;
1916
	if (evalvec)
1917
	    doneinp = 1;
1907
    }
1918
    }
1908
    drainoline();
1919
    drainoline();
1909
#ifdef HAVE_GETPWENT
1920
#ifdef HAVE_GETPWENT
Lines 2178-2183 Link Here
2178
    cleanup_push(file, xfree);
2189
    cleanup_push(file, xfree);
2179
    xfree(f);
2190
    xfree(f);
2180
    t = glob_all_or_error(t);
2191
    t = glob_all_or_error(t);
2192
    cleanup_push(t, blk_cleanup);
2181
    if ((!srcfile(file, 0, hflg, t)) && (!hflg) && (!bequiet))
2193
    if ((!srcfile(file, 0, hflg, t)) && (!hflg) && (!bequiet))
2182
	stderror(ERR_SYSTEM, file, strerror(errno));
2194
	stderror(ERR_SYSTEM, file, strerror(errno));
2183
    cleanup_until(file);
2195
    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 / +3 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.64 2013/12/08 22:53: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 221-226 Link Here
221
extern	void		  rechist	(Char *, int);
222
extern	void		  rechist	(Char *, int);
222
extern	void		  loadhist	(Char *, int);
223
extern	void		  loadhist	(Char *, int);
223
extern	void		  displayHistStats(const char *);
224
extern	void		  displayHistStats(const char *);
225
extern	void		  sethistory	(int);
224
226
225
/*
227
/*
226
 * sh.init.c
228
 * sh.init.c
(-)contrib/tcsh/sh.dir.c (-3 / +5 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.84 2014/10/28 18:40:46 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.84 2014/10/28 18:40:46 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);
(-)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 (-6 / +6 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.56 2014/08/17 02:56:37 amold 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.56 2014/08/17 02:56:37 amold Exp $")
38
38
39
/*
39
/*
40
 * C Shell
40
 * C Shell
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 (-3 / +10 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.80 2014/07/11 14:57:55 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.80 2014/07/11 14:57:55 christos Exp $")
36
36
37
#include "tc.h"
37
#include "tc.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 1070-1075 Link Here
1070
{
1070
{
1071
    int found = 1;
1071
    int found = 1;
1072
    USE(c);
1072
    USE(c);
1073
1074
    if (adrof(STRautorehash))
1075
	dohash(NULL, NULL);
1073
    for (v++; *v; v++)
1076
    for (v++; *v; v++)
1074
	found &= find_cmd(*v, 1);
1077
	found &= find_cmd(*v, 1);
1075
    /* Make status nonzero if any command is not found. */
1078
    /* Make status nonzero if any command is not found. */
Lines 1166-1172 Link Here
1166
		return rval;
1169
		return rval;
1167
	}
1170
	}
1168
    }
1171
    }
1169
    if (adrof(STRautorehash) && !rehashed && havhash) {
1172
    /*
1173
     * If we are printing, we are being called from dowhere() which it 
1174
     * has rehashed already
1175
     */
1176
    if (!prt && adrof(STRautorehash) && !rehashed && havhash) {
1170
	dohash(NULL, NULL);
1177
	dohash(NULL, NULL);
1171
	rehashed = 1;
1178
	rehashed = 1;
1172
	goto retry;
1179
	goto retry;
(-)contrib/tcsh/sh.exp.c (-5 / +6 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.61 2012/11/28 13:45:11 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.61 2012/11/28 13:45:11 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;
(-)contrib/tcsh/sh.file.c (-3 / +3 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.38 2015/03/07 18:07:46 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.38 2015/03/07 18:07:46 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 |
(-)contrib/tcsh/sh.func.c (-6 / +36 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.173 2015/05/04 17:10:45 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.173 2015/05/04 17:10:45 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 1381-1387 Link Here
1381
	stderror(ERR_NAME | ERR_VARBEGIN);
1388
	stderror(ERR_NAME | ERR_VARBEGIN);
1382
    do {
1389
    do {
1383
	lp++;
1390
	lp++;
1384
    } while (alnum(*lp));
1391
    } while (alnum(*lp) || *lp == '.');
1385
    if (*lp != '\0')
1392
    if (*lp != '\0')
1386
	stderror(ERR_NAME | ERR_VARALNUM);
1393
	stderror(ERR_NAME | ERR_VARALNUM);
1387
1394
Lines 1543-1548 Link Here
1543
	cleanup_until(lp);
1550
	cleanup_until(lp);
1544
	return;
1551
	return;
1545
    }
1552
    }
1553
    if (eq(vp, STRLSCOLORS)) {
1554
        parseLSCOLORS(lp);
1555
	cleanup_until(lp);
1556
	return;
1557
    }
1546
#endif /* COLOR_LS_F */
1558
#endif /* COLOR_LS_F */
1547
1559
1548
#ifdef SIG_WINDOW
1560
#ifdef SIG_WINDOW
Lines 1670-1675 Link Here
1670
#ifdef COLOR_LS_F
1682
#ifdef COLOR_LS_F
1671
		else if (eq(name, STRLS_COLORS))
1683
		else if (eq(name, STRLS_COLORS))
1672
		    parseLS_COLORS(n);
1684
		    parseLS_COLORS(n);
1685
		else if (eq(name, STRLSCOLORS))
1686
		    parseLSCOLORS(n);
1673
#endif /* COLOR_LS_F */
1687
#endif /* COLOR_LS_F */
1674
#ifdef NLS_CATALOGS
1688
#ifdef NLS_CATALOGS
1675
		else if (eq(name, STRNLSPATH)) {
1689
		else if (eq(name, STRNLSPATH)) {
Lines 1927-1932 Link Here
1927
    { RLIMIT_NOFILE, 	"descriptors", 1,	""		},
1941
    { RLIMIT_NOFILE, 	"descriptors", 1,	""		},
1928
# endif /* RLIMIT_NOFILE */
1942
# endif /* RLIMIT_NOFILE */
1929
1943
1944
# ifdef RLIMIT_NPTS
1945
    { RLIMIT_NPTS,	"pseudoterminals", 1,	""		},
1946
# endif /* RLIMIT_NPTS */
1947
1948
# ifdef RLIMIT_KQUEUES
1949
    { RLIMIT_KQUEUES,	"kqueues",	1,	""		},
1950
# endif /* RLIMIT_KQUEUES */
1951
1930
# ifdef RLIMIT_CONCUR
1952
# ifdef RLIMIT_CONCUR
1931
    { RLIMIT_CONCUR, 	"concurrency", 1,	"thread(s)"	},
1953
    { RLIMIT_CONCUR, 	"concurrency", 1,	"thread(s)"	},
1932
# endif /* RLIMIT_CONCUR */
1954
# endif /* RLIMIT_CONCUR */
Lines 1939-1944 Link Here
1939
    { RLIMIT_NPROC,	"maxproc",	1,	""		},
1961
    { RLIMIT_NPROC,	"maxproc",	1,	""		},
1940
# endif /* RLIMIT_NPROC */
1962
# endif /* RLIMIT_NPROC */
1941
1963
1964
# ifdef RLIMIT_NTHR
1965
    { RLIMIT_NTHR,	"maxthread",	1,	""		},
1966
# endif /* RLIMIT_NTHR */
1967
1942
# if defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
1968
# if defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
1943
    { RLIMIT_OFILE,	"openfiles",	1,	""		},
1969
    { RLIMIT_OFILE,	"openfiles",	1,	""		},
1944
# endif /* RLIMIT_OFILE && !defined(RLIMIT_NOFILE) */
1970
# endif /* RLIMIT_OFILE && !defined(RLIMIT_NOFILE) */
Lines 1955-1960 Link Here
1955
    { RLIMIT_LOCKS,	"maxlocks",	1,	""		}, 
1981
    { RLIMIT_LOCKS,	"maxlocks",	1,	""		}, 
1956
# endif /* RLIMIT_LOCKS */ 
1982
# endif /* RLIMIT_LOCKS */ 
1957
1983
1984
# ifdef RLIMIT_POSIXLOCKS
1985
    { RLIMIT_POSIXLOCKS,"posixlocks",	1,	""		},
1986
# endif /* RLIMIT_POSIXLOCKS */
1987
1958
# ifdef RLIMIT_SIGPENDING 
1988
# ifdef RLIMIT_SIGPENDING 
1959
    { RLIMIT_SIGPENDING,"maxsignal",	1,	""		}, 
1989
    { RLIMIT_SIGPENDING,"maxsignal",	1,	""		}, 
1960
# endif /* RLIMIT_SIGPENDING */ 
1990
# endif /* RLIMIT_SIGPENDING */ 
(-)contrib/tcsh/sh.glob.c (-6 / +5 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.89 2015/05/05 14:27:20 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.89 2015/05/05 14:27:20 christos Exp $")
36
36
37
#include "tc.h"
37
#include "tc.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 781-793 Link Here
781
		stderror(ERR_OLD);
781
		stderror(ERR_OLD);
782
	    alias(&paraml);
782
	    alias(&paraml);
783
	    t = syntax(paraml.next, &paraml, 0);
783
	    t = syntax(paraml.next, &paraml, 0);
784
	    if (t == NULL)
785
		return;
786
	    cleanup_push(t, syntax_cleanup);
784
	    cleanup_push(t, syntax_cleanup);
787
	    /* The F_BACKQ flag must set so the job output is correct if
785
	    /* 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
786
	     * printexitvalue is set.  If it's not set, the job output
789
	     * will have "Exit N" appended where N is the exit status. */
787
	     * will have "Exit N" appended where N is the exit status. */
790
	    t->t_dflg = F_BACKQ|F_NOFORK;
788
	    if (t)
789
		    t->t_dflg = F_BACKQ|F_NOFORK;
791
	    if (seterr)
790
	    if (seterr)
792
		stderror(ERR_OLD);
791
		stderror(ERR_OLD);
793
#ifdef SIGTSTP
792
#ifdef SIGTSTP
Lines 881-887 Link Here
881
	if (c != 0 && (cnt || literal))
880
	if (c != 0 && (cnt || literal))
882
	    pword(bb, word);
881
	    pword(bb, word);
883
	hadnl = 0;
882
	hadnl = 0;
884
    } while (c > 0);
883
    } while (c >= 0);
885
 eof:
884
 eof:
886
    cleanup_until(&pvec[0]);
885
    cleanup_until(&pvec[0]);
887
    pwait();
886
    pwait();
(-)contrib/tcsh/sh.h (-26 / +12 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.174 2015/05/10 13:29:28 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 428-436 Link Here
428
# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
433
# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
429
#  if !defined(__APPLE__) /* Damnit, where is getnameinfo() folks? */
434
#  if !defined(__APPLE__) /* Damnit, where is getnameinfo() folks? */
430
#   if !defined(sgi)
435
#   if !defined(sgi)
431
#    if !defined(__CYGWIN__)
436
#    define INET6
432
#     define INET6
433
#    endif /* __CYGWIN__ */
434
#   endif /* sgi */
437
#   endif /* sgi */
435
#  endif /* __APPLE__ */
438
#  endif /* __APPLE__ */
436
# endif
439
# endif
Lines 440-460 Link Here
440
#ifdef PURIFY
443
#ifdef PURIFY
441
/* exit normally, allowing purify to trace leaks */
444
/* exit normally, allowing purify to trace leaks */
442
# define _exit		exit
445
# define _exit		exit
443
typedef  int		pret_t;
446
#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
447
459
/*
448
/*
460
 * ASCII vs. EBCDIC
449
 * ASCII vs. EBCDIC
Lines 573-579 Link Here
573
EXTERN int    noexec IZERO;	/* Don't execute, just syntax check */
562
EXTERN int    noexec IZERO;	/* Don't execute, just syntax check */
574
EXTERN int    pjobs IZERO;	/* want to print jobs if interrupted */
563
EXTERN int    pjobs IZERO;	/* want to print jobs if interrupted */
575
EXTERN int    setintr IZERO;	/* Set interrupts on/off -> Wait intr... */
564
EXTERN int    setintr IZERO;	/* Set interrupts on/off -> Wait intr... */
576
EXTERN int    handle_intr IZERO;/* Are we currently handling an interrupt? */
565
EXTERN int    handle_interrupt IZERO;/* Are we currently handling an interrupt? */
577
EXTERN int    havhash IZERO;	/* path hashing is available */
566
EXTERN int    havhash IZERO;	/* path hashing is available */
578
EXTERN int    editing IZERO;	/* doing filename expansion and line editing */
567
EXTERN int    editing IZERO;	/* doing filename expansion and line editing */
579
EXTERN int    noediting IZERO;	/* initial $term defaulted to noedit */
568
EXTERN int    noediting IZERO;	/* initial $term defaulted to noedit */
Lines 585-591 Link Here
585
EXTERN int    is1atty IZERO;	/* is file descriptor 1 a tty (didfds mode) */
574
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) */
575
EXTERN int    is2atty IZERO;	/* is file descriptor 2 a tty (didfds mode) */
587
EXTERN int    arun IZERO;	/* Currently running multi-line-aliases */
576
EXTERN int    arun IZERO;	/* Currently running multi-line-aliases */
588
EXTERN int     implicit_cd IZERO;/* implicit cd enabled?(1=enabled,2=verbose) */
577
EXTERN int    implicit_cd IZERO;/* implicit cd enabled?(1=enabled,2=verbose) */
578
EXTERN int    cdtohome IZERO;	/* cd without args goes home */
589
EXTERN int    inheredoc IZERO;	/* Currently parsing a heredoc */
579
EXTERN int    inheredoc IZERO;	/* Currently parsing a heredoc */
590
/* We received a window change event */
580
/* We received a window change event */
591
EXTERN volatile sig_atomic_t windowchg IZERO;
581
EXTERN volatile sig_atomic_t windowchg IZERO;
Lines 1020-1029 Link Here
1020
 * Filename/command name expansion variables
1010
 * Filename/command name expansion variables
1021
 */
1011
 */
1022
1012
1023
#ifdef __CYGWIN__
1024
# undef MAXPATHLEN
1025
#endif /* __CYGWIN__ */
1026
1027
#ifndef MAXPATHLEN
1013
#ifndef MAXPATHLEN
1028
# ifdef PATH_MAX
1014
# ifdef PATH_MAX
1029
#  define MAXPATHLEN PATH_MAX
1015
#  define MAXPATHLEN PATH_MAX
Lines 1065-1071 Link Here
1065
    unsigned Hhash;                     /* hash value of command line */
1051
    unsigned Hhash;                     /* hash value of command line */
1066
}       Histlist IZERO_STRUCT;
1052
}       Histlist IZERO_STRUCT;
1067
1053
1068
EXTERN struct wordent paraml;	/* Current lexical word list */
1054
extern struct wordent paraml;	/* Current lexical word list */
1069
EXTERN int     eventno;		/* Next events number */
1055
EXTERN int     eventno;		/* Next events number */
1070
EXTERN int     lastev;		/* Last event reference (default) */
1056
EXTERN int     lastev;		/* Last event reference (default) */
1071
1057
(-)contrib/tcsh/sh.hist.c (-44 / +88 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.60 2015/02/22 21:59:00 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.60 2015/02/22 21:59:00 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 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.misc.c (-14 / +26 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.49 2015/05/04 15:31:13 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.49 2015/05/04 15:31:13 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 533-539 Link Here
533
    if (fildes < 0)
533
    if (fildes < 0)
534
	return;
534
	return;
535
    while (close(fildes) == -1 && errno == EINTR)
535
    while (close(fildes) == -1 && errno == EINTR)
536
	handle_pending_signals();
536
	if (handle_pending_signals())
537
	    break;
537
}
538
}
538
539
539
void
540
void
Lines 540-546 Link Here
540
xclosedir(DIR *dirp)
541
xclosedir(DIR *dirp)
541
{
542
{
542
    while (closedir(dirp) == -1 && errno == EINTR)
543
    while (closedir(dirp) == -1 && errno == EINTR)
543
	handle_pending_signals();
544
	if (handle_pending_signals())
545
	    break;
544
}
546
}
545
547
546
int
548
int
Lines 549-555 Link Here
549
    int res;
551
    int res;
550
552
551
    while ((res = creat(path, mode)) == -1 && errno == EINTR)
553
    while ((res = creat(path, mode)) == -1 && errno == EINTR)
552
	handle_pending_signals();
554
	if (handle_pending_signals())
555
	    break;
553
    return res;
556
    return res;
554
}
557
}
555
558
Lines 560-566 Link Here
560
    int res;
563
    int res;
561
564
562
    while ((res = dup2(fildes, fildes2)) == -1 && errno == EINTR)
565
    while ((res = dup2(fildes, fildes2)) == -1 && errno == EINTR)
563
	handle_pending_signals();
566
	if (handle_pending_signals())
567
	    break;
564
    return res;
568
    return res;
565
}
569
}
566
#endif
570
#endif
Lines 572-578 Link Here
572
576
573
    errno = 0;
577
    errno = 0;
574
    while ((res = getgrgid(xgid)) == NULL && errno == EINTR) {
578
    while ((res = getgrgid(xgid)) == NULL && errno == EINTR) {
575
	handle_pending_signals();
579
	if (handle_pending_signals())
580
	    break;
576
	errno = 0;
581
	errno = 0;
577
    }
582
    }
578
    return res;
583
    return res;
Lines 585-591 Link Here
585
590
586
    errno = 0;
591
    errno = 0;
587
    while ((res = getpwnam(name)) == NULL && errno == EINTR) {
592
    while ((res = getpwnam(name)) == NULL && errno == EINTR) {
588
	handle_pending_signals();
593
	if (handle_pending_signals())
594
	    break;
589
	errno = 0;
595
	errno = 0;
590
    }
596
    }
591
    return res;
597
    return res;
Lines 598-604 Link Here
598
604
599
    errno = 0;
605
    errno = 0;
600
    while ((res = getpwuid(xuid)) == NULL && errno == EINTR) {
606
    while ((res = getpwuid(xuid)) == NULL && errno == EINTR) {
601
	handle_pending_signals();
607
	if (handle_pending_signals())
608
	    break;
602
	errno = 0;
609
	errno = 0;
603
    }
610
    }
604
    return res;
611
    return res;
Lines 611-617 Link Here
611
618
612
    if ((oflag & O_CREAT) == 0) {
619
    if ((oflag & O_CREAT) == 0) {
613
	while ((res = open(path, oflag)) == -1 && errno == EINTR)
620
	while ((res = open(path, oflag)) == -1 && errno == EINTR)
614
	    handle_pending_signals();
621
	    if (handle_pending_signals())
622
		break;
615
    } else {
623
    } else {
616
	va_list ap;
624
	va_list ap;
617
	mode_t mode;
625
	mode_t mode;
Lines 623-629 Link Here
623
	mode = va_arg(ap, int);
631
	mode = va_arg(ap, int);
624
	va_end(ap);
632
	va_end(ap);
625
	while ((res = open(path, oflag, mode)) == -1 && errno == EINTR)
633
	while ((res = open(path, oflag, mode)) == -1 && errno == EINTR)
626
	    handle_pending_signals();
634
	    if (handle_pending_signals())
635
		break;
627
    }
636
    }
628
    return res;
637
    return res;
629
}
638
}
Lines 636-642 Link Here
636
    /* This is where we will be blocked most of the time, so handle signals
645
    /* This is where we will be blocked most of the time, so handle signals
637
       that didn't interrupt any system call. */
646
       that didn't interrupt any system call. */
638
    do
647
    do
639
      handle_pending_signals();
648
      if (handle_pending_signals())
649
	  break;
640
    while ((res = read(fildes, buf, nbyte)) == -1 && errno == EINTR);
650
    while ((res = read(fildes, buf, nbyte)) == -1 && errno == EINTR);
641
    return res;
651
    return res;
642
}
652
}
Lines 649-655 Link Here
649
659
650
    while ((res = tcsetattr(fildes, optional_actions, termios_p)) == -1 &&
660
    while ((res = tcsetattr(fildes, optional_actions, termios_p)) == -1 &&
651
	   errno == EINTR)
661
	   errno == EINTR)
652
	handle_pending_signals();
662
	if (handle_pending_signals())
663
	    break;
653
    return res;
664
    return res;
654
}
665
}
655
#endif
666
#endif
Lines 662-668 Link Here
662
    /* This is where we will be blocked most of the time, so handle signals
673
    /* This is where we will be blocked most of the time, so handle signals
663
       that didn't interrupt any system call. */
674
       that didn't interrupt any system call. */
664
    do
675
    do
665
      handle_pending_signals();
676
      if (handle_pending_signals())
677
	  break;
666
    while ((res = write(fildes, buf, nbyte)) == -1 && errno == EINTR);
678
    while ((res = write(fildes, buf, nbyte)) == -1 && errno == EINTR);
667
    return res;
679
    return res;
668
}
680
}
(-)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 (-6 / +33 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.127 2015/02/22 21:40:14 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.127 2015/02/22 21:40:14 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tc.h"
38
#include "tc.h"
Lines 507-512 Link Here
507
    cleanup_push(&oset, sigprocmask_cleanup);
507
    cleanup_push(&oset, sigprocmask_cleanup);
508
    pause_mask = oset;
508
    pause_mask = oset;
509
    sigdelset(&pause_mask, SIGCHLD);
509
    sigdelset(&pause_mask, SIGCHLD);
510
    sigaddset(&pause_mask, SIGINT);
510
    for (;;) {
511
    for (;;) {
511
	(void)handle_pending_signals();
512
	(void)handle_pending_signals();
512
	jobflags = 0;
513
	jobflags = 0;
Lines 593-614 Link Here
593
dowait(Char **v, struct command *c)
594
dowait(Char **v, struct command *c)
594
{
595
{
595
    struct process *pp;
596
    struct process *pp;
597
598
    /* the current block mask to be able to restore */
599
    sigset_t old_mask;
600
601
    /* block mask for critical section: OLD_MASK U {SIGCHLD} */
602
    sigset_t block_mask;
603
604
    /* ignore those during blocking sigsuspend:
605
       OLD_MASK / {SIGCHLD, possibly(SIGINT)} */
596
    sigset_t pause_mask;
606
    sigset_t pause_mask;
607
597
    int opintr_disabled, gotsig;
608
    int opintr_disabled, gotsig;
598
609
599
    USE(c);
610
    USE(c);
600
    USE(v);
611
    USE(v);
601
    pjobs++;
612
    pjobs++;
613
602
    sigprocmask(SIG_BLOCK, NULL, &pause_mask);
614
    sigprocmask(SIG_BLOCK, NULL, &pause_mask);
603
    sigdelset(&pause_mask, SIGCHLD);
615
    sigdelset(&pause_mask, SIGCHLD);
604
    if (setintr)
616
    if (setintr)
605
	sigdelset(&pause_mask, SIGINT);
617
	sigdelset(&pause_mask, SIGINT);
618
619
    /* critical section, block also SIGCHLD */
620
    sigprocmask(SIG_BLOCK, NULL, &block_mask);
621
    sigaddset(&block_mask, SIGCHLD);
622
    sigprocmask(SIG_BLOCK, &block_mask, &old_mask);
623
624
    /* detect older SIGCHLDs and remove PRUNNING flag from proclist */
625
    (void)handle_pending_signals();
626
606
loop:
627
loop:
607
    for (pp = proclist.p_next; pp; pp = pp->p_next)
628
    for (pp = proclist.p_next; pp; pp = pp->p_next)
608
	if (pp->p_procid &&	/* pp->p_procid == pp->p_jobid && */
629
	if (pp->p_procid &&	/* pp->p_procid == pp->p_jobid && */
609
	    pp->p_flags & PRUNNING) {
630
	    pp->p_flags & PRUNNING) {
610
	    (void)handle_pending_signals();
631
	    /* wait for (or pick up alredy blocked) SIGCHLD */
611
	    sigsuspend(&pause_mask);
632
	    sigsuspend(&pause_mask);
633
634
	    /* make the 'wait' interuptable by CTRL-C */
612
	    opintr_disabled = pintr_disabled;
635
	    opintr_disabled = pintr_disabled;
613
	    pintr_disabled = 0;
636
	    pintr_disabled = 0;
614
	    gotsig = handle_pending_signals();
637
	    gotsig = handle_pending_signals();
Lines 618-623 Link Here
618
	    goto loop;
641
	    goto loop;
619
	}
642
	}
620
    pjobs = 0;
643
    pjobs = 0;
644
645
    sigprocmask(SIG_SETMASK, &old_mask, NULL);
621
}
646
}
622
647
623
/*
648
/*
Lines 978-983 Link Here
978
    tp = pp;
1003
    tp = pp;
979
    status = reason = -1;
1004
    status = reason = -1;
980
    jobflags = 0;
1005
    jobflags = 0;
1006
    haderr = 1;	/* Print statuc to stderr */
981
    do {
1007
    do {
982
#ifdef BACKPIPE
1008
#ifdef BACKPIPE
983
	/*
1009
	/*
Lines 1186-1191 Link Here
1186
	    xprintf("       ");
1212
	    xprintf("       ");
1187
	ptprint(tp);
1213
	ptprint(tp);
1188
    }
1214
    }
1215
    haderr = 0;
1189
    return (jobflags);
1216
    return (jobflags);
1190
}
1217
}
1191
1218
Lines 1833-1844 Link Here
1833
	    (void) signal(SIGHUP, SIG_IGN);
1860
	    (void) signal(SIGHUP, SIG_IGN);
1834
	if (t->t_dflg & F_NICE) {
1861
	if (t->t_dflg & F_NICE) {
1835
	    int nval = SIGN_EXTEND_CHAR(t->t_nice);
1862
	    int nval = SIGN_EXTEND_CHAR(t->t_nice);
1836
#ifdef HAVE_SETPRIORITY
1863
#if defined(HAVE_SETPRIORITY) && defined(PRIO_PROCESS)
1837
	    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
1864
	    if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
1838
		stderror(ERR_SYSTEM, "setpriority", strerror(errno));
1865
		stderror(ERR_SYSTEM, "setpriority", strerror(errno));
1839
#else /* !HAVE_SETPRIORITY */
1866
#else /* !HAVE_SETPRIORITY || !PRIO_PROCESS */
1840
	    (void) nice(nval);
1867
	    (void) nice(nval);
1841
#endif /* !HAVE_SETPRIORITY */
1868
#endif /* HAVE_SETPRIORITY  && PRIO_PROCESS */
1842
	}
1869
	}
1843
#ifdef F_VER
1870
#ifdef F_VER
1844
        if (t->t_dflg & F_VER) {
1871
        if (t->t_dflg & F_VER) {
(-)contrib/tcsh/sh.sem.c (-9 / +20 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.88 2014/09/08 18:52:15 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.88 2014/09/08 18:52:15 christos Exp $")
37
37
38
#include "tc.h"
38
#include "tc.h"
39
#include "tw.h"
39
#include "tw.h"
Lines 346-355 Link Here
346
	 * not pipedout, niced, nohupped, or &'d. It would be nice(?) to not
346
	 * not pipedout, niced, nohupped, or &'d. It would be nice(?) to not
347
	 * fork in some of these cases.
347
	 * fork in some of these cases.
348
	 */
348
	 */
349
	/*
350
	 * Prevent forking cd, pushd, popd, chdir cause this will cause the
351
	 * shell not to change dir!
352
	 */
353
#ifdef BACKPIPE
349
#ifdef BACKPIPE
354
	/*
350
	/*
355
	 * Can't have NOFORK for the tail of a pipe - because it is not the
351
	 * Can't have NOFORK for the tail of a pipe - because it is not the
Lines 358-368 Link Here
358
	 */
354
	 */
359
	if (t->t_dflg & F_PIPEIN)
355
	if (t->t_dflg & F_PIPEIN)
360
	    t->t_dflg &= ~(F_NOFORK);
356
	    t->t_dflg &= ~(F_NOFORK);
357
#else
358
	/*
359
	 * "command | builtin" may cause major misbehaviour as noted in
360
	 * in the BUGS file entry
361
	 * Subject: Redirected input to built-in functions misbehaves badly
362
	 * forking when the builtin is the end of the pipe corrects the
363
	 * problem.
364
	 */
365
	if (bifunc && (t->t_dflg & F_PIPEIN))
366
	    t->t_dflg &= ~(F_NOFORK);
361
#endif /* BACKPIPE */
367
#endif /* BACKPIPE */
368
	/*
369
	 * Prevent forking cd, pushd, popd, chdir cause this will cause the
370
	 * shell not to change dir! (XXX: but only for nice?)
371
	 */
362
	if (bifunc && (bifunc->bfunct == (bfunc_t)dochngd ||
372
	if (bifunc && (bifunc->bfunct == (bfunc_t)dochngd ||
363
		       bifunc->bfunct == (bfunc_t)dopushd ||
373
		       bifunc->bfunct == (bfunc_t)dopushd ||
364
		       bifunc->bfunct == (bfunc_t)dopopd))
374
		       bifunc->bfunct == (bfunc_t)dopopd))
365
	    t->t_dflg &= ~(F_NICE);
375
	    t->t_dflg &= ~(F_NICE);
376
366
	if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
377
	if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
367
	     (!bifunc || t->t_dflg &
378
	     (!bifunc || t->t_dflg &
368
	      (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP | F_HUP)))) ||
379
	      (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP | F_HUP)))) ||
Lines 560-572 Link Here
560
			(void) signal(SIGHUP, SIG_DFL);
571
			(void) signal(SIGHUP, SIG_DFL);
561
		    if (t->t_dflg & F_NICE) {
572
		    if (t->t_dflg & F_NICE) {
562
			int nval = SIGN_EXTEND_CHAR(t->t_nice);
573
			int nval = SIGN_EXTEND_CHAR(t->t_nice);
563
# ifdef HAVE_SETPRIORITY
574
# if defined(HAVE_SETPRIORITY) && defined(PRIO_PROCESS)
564
			if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
575
			if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
565
				stderror(ERR_SYSTEM, "setpriority",
576
				stderror(ERR_SYSTEM, "setpriority",
566
				    strerror(errno));
577
				    strerror(errno));
567
# else /* !HAVE_SETPRIORITY */
578
# else /* !HAVE_SETPRIORITY || !PRIO_PROCESS */
568
			(void) nice(nval);
579
			(void) nice(nval);
569
# endif /* HAVE_SETPRIORITY */
580
# endif /* HAVE_SETPRIORITY && PRIO_PROCESS */
570
		    }
581
		    }
571
# ifdef F_VER
582
# ifdef F_VER
572
		    if (t->t_dflg & F_VER) {
583
		    if (t->t_dflg & F_VER) {
(-)contrib/tcsh/sh.set.c (-2 / +12 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.86 2014/10/28 18:40:46 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.86 2014/10/28 18:40:46 christos Exp $")
36
36
37
#include "ed.h"
37
#include "ed.h"
38
#include "tw.h"
38
#include "tw.h"
Lines 195-200 Link Here
195
    else if (eq(vp, STRkillring)) {
195
    else if (eq(vp, STRkillring)) {
196
	SetKillRing((int)getn(varval(vp)));
196
	SetKillRing((int)getn(varval(vp)));
197
    }
197
    }
198
    else if (eq(vp, STRhistory)) {
199
	sethistory((int)getn(varval(vp)));
200
    }
198
#ifndef HAVENOUTMP
201
#ifndef HAVENOUTMP
199
    else if (eq(vp, STRwatch)) {
202
    else if (eq(vp, STRwatch)) {
200
	resetwatch();
203
	resetwatch();
Lines 203-208 Link Here
203
    else if (eq(vp, STRimplicitcd)) {
206
    else if (eq(vp, STRimplicitcd)) {
204
	implicit_cd = ((eq(varval(vp), STRverbose)) ? 2 : 1);
207
	implicit_cd = ((eq(varval(vp), STRverbose)) ? 2 : 1);
205
    }
208
    }
209
    else if (eq(vp, STRcdtohome)) {
210
	cdtohome = 1;
211
    }
206
#ifdef COLOR_LS_F
212
#ifdef COLOR_LS_F
207
    else if (eq(vp, STRcolor)) {
213
    else if (eq(vp, STRcolor)) {
208
	set_color_context();
214
	set_color_context();
Lines 780-785 Link Here
780
	symlinks = 0;
786
	symlinks = 0;
781
    if (adrof(STRimplicitcd) == 0)
787
    if (adrof(STRimplicitcd) == 0)
782
	implicit_cd = 0;
788
	implicit_cd = 0;
789
    if (adrof(STRcdtohome) == 0)
790
	cdtohome = 0;
783
    if (adrof(STRkillring) == 0)
791
    if (adrof(STRkillring) == 0)
784
	SetKillRing(0);
792
	SetKillRing(0);
785
    if (did_edit && noediting && adrof(STRedit) == 0)
793
    if (did_edit && noediting && adrof(STRedit) == 0)
Lines 786-791 Link Here
786
	noediting = 0;
794
	noediting = 0;
787
    if (did_roe && adrof(STRrecognize_only_executables) == 0)
795
    if (did_roe && adrof(STRrecognize_only_executables) == 0)
788
	tw_cmd_free();
796
	tw_cmd_free();
797
    if (adrof(STRhistory) == 0)
798
	sethistory(0);
789
#ifdef COLOR_LS_F
799
#ifdef COLOR_LS_F
790
    if (adrof(STRcolor) == 0)
800
    if (adrof(STRcolor) == 0)
791
	set_color_context();
801
	set_color_context();
(-)contrib/tcsh/sh.time.c (-5 / +5 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.36 2013/03/18 21:00:46 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.36 2013/03/18 21:00:46 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
(-)contrib/tcsh/tc.alloc.c (-18 / +21 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.53 2015/02/22 16:31:54 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.53 2015/02/22 16:31:54 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 459-465 Link Here
459
    const union overhead *op = (const union overhead *)
462
    const union overhead *op = (const union overhead *)
460
	(((const char *) ptr) - MEMALIGN(sizeof(*op)));
463
	(((const char *) ptr) - MEMALIGN(sizeof(*op)));
461
    if (op->ov_magic == MAGIC)
464
    if (op->ov_magic == MAGIC)
462
	    return 1 << (op->ov_index + 2);
465
	    return 1 << (op->ov_index + 3);
463
    else
466
    else
464
	    return 0;
467
	    return 0;
465
}
468
}
Lines 513-531 Link Here
513
516
514
    n = n ? n : 1;
517
    n = n ? n : 1;
515
518
516
#ifdef HAVE_SBRK
519
#ifdef USE_SBRK
517
    if (membot == NULL)
520
    if (membot == NULL)
518
	membot = sbrk(0);
521
	membot = sbrk(0);
519
#endif /* HAVE_SBRK */
522
#endif /* USE_SBRK */
520
523
521
    if ((ptr = malloc(n)) == NULL)
524
    if ((ptr = malloc(n)) == NULL)
522
	out_of_memory();
525
	out_of_memory();
523
#ifndef HAVE_SBRK
526
#ifndef USE_SBRK
524
    if (memtop < ((char *) ptr) + n)
527
    if (memtop < ((char *) ptr) + n)
525
	memtop = ((char *) ptr) + n;
528
	memtop = ((char *) ptr) + n;
526
    if (membot == NULL)
529
    if (membot == NULL)
527
	membot = ptr;
530
	membot = ptr;
528
#endif /* !HAVE_SBRK */
531
#endif /* !USE_SBRK */
529
    return ((memalign_t) ptr);
532
    return ((memalign_t) ptr);
530
}
533
}
531
534
Lines 536-554 Link Here
536
539
537
    n = n ? n : 1;
540
    n = n ? n : 1;
538
541
539
#ifdef HAVE_SBRK
542
#ifdef USE_SBRK
540
    if (membot == NULL)
543
    if (membot == NULL)
541
	membot = sbrk(0);
544
	membot = sbrk(0);
542
#endif /* HAVE_SBRK */
545
#endif /* USE_SBRK */
543
546
544
    if ((ptr = (p ? realloc(p, n) : malloc(n))) == NULL)
547
    if ((ptr = (p ? realloc(p, n) : malloc(n))) == NULL)
545
	out_of_memory();
548
	out_of_memory();
546
#ifndef HAVE_SBRK
549
#ifndef USE_SBRK
547
    if (memtop < ((char *) ptr) + n)
550
    if (memtop < ((char *) ptr) + n)
548
	memtop = ((char *) ptr) + n;
551
	memtop = ((char *) ptr) + n;
549
    if (membot == NULL)
552
    if (membot == NULL)
550
	membot = ptr;
553
	membot = ptr;
551
#endif /* !HAVE_SBRK */
554
#endif /* !USE_SBRK */
552
    return ((memalign_t) ptr);
555
    return ((memalign_t) ptr);
553
}
556
}
554
557
Lines 560-569 Link Here
560
    n *= s;
563
    n *= s;
561
    n = n ? n : 1;
564
    n = n ? n : 1;
562
565
563
#ifdef HAVE_SBRK
566
#ifdef USE_SBRK
564
    if (membot == NULL)
567
    if (membot == NULL)
565
	membot = sbrk(0);
568
	membot = sbrk(0);
566
#endif /* HAVE_SBRK */
569
#endif /* USE_SBRK */
567
570
568
    if ((ptr = malloc(n)) == NULL)
571
    if ((ptr = malloc(n)) == NULL)
569
	out_of_memory();
572
	out_of_memory();
Lines 570-581 Link Here
570
573
571
    memset (ptr, 0, n);
574
    memset (ptr, 0, n);
572
575
573
#ifndef HAVE_SBRK
576
#ifndef USE_SBRK
574
    if (memtop < ((char *) ptr) + n)
577
    if (memtop < ((char *) ptr) + n)
575
	memtop = ((char *) ptr) + n;
578
	memtop = ((char *) ptr) + n;
576
    if (membot == NULL)
579
    if (membot == NULL)
577
	membot = ptr;
580
	membot = ptr;
578
#endif /* !HAVE_SBRK */
581
#endif /* !USE_SBRK */
579
582
580
    return ((memalign_t) ptr);
583
    return ((memalign_t) ptr);
581
}
584
}
Lines 625-633 Link Here
625
	    (unsigned long) sbrk(0));
628
	    (unsigned long) sbrk(0));
626
#else /* SYSMALLOC */
629
#else /* SYSMALLOC */
627
#ifndef HAVE_MALLINFO
630
#ifndef HAVE_MALLINFO
628
#ifdef HAVE_SBRK
631
#ifdef USE_SBRK
629
    memtop = sbrk(0);
632
    memtop = sbrk(0);
630
#endif /* HAVE_SBRK */
633
#endif /* USE_SBRK */
631
    xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
634
    xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
632
	    (unsigned long) membot, (unsigned long) memtop, 
635
	    (unsigned long) membot, (unsigned long) memtop, 
633
	    (unsigned long) (memtop - membot));
636
	    (unsigned long) (memtop - membot));
(-)contrib/tcsh/tc.const.c (-6 / +10 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.104 2014/10/28 18:40:46 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.104 2014/10/28 18:40:46 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' };
88
Char STRaddsuffix[]	= { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x',
89
Char STRaddsuffix[]	= { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x',
89
			    '\0' };
90
			    '\0' };
90
Char STRcsubstnonl[]	= { 'c', 's', 'u', 'b', 's', 't', 'n', 'o', 'n', 'l',
91
Char STRcsubstnonl[]	= { 'c', 's', 'u', 'b', 's', 't', 'n', 'o', 'n', 'l',
Lines 113-118 Link Here
113
Char STRmm[]		= { '-', 'm', '\0' };
114
Char STRmm[]		= { '-', 'm', '\0' };
114
Char STRmr[]		= { '-', 'r', '\0' };
115
Char STRmr[]		= { '-', 'r', '\0' };
115
Char STRmerge[]		= { 'm', 'e', 'r', 'g', 'e', '\0' };
116
Char STRmerge[]		= { 'm', 'e', 'r', 'g', 'e', '\0' };
117
Char STRlock[]		= { 'l', 'o', 'c', 'k', '\0' };
116
Char STRtildothist[]	= { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
118
Char STRtildothist[]	= { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
117
			    'y', '\0' };
119
			    'y', '\0' };
118
120
Lines 430-437 Link Here
430
Char STRrm[]		= { 'r', 'm', '\0' };
432
Char STRrm[]		= { 'r', 'm', '\0' };
431
Char STRhighlight[]	= { 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't', '\0' };
433
Char STRhighlight[]	= { 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't', '\0' };
432
434
433
Char STRimplicitcd[] = { 'i', 'm', 'p', 'l', 'i', 'c', 'i', 't',
435
Char STRimplicitcd[]	= { 'i', 'm', 'p', 'l', 'i', 'c', 'i', 't',
434
                         'c', 'd', '\0' };
436
			    'c', 'd', '\0' };
437
Char STRcdtohome[]	= { 'c', 'd', 't', 'o', 'h', 'o', 'm', 'e', '\0' };
435
Char STRkillring[] 	= { 'k', 'i', 'l', 'l', 'r', 'i', 'n', 'g', '\0' };
438
Char STRkillring[] 	= { 'k', 'i', 'l', 'l', 'r', 'i', 'n', 'g', '\0' };
436
Char STRkilldup[] 	= { 'k', 'i', 'l', 'l', 'd', 'u', 'p', '\0' };
439
Char STRkilldup[] 	= { 'k', 'i', 'l', 'l', 'd', 'u', 'p', '\0' };
437
Char STRshlvl[]		= { 's', 'h', 'l', 'v', 'l', '\0' };
440
Char STRshlvl[]		= { 's', 'h', 'l', 'v', 'l', '\0' };
Lines 450-461 Link Here
450
			    'R', 'Y', '\0' };
453
			    'R', 'Y', '\0' };
451
Char STRNOREBIND[] 	= { 'N', 'O', 'R', 'E', 'B', 'I', 'N', 'D', '\0' };
454
Char STRNOREBIND[] 	= { 'N', 'O', 'R', 'E', 'B', 'I', 'N', 'D', '\0' };
452
455
453
#if defined(SIG_WINDOW) || defined (_VMS_POSIX)	 
456
#if defined(SIG_WINDOW) || defined(SIGWINCH) || defined(SIGWINDOW) || defined (_VMS_POSIX)	 
454
/* atp - problem with declaration of str{lines,columns} in sh.func.c (1277) */
457
/* atp - problem with declaration of str{lines,columns} in sh.func.c (1277) */
455
Char STRLINES[]		= { 'L', 'I', 'N', 'E', 'S', '\0'};
458
Char STRLINES[]		= { 'L', 'I', 'N', 'E', 'S', '\0'};
456
Char STRCOLUMNS[]	= { 'C', 'O', 'L', 'U', 'M', 'N', 'S', '\0'};
459
Char STRCOLUMNS[]	= { 'C', 'O', 'L', 'U', 'M', 'N', 'S', '\0'};
457
Char STRTERMCAP[]	= { 'T', 'E', 'R', 'M', 'C', 'A', 'P', '\0'};
460
Char STRTERMCAP[]	= { 'T', 'E', 'R', 'M', 'C', 'A', 'P', '\0'};
458
#endif /* SIG_WINDOW  || _VMS_POSIX */
461
#endif /* SIG_WINDOW  || SIGWINCH || SIGWINDOW || _VMS_POSIX */
459
462
460
#if defined (_OSD_POSIX)  /* BS2000 needs this variable set to "SHELL" */
463
#if defined (_OSD_POSIX)  /* BS2000 needs this variable set to "SHELL" */
461
Char STRPROGRAM_ENVIRONMENT[] = { 'P', 'R', 'O', 'G', 'R', 'A', 'M',
464
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' };
494
Char STRmmcolormauto[]	= { '-', '-', 'c', 'o', 'l', 'o', 'r', '=', 'a', 'u', 't', 'o', '\0' };
492
#endif /* BSD_STYLE_COLORLS */
495
#endif /* BSD_STYLE_COLORLS */
493
Char STRLS_COLORS[]	= { 'L', 'S', '_', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
496
Char STRLS_COLORS[]	= { 'L', 'S', '_', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
497
Char STRLSCOLORS[]	= { 'L', 'S', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
494
#endif /* COLOR_LS_F */
498
#endif /* COLOR_LS_F */
495
499
496
Char STRls[]		= { 'l', 's', '\0' };
500
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 (-6 / +34 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.153 2014/10/11 21:52:26 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.153 2014/10/11 21:52:26 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 193-199 Link Here
193
dolist(Char **v, struct command *c)
193
dolist(Char **v, struct command *c)
194
{
194
{
195
    Char **globbed;
195
    Char **globbed;
196
    int     i, k;
196
    int     i, k, ret = 0;
197
    struct stat st;
197
    struct stat st;
198
198
199
    USE(c);
199
    USE(c);
Lines 333-340 Link Here
333
			xputchar('\n');
333
			xputchar('\n');
334
		    print_by_column(STRNULL, &v[i], k - i, FALSE);
334
		    print_by_column(STRNULL, &v[i], k - i, FALSE);
335
		}
335
		}
336
		haderr = 1;
336
		xprintf("%S: %s.\n", tmp, strerror(err));
337
		xprintf("%S: %s.\n", tmp, strerror(err));
338
		haderr = 0;
337
		i = k + 1;
339
		i = k + 1;
340
		ret = 1;
338
	    }
341
	    }
339
	    else if (S_ISDIR(st.st_mode)) {
342
	    else if (S_ISDIR(st.st_mode)) {
340
		Char   *cp;
343
		Char   *cp;
Lines 372-377 Link Here
372
		xputchar('\n');
375
		xputchar('\n');
373
	    print_by_column(STRNULL, &v[i], k - i, FALSE);
376
	    print_by_column(STRNULL, &v[i], k - i, FALSE);
374
	}
377
	}
378
	if (ret)
379
	    stderror(ERR_SILENT);
375
    }
380
    }
376
381
377
    cleanup_until(globbed);
382
    cleanup_until(globbed);
Lines 481-486 Link Here
481
	setcopy(STRstatus, STR1, VAR_READWRITE);
486
	setcopy(STRstatus, STR1, VAR_READWRITE);
482
}
487
}
483
488
489
static int
490
findvv(Char **vv, const char *cp)
491
{
492
    for (; vv && *vv; vv++) {
493
	size_t i;
494
	for (i = 0; (*vv)[i] && (*vv)[i] == cp[i]; i++)
495
	    continue;
496
	if ((*vv)[i] == '\0' && cp[i] == '\0')
497
	    return 1;
498
    }
499
    return 0;
500
}
501
484
/* PWP: a hack to start up your stopped editor on a single keystroke */
502
/* PWP: a hack to start up your stopped editor on a single keystroke */
485
/* jbs - fixed hack so it worked :-) 3/28/89 */
503
/* jbs - fixed hack so it worked :-) 3/28/89 */
486
504
Lines 492-497 Link Here
492
    char *cp, *p;
510
    char *cp, *p;
493
    size_t epl, vpl;
511
    size_t epl, vpl;
494
    int pstatus;
512
    int pstatus;
513
    struct varent *varp;
514
    Char **vv;
495
515
496
    if ((ep = getenv("EDITOR")) != NULL) {	/* if we have a value */
516
    if ((ep = getenv("EDITOR")) != NULL) {	/* if we have a value */
497
	if ((p = strrchr(ep, '/')) != NULL) 	/* if it has a path */
517
	if ((p = strrchr(ep, '/')) != NULL) 	/* if it has a path */
Lines 515-520 Link Here
515
    if (pcurrent == NULL)	/* see if we have any jobs */
535
    if (pcurrent == NULL)	/* see if we have any jobs */
516
	return NULL;		/* nope */
536
	return NULL;		/* nope */
517
537
538
    if ((varp = adrof(STReditors)) != NULL)
539
	vv = varp->vec;
540
    else
541
	vv = NULL;
542
518
    retp = NULL;
543
    retp = NULL;
519
    for (pp = proclist.p_next; pp; pp = pp->p_next)
544
    for (pp = proclist.p_next; pp; pp = pp->p_next)
520
	if (pp->p_procid == pp->p_jobid) {
545
	if (pp->p_procid == pp->p_jobid) {
Lines 542-548 Link Here
542
567
543
	    /* if we find either in the current name, fg it */
568
	    /* if we find either in the current name, fg it */
544
	    if (strncmp(ep, cp, epl) == 0 ||
569
	    if (strncmp(ep, cp, epl) == 0 ||
545
		strncmp(vp, cp, vpl) == 0) {
570
		strncmp(vp, cp, vpl) == 0 || findvv(vv, cp)) {
546
571
547
		/*
572
		/*
548
		 * If there is a choice, then choose the current process if
573
		 * If there is a choice, then choose the current process if
Lines 733-739 Link Here
733
	pp = xgetpass("Password:");
758
	pp = xgetpass("Password:");
734
759
735
	crpp = XCRYPT(pw, pp, srpp);
760
	crpp = XCRYPT(pw, pp, srpp);
736
	if ((strcmp(crpp, srpp) == 0)
761
	if ((crpp && strcmp(crpp, srpp) == 0)
737
#ifdef AFS
762
#ifdef AFS
738
	    || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
763
	    || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
739
					   afsname,     /* name */
764
					   afsname,     /* name */
Lines 1109-1115 Link Here
1109
#endif /* RMDEBUG */
1134
#endif /* RMDEBUG */
1110
    Char   *charac;
1135
    Char   *charac;
1111
    char    c;
1136
    char    c;
1112
    int     ask, doit, star = 0, silent = 0;
1137
    int     ask, doit, star = 0, silent = 0, opintr_disabled;
1113
1138
1114
    if (!adrof(STRrmstar))
1139
    if (!adrof(STRrmstar))
1115
	return;
1140
	return;
Lines 1119-1124 Link Here
1119
    we = cp->next;
1144
    we = cp->next;
1120
    while (*we->word == ';' && we != cp)
1145
    while (*we->word == ';' && we != cp)
1121
	we = we->next;
1146
	we = we->next;
1147
    opintr_disabled = pintr_disabled;
1148
    pintr_disabled = 0;
1122
    while (we != cp) {
1149
    while (we != cp) {
1123
#ifdef RMDEBUG
1150
#ifdef RMDEBUG
1124
	if (*tag)
1151
	if (*tag)
Lines 1195-1200 Link Here
1195
	    xprintf("%S ", we->word);
1222
	    xprintf("%S ", we->word);
1196
    }
1223
    }
1197
#endif /* RMDEBUG */
1224
#endif /* RMDEBUG */
1225
    pintr_disabled = opintr_disabled;
1198
    return;
1226
    return;
1199
}
1227
}
1200
1228
(-)contrib/tcsh/tc.nls.c (-2 / +2 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.25 2015/05/04 15:31:13 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.25 2015/05/04 15:31:13 christos Exp $")
36
36
37
37
38
#ifdef WIDE_STRINGS
38
#ifdef WIDE_STRINGS
(-)contrib/tcsh/tc.nls.h (-1 / +1 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.16 2015/05/04 15:31:13 christos Exp $ */
2
/*
2
/*
3
 * tc.nls.h: NLS support
3
 * tc.nls.h: NLS support
4
 *
4
 *
(-)contrib/tcsh/tc.printf.c (-44 / +72 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.37 2014/02/28 17:10:31 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.37 2014/02/28 17:10:31 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);
290
			count++;
291
		    }
270
		    len = one_wctomb(cbuf, *Bp & CHAR);
292
		    len = one_wctomb(cbuf, *Bp & CHAR);
271
		    for (pos = 0; pos < len; pos++)
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 (-7 / +11 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.46 2015/05/04 15:31:13 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.46 2015/05/04 15:31:13 christos Exp $")
40
40
41
#define MALLOC_INCR	128
41
#define MALLOC_INCR	128
42
#ifdef WIDE_STRINGS
42
#ifdef WIDE_STRINGS
Lines 559-565 Link Here
559
}
559
}
560
560
561
struct blk_buf *
561
struct blk_buf *
562
bb_alloc()
562
bb_alloc(void)
563
{
563
{
564
    return xcalloc(1, sizeof(struct blk_buf));
564
    return xcalloc(1, sizeof(struct blk_buf));
565
}
565
}
Lines 590-599 Link Here
590
    struct blk_buf *bb;
590
    struct blk_buf *bb;
591
    size_t i;
591
    size_t i;
592
592
593
    bb = xbb;
593
    bb = (struct blk_buf *)xbb;
594
    for (i = 0; i < bb->len; i++)
594
    if (bb->vec) {
595
	xfree(bb->vec[i]);
595
	for (i = 0; i < bb->len; i++)
596
    xfree(bb->vec);
596
	    xfree(bb->vec[i]);
597
	xfree(bb->vec);
598
    }
599
    bb->vec = NULL;
600
    bb->len = 0;
597
}
601
}
598
602
599
void
603
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 (-63 / +105 lines)
Lines 1-3 Link Here
1
.\"
1
.\" Copyright (c) 1980, 1990, 1993
2
.\" Copyright (c) 1980, 1990, 1993
2
.\"	The Regents of the University of California.  All rights reserved.
3
.\"	The Regents of the University of California.  All rights reserved.
3
.\"
4
.\"
Lines 42-47 Link Here
42
.\" 
43
.\" 
43
.\" - Use `', not '' or "", except of course in shell syntax examples.
44
.\" - Use `', not '' or "", except of course in shell syntax examples.
44
.\"   '' at the beginning of a line will vanish!
45
.\"   '' at the beginning of a line will vanish!
46
.\"
47
.\" - Use \` for literal back-quote (`).
48
.\"
49
.\" - Use \e for literal backslash (\).
45
.\" 
50
.\" 
46
.\" - Use \-, not -.
51
.\" - Use \-, not -.
47
.\" 
52
.\" 
Lines 72-78 Link Here
72
.\"   used here if you can. In particular, please don't use nroff commands
77
.\"   used here if you can. In particular, please don't use nroff commands
73
.\"   which aren't already used herein.
78
.\"   which aren't already used herein.
74
.\" 
79
.\" 
75
.TH TCSH 1 "14 February 2012" "Astron 6.18.01"
80
.TH TCSH 1 "21 May 2015" "Astron 6.19.00"
76
.SH NAME
81
.SH NAME
77
tcsh \- C shell with file name completion and command line editing
82
tcsh \- C shell with file name completion and command line editing
78
.SH SYNOPSIS
83
.SH SYNOPSIS
Lines 160-166 Link Here
160
Command input is taken from the standard input.
165
Command input is taken from the standard input.
161
.TP 4
166
.TP 4
162
.B \-t
167
.B \-t
163
The shell reads and executes a single line of input.  A `\\' may be used to
168
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.
169
escape the newline at the end of this line and continue onto another line.
165
.TP 4
170
.TP 4
166
.B \-v
171
.B \-v
Lines 408-414 Link Here
408
.br
413
.br
409
condiments.h    main.c~
414
condiments.h    main.c~
410
.br
415
.br
411
> set fignore = (.o \\~)
416
> set fignore = (.o \e~)
412
.br
417
.br
413
> emacs ma[^D]
418
> emacs ma[^D]
414
.br
419
.br
Lines 420-426 Link Here
420
.PP
425
.PP
421
`main.c~' and `main.o' are ignored by completion (but not listing),
426
`main.c~' and `main.o' are ignored by completion (but not listing),
422
because they end in suffixes in \fBfignore\fR.
427
because they end in suffixes in \fBfignore\fR.
423
Note that a `\\' was needed in front of `~' to prevent it from being
428
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.
429
expanded to \fBhome\fR as described under \fBFilename substitution\fR.
425
\fBfignore\fR is ignored if only one completion is possible.
430
\fBfignore\fR is ignored if only one completion is possible.
426
.PP
431
.PP
Lines 534-543 Link Here
534
Like completion, spelling correction works anywhere in the line,
539
Like completion, spelling correction works anywhere in the line,
535
pushing the rest of the line to the right and possibly leaving
540
pushing the rest of the line to the right and possibly leaving
536
extra characters to the right of the cursor.
541
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 (+)"
542
.SS "Editor commands (+)"
542
`bindkey' lists key bindings and `bindkey \-l' lists and briefly describes
543
`bindkey' lists key bindings and `bindkey \-l' lists and briefly describes
543
editor commands.
544
editor commands.
Lines 760-766 Link Here
760
.B spell-line \fR(M-$)
761
.B spell-line \fR(M-$)
761
Attempts to correct the spelling of each word in the input buffer, like
762
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
763
\fIspell-word\fR, but ignores words whose first character is one of
763
`\-', `!', `^' or `%', or which contain `\\', `*' or `?', to avoid problems
764
`\-', `!', `^' or `%', or which contain `\e', `*' or `?', to avoid problems
764
with switches, substitutions and the like.
765
with switches, substitutions and the like.
765
See \fBSpelling correction\fR.
766
See \fBSpelling correction\fR.
766
.TP 8
767
.TP 8
Lines 816-823 Link Here
816
.PP
817
.PP
817
A special character (including a blank or tab) may be prevented from having
818
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
819
its special meaning, and possibly made part of another word, by preceding it
819
with a backslash (`\\') or enclosing it in single (`''), double (`"') or
820
with a backslash (`\e') or enclosing it in single (`''), double (`"') or
820
backward (``') quotes.  When not otherwise quoted a newline preceded by a `\\'
821
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
822
is equivalent to a blank, but inside quotes this sequence results in a
822
newline.
823
newline.
823
.PP
824
.PP
Lines 824-831 Link Here
824
Furthermore, all \fBSubstitutions\fR (see below) except \fBHistory substitution\fR
825
Furthermore, all \fBSubstitutions\fR (see below) except \fBHistory substitution\fR
825
can be prevented by enclosing the strings (or parts of strings)
826
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)
827
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)
828
(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
829
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
830
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
831
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
832
with a backslash.) \fBHistory substitution\fR is prevented by
Lines 847-853 Link Here
847
to do so if appropriate.
848
to do so if appropriate.
848
.PP
849
.PP
849
The \fBbackslash_quote\fR shell variable (q.v.) can be set to make backslashes
850
The \fBbackslash_quote\fR shell variable (q.v.) can be set to make backslashes
850
always quote `\\', `'', and `"'.  (+) This may make complex quoting tasks
851
always quote `\e', `'', and `"'.  (+) This may make complex quoting tasks
851
easier, but it can cause syntax errors in \fIcsh\fR(1) scripts.
852
easier, but it can cause syntax errors in \fIcsh\fR(1) scripts.
852
.SS Substitutions
853
.SS Substitutions
853
We now describe the various transformations the shell performs on the input in
854
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.
881
command with little typing and a high degree of confidence.
881
.PP
882
.PP
882
History substitutions begin with the character `!'.  They may begin anywhere in
883
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
884
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
885
prevent its special meaning; for convenience, a `!' is passed unchanged when it
885
is followed by a blank, tab, newline, `=' or `('.  History substitutions also
886
is followed by a blank, tab, newline, `=' or `('.  History substitutions also
886
occur when an input line begins with `^'.  This special abbreviation will be
887
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
1047
\fIl\fR is simply a string like \fIr\fR, not a regular expression as in
1047
the eponymous \fIed\fR(1) command.
1048
the eponymous \fIed\fR(1) command.
1048
Any character may be used as the delimiter in place of `/';
1049
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.
1050
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 `&'.
1051
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
1052
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.
1053
\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.
1054
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
1188
executed, variable substitution is performed keyed by `$' characters.  This
1188
expansion can be prevented by preceding the `$' with a `\e' except within `"'s
1189
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.
1190
where it \fIalways\fR occurs, and within `''s where it \fInever\fR occurs.
1190
Strings quoted by ``' are interpreted later (see \fBCommand substitution\fR
1191
Strings quoted by `\`' are interpreted later (see \fBCommand substitution\fR
1191
below) so `$' substitution does not occur there until later,
1192
below) so `$' substitution does not occur there until later,
1192
if at all.  A `$' is passed unchanged if followed by a blank, tab, or
1193
if at all.  A `$' is passed unchanged if followed by a blank, tab, or
1193
end-of-line.
1194
end-of-line.
Lines 1316-1322 Link Here
1316
occurs very late, after input-output redirection is performed, and in a child
1317
occurs very late, after input-output redirection is performed, and in a child
1317
of the main shell.
1318
of the main shell.
1318
.SS "Command substitution"
1319
.SS "Command substitution"
1319
Command substitution is indicated by a command enclosed in ``'.  The output
1320
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,
1321
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
1322
and null words are discarded.  The output is variable and command substituted
1322
and put in place of the original string.
1323
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 `/',
1402
a file glob pattern that matches any string of characters including `/',
1402
recursively traversing any existing sub-directories.  For example, 
1403
recursively traversing any existing sub-directories.  For example, 
1403
`ls **.c' will list all the .c files in the current directory tree.
1404
`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
1405
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'
1406
(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 
1407
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
1408
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
1550
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
1551
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
1552
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
1553
line.  Unless a quoting `\e', `"', `' or `\`' appears in \fIword\fR variable and
1553
command substitution is performed on the intervening lines, allowing `\e' to
1554
command substitution is performed on the intervening lines, allowing `\e' to
1554
quote `$', `\e' and ``'.  Commands which are substituted have all blanks, tabs,
1555
quote `$', `\e' and `\`'.  Commands which are substituted have all blanks, tabs,
1555
and newlines preserved, except for the final newline which is dropped.  The
1556
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
1557
resultant text is placed in an anonymous temporary file which is given to the
1557
command as standard input.
1558
command as standard input.
Lines 1746-1752 Link Here
1746
see if it has the specified relationship to the real user.  If \fIfile\fR
1747
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 `*',
1748
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,
1749
if the specified file type does not exist on the current system,
1749
then all enquiries return false, i.e., `0'.
1750
then all inquiries return false, i.e., `0'.
1750
.PP
1751
.PP
1751
These operators may be combined for conciseness: `\-\fIxy file\fR' is
1752
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
1753
equivalent to `\-\fIx file\fR && \-\fIy file\fR'.  (+) For example, `\-fx' is true
Lines 2262-2268 Link Here
2262
.RE
2263
.RE
2263
.PP
2264
.PP
2264
`\e' nullifies the special meaning of the following character, if it has
2265
`\e' nullifies the special meaning of the following character, if it has
2265
any, notably `\\' and `^'.
2266
any, notably `\e' and `^'.
2266
.RE
2267
.RE
2267
.TP 8
2268
.TP 8
2268
.B bs2cmd \fIbs2000-command\fR (+)
2269
.B bs2cmd \fIbs2000-command\fR (+)
Lines 2293-2299 Link Here
2293
.TP 8
2294
.TP 8
2294
.B cd \fR[\fB\-p\fR] [\fB\-l\fR] [\fB\-n\fR|\fB\-v\fR] [\I--\fR] [\fIname\fR]
2295
.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
2296
If a directory \fIname\fR is given, changes the shell's working directory
2296
to \fIname\fR.  If not, changes to \fBhome\fR.
2297
to \fIname\fR.  If not, changes to \fBhome\fR, unless the \fBcdtohome\fR
2298
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
2299
If \fIname\fR is `\-' it is interpreted as the previous working directory
2298
(see \fBOther substitutions\fR).  (+)
2300
(see \fBOther substitutions\fR).  (+)
2299
If \fIname\fR is not a subdirectory of the current directory
2301
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
2302
(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
2303
\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
2304
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.
2305
begins with `/' or '.', then this is tried to see if it is a directory, and
2306
the \fB\-p\fR option is implied.
2304
.RS +8
2307
.RS +8
2305
.PP
2308
.PP
2306
With \fB\-p\fR, prints the final directory stack, just like \fIdirs\fR.
2309
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
2312
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 '\-'. (+)
2313
is taken as the directory \fIname\fR even if it begins with '\-'. (+)
2311
.PP
2314
.PP
2312
See also the \fBimplicitcd\fR shell variable.
2315
See also the \fBimplicitcd\fR and \fBcdtohome\fR shell variables.
2313
.RE
2316
.RE
2314
.TP 8
2317
.TP 8
2315
.B chdir
2318
.B chdir
Lines 2428-2434 Link Here
2428
(...)
2431
(...)
2429
Words from the given list
2432
Words from the given list
2430
.TP 8
2433
.TP 8
2431
`...`
2434
\`...\`
2432
Words from the output of command
2435
Words from the output of command
2433
.PD
2436
.PD
2434
.RE
2437
.RE
Lines 2445-2451 Link Here
2445
case the fourth delimiter can also be omitted), a slash is appended to
2448
case the fourth delimiter can also be omitted), a slash is appended to
2446
directories and a space to other words.
2449
directories and a space to other words.
2447
.PP
2450
.PP
2448
\fIcommand\fR invoked from `...` version has additional environment
2451
\fIcommand\fR invoked from \`...\` version has additional environment
2449
variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
2452
variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
2450
contains (as its name indicates) contents of the current (already
2453
contains (as its name indicates) contents of the current (already
2451
typed in) command line. One can examine and use contents of the
2454
typed in) command line. One can examine and use contents of the
Lines 2526-2532 Link Here
2526
.PP
2529
.PP
2527
or from a command run at completion time:
2530
or from a command run at completion time:
2528
.IP "" 4
2531
.IP "" 4
2529
> complete kill 'p/*/`ps | awk \\{print\\ \\$1\\}`/'
2532
> complete kill 'p/*/\`ps | awk \e{print\e \e$1\e}\`/'
2530
.br
2533
.br
2531
> kill \-9 [^D]
2534
> kill \-9 [^D]
2532
.br
2535
.br
Lines 2587-2593 Link Here
2587
.PP
2590
.PP
2588
Finally, here's a complex example for inspiration:
2591
Finally, here's a complex example for inspiration:
2589
.IP "" 4
2592
.IP "" 4
2590
> complete find \\
2593
> complete find \e
2591
.br
2594
.br
2592
\&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
2595
\&'n/\-name/f/' 'n/\-newer/f/' 'n/\-{,n}cpio/f/' \e
2593
.br
2596
.br
Lines 2618-2625 Link Here
2618
.PP
2621
.PP
2619
Remember that programmed completions are ignored if the word being completed
2622
Remember that programmed completions are ignored if the word being completed
2620
is a tilde substitution (beginning with `~') or a variable (beginning with `$').
2623
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.
2624
See also the \fIuncomplete\fR builtin command.
2624
.RE
2625
.RE
2625
.TP 8
2626
.TP 8
Lines 2684-2690 Link Here
2684
from a shell script less verbose on slow terminals, or limit command
2685
from a shell script less verbose on slow terminals, or limit command
2685
output to the number of lines on the screen:
2686
output to the number of lines on the screen:
2686
.IP "" 4
2687
.IP "" 4
2687
> set history=`echotc lines`
2688
> set history=\`echotc lines\`
2688
.br
2689
.br
2689
> @ history\-\-
2690
> @ history\-\-
2690
.PP
2691
.PP
Lines 2693-2701 Link Here
2693
capability string, as in the following example that places the date in
2694
capability string, as in the following example that places the date in
2694
the status line:
2695
the status line:
2695
.IP "" 4
2696
.IP "" 4
2696
> set tosl="`echotc ts 0`"
2697
> set tosl="\`echotc ts 0\`"
2697
.br
2698
.br
2698
> set frsl="`echotc fs`"
2699
> set frsl="\`echotc fs\`"
2699
.br
2700
.br
2700
> echo \-n "$tosl";date; echo \-n "$frsl"
2701
> echo \-n "$tosl";date; echo \-n "$frsl"
2701
.PP
2702
.PP
Lines 2814-2821 Link Here
2814
existing history file instead of replacing it (if there is one) and
2815
existing history file instead of replacing it (if there is one) and
2815
sorted by time stamp.  (+) Merging is intended for an environment like
2816
sorted by time stamp.  (+) Merging is intended for an environment like
2816
the X Window System
2817
the X Window System
2817
with several shells in simultaneous use.  Currently it succeeds
2818
with several shells in simultaneous use.  If the second word of \fBsavehist\fR
2818
only when the shells quit nicely one after another.
2819
is `merge' and the third word is set to `lock', the history file update
2820
will be serialized with other shell sessions that would possibly like
2821
to merge history at exactly the same time.
2819
.PP
2822
.PP
2820
With \fB\-L\fR, the shell appends \fIfilename\fR, which is presumably a
2823
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,
2824
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
2961
\fIdescriptors\fR or \fIopenfiles\fR
2959
the maximum number of open files for this process
2962
the maximum number of open files for this process
2960
.TP
2963
.TP
2964
\fIpseudoterminals\fR
2965
the maximum number of pseudo-terminals for this user
2966
.TP
2967
\fIkqueues\fR
2968
the maximum number of kqueues allocated for this process
2969
.TP
2961
\fIconcurrency\fR
2970
\fIconcurrency\fR
2962
the maximum number of threads for this process
2971
the maximum number of threads for this process
2963
.TP
2972
.TP
Lines 2967-2972 Link Here
2967
\fImaxproc\fR
2976
\fImaxproc\fR
2968
the maximum number of simultaneous processes for this user id
2977
the maximum number of simultaneous processes for this user id
2969
.TP
2978
.TP
2979
\fImaxthread\fR
2980
the maximum number of simultaneous threads (lightweight processes) for this
2981
user id
2982
.TP
2983
\fIthreads\fR
2984
the maximum number of threads for this process
2985
.TP
2970
\fIsbsize\fR
2986
\fIsbsize\fR
2971
the maximum size of socket buffer usage for this user
2987
the maximum size of socket buffer usage for this user
2972
.TP
2988
.TP
Lines 2976-2981 Link Here
2976
\fImaxlocks\fR
2992
\fImaxlocks\fR
2977
the maximum number of locks for this user
2993
the maximum number of locks for this user
2978
.TP
2994
.TP
2995
\fIposixlocks\fR
2996
the maximum number of POSIX advisory locks for this user
2997
.TP
2979
\fImaxsignal\fR
2998
\fImaxsignal\fR
2980
the maximum number of pending signals for this user
2999
the maximum number of pending signals for this user
2981
.TP
3000
.TP
Lines 3212-3223 Link Here
3212
.PD
3231
.PD
3213
.RS +8
3232
.RS +8
3214
.IP "" 4
3233
.IP "" 4
3215
> sched 11:00 echo It\\'s eleven o\\'clock.
3234
> sched 11:00 echo It\e's eleven o\e'clock.
3216
.PP
3235
.PP
3217
causes the shell to echo `It's eleven o'clock.' at 11 AM.
3236
causes the shell to echo `It's eleven o'clock.' at 11 AM.
3218
The time may be in 12-hour AM/PM format
3237
The time may be in 12-hour AM/PM format
3219
.IP "" 4
3238
.IP "" 4
3220
> sched 5pm set prompt='[%h] It\\'s after 5; go home: >'
3239
.\" TODO
3240
> sched 5pm set prompt='[%h] It\e's after 5; go home: >'
3221
.PP
3241
.PP
3222
or may be relative to the current time:
3242
or may be relative to the current time:
3223
.IP "" 4
3243
.IP "" 4
Lines 3615-3621 Link Here
3615
shell variable to match (unless the shell variable is read-only) and vice
3635
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
3636
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
3637
are not synchronized in this manner, and that the shell automatically
3618
interconverts the different formats of \fBpath\fR and \fBPATH\fR.
3638
converts between the different formats of \fBpath\fR and \fBPATH\fR.
3619
.TP 8
3639
.TP 8
3620
.B addsuffix \fR(+)
3640
.B addsuffix \fR(+)
3621
If set, filename completion adds `/' to the end of directories and a space
3641
If set, filename completion adds `/' to the end of directories and a space
Lines 3629-3634 Link Here
3629
.B ampm \fR(+)
3649
.B ampm \fR(+)
3630
If set, all times are shown in 12-hour AM/PM format.
3650
If set, all times are shown in 12-hour AM/PM format.
3631
.TP 8
3651
.TP 8
3652
.B anyerror \fR(+)
3653
This variable selects what is propagated to the value of the
3654
\fBstatus\fR variable. For more information see the description of the
3655
\fBstatus\fR variable below.
3656
.TP 8
3632
.B argv
3657
.B argv
3633
The arguments to the shell.  Positional parameters are taken from \fBargv\fR,
3658
The arguments to the shell.  Positional parameters are taken from \fBargv\fR,
3634
i.e., `$1' is replaced by `$argv[1]', etc.
3659
i.e., `$1' is replaced by `$argv[1]', etc.
Lines 3672-3678 Link Here
3672
cases.
3697
cases.
3673
.TP 8
3698
.TP 8
3674
.B backslash_quote \fR(+)
3699
.B backslash_quote \fR(+)
3675
If set, backslashes (`\\') always quote `\\', `'', and `"'.  This may make
3700
.\" TODO
3701
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)
3702
complex quoting tasks easier, but it can cause syntax errors in \fIcsh\fR(1)
3677
scripts.
3703
scripts.
3678
.TP 8
3704
.TP 8
Lines 3685-3690 Link Here
3685
A list of directories in which \fIcd\fR should search for
3711
A list of directories in which \fIcd\fR should search for
3686
subdirectories if they aren't found in the current directory.
3712
subdirectories if they aren't found in the current directory.
3687
.TP 8
3713
.TP 8
3714
.B cdtohome \fR(+)
3715
If not set, \fIcd\fR requires a directory \fIname\fR, and will not go to the
3716
\fBhome\fR directory if it's omitted.
3717
This is set by default.
3718
.TP 8
3688
.B color
3719
.B color
3689
If set, it enables color display for the builtin \fBls\-F\fR and it passes
3720
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
3721
\fB\-\-color=auto\fR to \fBls\fR.  Alternatively, it can be set to only
Lines 3721-3727 Link Here
3721
Same as continue, but the shell will execute:
3752
Same as continue, but the shell will execute:
3722
.RS +8
3753
.RS +8
3723
.IP "" 4
3754
.IP "" 4
3724
echo `pwd` $argv > ~/.<cmd>_pause; %<cmd>
3755
echo \`pwd\` $argv > ~/.<cmd>_pause; %<cmd>
3725
.RE
3756
.RE
3726
.TP 8
3757
.TP 8
3727
.B correct \fR(+)
3758
.B correct \fR(+)
Lines 3831-3843 Link Here
3831
.PD 0
3862
.PD 0
3832
.TP 8
3863
.TP 8
3833
bsd
3864
bsd
3834
Don't echo a newline if the first argument is `\-n'.
3865
Don't echo a newline if the first argument is `\-n'; the default for \fIcsh\fR.
3835
.TP 8
3866
.TP 8
3836
sysv
3867
sysv
3837
Recognize backslashed escape sequences in echo strings.
3868
Recognize backslashed escape sequences in echo strings.
3838
.TP 8
3869
.TP 8
3839
both
3870
both
3840
Recognize both the `\-n' flag and backslashed escape sequences; the default.
3871
Recognize both the `\-n' flag and backslashed escape sequences; the default
3872
for \fItcsh\fR.
3841
.TP 8
3873
.TP 8
3842
none
3874
none
3843
Recognize neither.
3875
Recognize neither.
Lines 3884-3890 Link Here
3884
If set, the `**' and `***' file glob patterns will match any string of 
3916
If set, the `**' and `***' file glob patterns will match any string of 
3885
characters including `/' traversing any existing sub-directories.  (e.g. 
3917
characters including `/' traversing any existing sub-directories.  (e.g. 
3886
`ls **.c' will list all the .c files in the current directory tree).
3918
`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
3919
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'
3920
(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'
3921
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').
3922
will match any file in the /usr/include directory tree ending in `time.h').
Lines 3937-3943 Link Here
3937
.B history
3969
.B history
3938
The first word indicates the number of history events to save.  The
3970
The first word indicates the number of history events to save.  The
3939
optional second word (+) indicates the format in which history is
3971
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
3972
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
3973
are described below under \fBprompt\fR; note the variable meaning of
3942
`%R'.  Set to `100' by default.
3974
`%R'.  Set to `100' by default.
3943
.TP 8
3975
.TP 8
Lines 4278-4284 Link Here
4278
.TP 8
4310
.TP 8
4279
.B prompt2 \fR(+)
4311
.B prompt2 \fR(+)
4280
The string with which to prompt in \fIwhile\fR and \fIforeach\fR loops and
4312
The string with which to prompt in \fIwhile\fR and \fIforeach\fR loops and
4281
after lines ending in `\\'.
4313
after lines ending in `\e'.
4282
The same format sequences may be used as in \fBprompt\fR (q.v.);
4314
The same format sequences may be used as in \fBprompt\fR (q.v.);
4283
note the variable meaning of `%R'.
4315
note the variable meaning of `%R'.
4284
Set by default to `%R? ' in interactive shells.
4316
Set by default to `%R? ' in interactive shells.
Lines 4329-4342 Link Here
4329
.B savehist
4361
.B savehist
4330
If set, the shell does `history \-S' before exiting.
4362
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.
4363
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.)
4364
(The number should be less than or equal to the number \fBhistory\fR entries;
4365
if it is set to greater than the number of \fBhistory\fR settings, only
4366
\fBhistory\fR entries will be saved)
4333
If the second word is set to `merge', the history list is merged with
4367
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
4368
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.  (+)
4369
sorted by time stamp and the most recent events are retained.
4370
If the second word of \fBsavehist\fR is `merge' and the third word is set to
4371
`lock', the history file update will be serialized with other shell sessions
4372
that would possibly like to merge history at exactly the same time. (+)
4336
.TP 8
4373
.TP 8
4337
.B sched \fR(+)
4374
.B sched \fR(+)
4338
The format in which the \fIsched\fR builtin command prints scheduled events;
4375
The format in which the \fIsched\fR builtin command prints scheduled events;
4339
if not given, `%h\\t%T\\t%R\\n' is used.
4376
if not given, `%h\et%T\et%R\en' is used.
4340
The format sequences are described above under \fBprompt\fR;
4377
The format sequences are described above under \fBprompt\fR;
4341
note the variable meaning of `%R'.
4378
note the variable meaning of `%R'.
4342
.TP 8
4379
.TP 8
Lines 4353-4369 Link Here
4353
See also \fBloginsh\fR.
4390
See also \fBloginsh\fR.
4354
.TP 8
4391
.TP 8
4355
.B status
4392
.B status
4356
The status returned by the last command, unless the variable
4393
The exit status from the last command or backquote expansion, or any
4357
.B anyerror
4394
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
4395
default \fBcsh\fR behavior.)
4359
propagated (this is the default
4396
This default does not match what POSIX mandates (to return the
4360
.B csh
4397
status of the last command only). To match the POSIX behavior, you need
4361
behavior, and the current
4398
to unset \fBanyerror\fR.
4362
.B tcsh
4399
.RS +8
4363
default). If it terminated
4400
.PP
4364
abnormally, then 0200 is added to the status.  Builtin commands
4401
If the \fBanyerror\fR variable is unset, the exit status of a pipeline
4365
which fail return exit status `1', all other builtin commands
4402
is determined only from the last command in the pipeline, and the exit
4366
return status `0'.
4403
status of a backquote expansion is \fInot\fR propagated to \fBstatus\fR.
4404
.PP
4405
If a command terminated abnormally, then 0200 is added to the status.
4406
Builtin commands which fail return exit status `1', all other builtin
4407
commands return status `0'.
4408
.RE
4367
.TP 8
4409
.TP 8
4368
.B symlinks \fR(+)
4410
.B symlinks \fR(+)
4369
Can be set to several different values to control symbolic link (`symlink')
4411
Can be set to several different values to control symbolic link (`symlink')
Lines 5201-5207 Link Here
5201
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
5243
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
5202
termio(7), Introduction to the C Shell
5244
termio(7), Introduction to the C Shell
5203
.SH VERSION
5245
.SH VERSION
5204
This manual documents tcsh 6.18.01 (Astron) 2012-02-14.
5246
This manual documents tcsh 6.19.00 (Astron) 2015-05-21.
5205
.SH AUTHORS
5247
.SH AUTHORS
5206
.PD 0
5248
.PD 0
5207
.TP 2
5249
.TP 2
(-)contrib/tcsh/tw.color.c (-54 / +199 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.32 2014/07/07 19:53:51 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.32 2014/07/07 19:53:51 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
    int c;
245
    static const char ccolors[] = "abcdefghx";
246
    char *p;
247
    if (Isupper(x)) {
248
	x = Tolower(x);
249
	c |= TCSH_BOLD;
250
    } else
251
	c = 0;
252
253
    if (x == '\0' || (p = strchr(ccolors, x)) == NULL)
254
	return -1;
255
    return 30 + (p - ccolors);
256
}
257
258
static void
259
makecolor(char **c, int fg, int bg, Str *v)
260
{
261
    int l;
262
    if (fg & 0x80)
263
	l = xsnprintf(*c, 12, "%.2d;%.2d;%.2d;%.2d", ANSI_BOLD_ON,
264
	    fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD, ANSI_BOLD_OFF);
265
	l = xsnprintf(*c, 6, "%.2d;%.2d",
266
	    fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD);
267
268
    v->s = *c;
269
    v->len = l;
270
    *c += l + 1;
271
}
272
273
/* parseLSCOLORS():
274
 * 	Parse the LSCOLORS environment variable
275
 */
276
static const Char *xv;	/* setjmp clobbering */
277
void
278
parseLSCOLORS(const Char *value)
279
{
280
    size_t i, len, clen;
281
    jmp_buf_t osetexit;
282
    size_t omark;
283
    xv = value;
284
285
    if (xv == NULL) {
286
	init(0, 0);
287
	return;
288
    }
289
290
    len = Strlen(xv);
291
    len >>= 1;
292
    clen = len * 12;	/* "??;??;??;??\0" */
293
    init(clen, 0);
294
295
    /* Prevent from crashing if unknown parameters are given. */
296
    omark = cleanup_push_mark();
297
    getexit(osetexit);
298
299
    /* init pointers */
300
301
    if (setexit() == 0) {
302
	const Char *v = xv;
303
	char *c = colors;
304
305
	int fg, bg;
306
	for (i = 0; i < len; i++) {
307
	    fg = color(*v++);
308
	    if (fg == -1)
309
		stderror(ERR_BADCOLORVAR, v[-1], '?');
310
311
	    bg = color(*v++);
312
	    if (bg == -1)
313
		stderror(ERR_BADCOLORVAR, '?', v[-1]);
314
	    makecolor(&c, fg, bg, &variables[map[i]].color);
315
	}
316
317
    }
318
    cleanup_pop_mark(omark);
319
    resexit(osetexit);
320
}
321
171
/* parseLS_COLORS():
322
/* parseLS_COLORS():
172
 *	Parse the LS_COLORS environment variable
323
 *	Parse the LS_COLORS environment variable
173
 */
324
 */
Lines 183-198 Link Here
183
334
184
    (void) &e;
335
    (void) &e;
185
336
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
337
194
    if (value == NULL)
338
    if (value == NULL) {
339
	init(0, 0);
195
	return;
340
	return;
341
    }
196
342
197
    len = Strlen(value);
343
    len = Strlen(value);
198
    /* allocate memory */
344
    /* allocate memory */
Lines 200-213 Link Here
200
    for (v = value; *v; v++)
346
    for (v = value; *v; v++)
201
	if ((*v & CHAR) == ':')
347
	if ((*v & CHAR) == ':')
202
	    i++;
348
	    i++;
203
    extensions = xmalloc(len + i * sizeof(Extension));
204
    colors = i * sizeof(Extension) + (char *)extensions;
205
    nextensions = 0;
206
349
350
    init(len, i);
351
207
    /* init pointers */
352
    /* init pointers */
208
    v = value;
353
    v = value;
209
    c = colors;
354
    c = colors;
210
    e = &extensions[0];
355
    e = extensions;
211
356
212
    /* Prevent from crashing if unknown parameters are given. */
357
    /* Prevent from crashing if unknown parameters are given. */
213
358
Lines 216-259 Link Here
216
361
217
    if (setexit() == 0) {
362
    if (setexit() == 0) {
218
363
219
    /* parse */
364
	/* parse */
220
    while (*v) {
365
	while (*v) {
221
	switch (*v & CHAR) {
366
	    switch (*v & CHAR) {
222
	case ':':
367
	    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++;
368
		v++;
231
		getstring(&c, &v, &e->color, ':');
232
		e++;
233
		continue;
369
		continue;
234
	    }
235
	    break;
236
370
237
	default:		/* :vl=color: */
371
	    case '*':		/* :*ext=color: */
238
	    if (v[0] && v[1] && (v[2] & CHAR) == '=') {
372
		v++;
239
		for (i = 0; i < nvariables; i++)
373
		if (getstring(&c, &v, &e->extension, '=') &&
240
		    if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
374
		    0 < e->extension.len) {
241
			(Char)variables[i].variable[1] == (v[1] & CHAR))
375
		    v++;
242
			break;
376
		    getstring(&c, &v, &e->color, ':');
243
		if (i < nvariables) {
377
		    e++;
244
		    v += 3;
245
		    getstring(&c, &v, &variables[i].color, ':');
246
		    continue;
378
		    continue;
247
		}
379
		}
248
		else
380
		break;
249
		    stderror(ERR_BADCOLORVAR, v[0], v[1]);
381
382
	    default:		/* :vl=color: */
383
		if (v[0] && v[1] && (v[2] & CHAR) == '=') {
384
		    for (i = 0; i < nvariables; i++)
385
			if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
386
			    (Char)variables[i].variable[1] == (v[1] & CHAR))
387
			    break;
388
		    if (i < nvariables) {
389
			v += 3;
390
			getstring(&c, &v, &variables[i].color, ':');
391
			continue;
392
		    }
393
		    else
394
			stderror(ERR_BADCOLORVAR, v[0], v[1]);
395
		}
396
		break;
250
	    }
397
	    }
251
	    break;
398
	    while (*v && (*v & CHAR) != ':')
399
		v++;
252
	}
400
	}
253
	while (*v && (*v & CHAR) != ':')
254
	    v++;
255
    }
401
    }
256
    }
257
402
258
    cleanup_pop_mark(omark);
403
    cleanup_pop_mark(omark);
259
    resexit(osetexit);
404
    resexit(osetexit);
Lines 264-278 Link Here
264
/* put_color():
409
/* put_color():
265
 */
410
 */
266
static void
411
static void
267
put_color(const Str *color)
412
put_color(const Str *colorp)
268
{
413
{
269
    size_t  i;
414
    size_t  i;
270
    const char	 *c = color->s;
415
    const char	 *c = colorp->s;
271
    int	   original_output_raw = output_raw;
416
    int	   original_output_raw = output_raw;
272
417
273
    output_raw = TRUE;
418
    output_raw = TRUE;
274
    cleanup_push(&original_output_raw, output_raw_restore);
419
    cleanup_push(&original_output_raw, output_raw_restore);
275
    for (i = color->len; 0 < i; i--)
420
    for (i = colorp->len; 0 < i; i--)
276
	xputchar(*c++);
421
	xputchar(*c++);
277
    cleanup_until(&original_output_raw);
422
    cleanup_until(&original_output_raw);
278
}
423
}
Lines 286-297 Link Here
286
    size_t  i;
431
    size_t  i;
287
    char   *filename = short2str(fname);
432
    char   *filename = short2str(fname);
288
    char   *last = filename + len;
433
    char   *last = filename + len;
289
    Str	   *color = &variables[VFile].color;
434
    Str	   *colorp = &variables[VFile].color;
290
435
291
    switch (suffix) {
436
    switch (suffix) {
292
    case '>':			/* File is a symbolic link pointing to
437
    case '>':			/* File is a symbolic link pointing to
293
				 * a directory */
438
				 * a directory */
294
	color = &variables[VDir].color;
439
	colorp = &variables[VDir].color;
295
	break;
440
	break;
296
    case '+':			/* File is a hidden directory [aix] or
441
    case '+':			/* File is a hidden directory [aix] or
297
				 * context dependent [hpux] */
442
				 * context dependent [hpux] */
Lines 301-307 Link Here
301
	for (i = 0; i < nvariables; i++)
446
	for (i = 0; i < nvariables; i++)
302
	    if (variables[i].suffix != NOS &&
447
	    if (variables[i].suffix != NOS &&
303
		(Char)variables[i].suffix == suffix) {
448
		(Char)variables[i].suffix == suffix) {
304
		color = &variables[i].color;
449
		colorp = &variables[i].color;
305
		break;
450
		break;
306
	    }
451
	    }
307
	if (i == nvariables) {
452
	if (i == nvariables) {
Lines 310-316 Link Here
310
		    && strncmp(last - extensions[i].extension.len,
455
		    && strncmp(last - extensions[i].extension.len,
311
			       extensions[i].extension.s,
456
			       extensions[i].extension.s,
312
			       extensions[i].extension.len) == 0) {
457
			       extensions[i].extension.len) == 0) {
313
		  color = &extensions[i].color;
458
		  colorp = &extensions[i].color;
314
		break;
459
		break;
315
	    }
460
	    }
316
	}
461
	}
Lines 318-324 Link Here
318
    }
463
    }
319
464
320
    put_color(&variables[VLeft].color);
465
    put_color(&variables[VLeft].color);
321
    put_color(color);
466
    put_color(colorp);
322
    put_color(&variables[VRight].color);
467
    put_color(&variables[VRight].color);
323
}
468
}
324
469
(-)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.44 2014/07/24 10:50:15 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.44 2014/07/24 10:50:15 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(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 (-5 / +5 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.136 2015/05/04 15:31:13 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.136 2015/05/04 15:31:13 christos Exp $")
39
39
40
#include "tw.h"
40
#include "tw.h"
41
#include "ed.h"
41
#include "ed.h"
Lines 1236-1242 Link Here
1236
tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
1236
tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
1237
{
1237
{
1238
    Char *ptr;
1238
    Char *ptr;
1239
    Char *dollar;
1239
    Char *dol;
1240
    struct varent *vp;
1240
    struct varent *vp;
1241
1241
1242
    (void) strip(exp_name);
1242
    (void) strip(exp_name);
Lines 1258-1265 Link Here
1258
	else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
1258
	else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
1259
	    return ' ';
1259
	    return ' ';
1260
1260
1261
	if ((dollar = Strrchr(word->s, '$')) != 0 && 
1261
	if ((dol = Strrchr(word->s, '$')) != 0 && 
1262
	    dollar[1] == '{' && Strchr(dollar, '}') == NULL)
1262
	    dol[1] == '{' && Strchr(dol, '}') == NULL)
1263
	  return '}';
1263
	  return '}';
1264
1264
1265
	return isadirectory(exp_dir, ptr) ? '/' : ' ';
1265
	return isadirectory(exp_dir, ptr) ? '/' : ' ';

Return to bug 207860