-This is tcsh version 6.15. Tcsh is a version of the Berkeley
+This is tcsh version 6.17.00. Tcsh is a version of the Berkeley
C-Shell, with the addition of: a command line editor, command and file
name completion, listing, etc. and a bunch of small additions to the
shell itself.
#
-# $tcsh: complete.tcsh,v 1.47 2006/03/02 18:46:44 christos Exp $
+# $tcsh: complete.tcsh,v 1.51 2007/10/01 21:51:59 christos Exp $
# example file using the new completion code
#
# Debian GNU/Linux
if ($?_complete) then
set noglob
if ( ! $?hosts ) set hosts
- foreach f ($HOME/.hosts /usr/local/etc/csh.hosts $HOME/.rhosts /etc/hosts.equiv)
- if ( -r $f ) then
- set hosts = ($hosts `grep -v "+" $f | grep -E -v "^#" | tr -s " " " " | cut -f 1`)
+ foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv)
+ if ( -r "$f" ) then
+ set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " " " | cut -f 1`)
endif
end
- if ( -r $HOME/.netrc ) then
- set f=`awk '/machine/ { print $2 }' < $HOME/.netrc` >& /dev/null
+ if ( -r "$HOME/.netrc" ) then
+ set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null
set hosts=($hosts $f)
endif
- if ( -r $HOME/.ssh/known_hosts ) then
- set f=`cat $HOME/.ssh/known_hosts | cut -f 1 -d \ ` >& /dev/null
- set f=`cat $HOME/.ssh/known_hosts | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
+ if ( -r "$HOME/.ssh/known_hosts" ) then
+ set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null
+ set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
set hosts=($hosts $f)
endif
unset f
# these should be merged with the MH completion hacks below - jgotts
complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
- c@+@F:$HOME/Mail/@
+ "c@+@F:$HOME/Mail/@"
# these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
complete {rexec,rxexec,rxterm,rmterm} \
complete setenv 'p/1/e/' 'c/*:/f/'
# these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
- if ( -f $HOME/.mh_profile && -x "`which folders`" ) then
+ if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then
if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`"
logout rdiff release remove rtag status tag unedit \
update watch watchers)/' 'n/-a/(edit unedit commit \
all none)/' 'n/watch/(on off add remove)/'
+ complete svn 'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
+ 'n@ls@(file:/// svn+ssh:// svn://)@@' \
+ 'n@help@(add blame cat checkout \
+ cleanup commit copy delete export help \
+ import info list ls lock log merge mkdir \
+ move propdel propedit propget proplist \
+ propset resolved revert status switch unlock \
+ update)@' 'p@1@(add blame cat checkout \
+ cleanup commit copy delete export help \
+ import info list ls lock log merge mkdir \
+ move propdel propedit propget proplist \
+ propset resolved revert status switch unlock \
+ update)@'
complete cxx 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
complete detex 'p/*/f:*.tex/'
complete edquota 'n/*/u/'
flush-logs flush-status flush-tables flush-privileges \
kill password ping processlist reload refresh \
shutdown status variables version)/'
- complete mutt c@-f=@F:${HOME}/Mail/@ \
+ complete mutt "c@-f=@F:${HOME}/Mail/@" \
n/-a/f/ \
n/-F/f/ n/-H/f/ \
n/-s/x:'<subject line>'/ \
n/-e/x:'<command>'/ \
- n@-b@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@ \
- n@-c@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@ \
- n@*@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@
+ n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
+ n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
+ n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
complete ndc 'n/*/(status dumpdb reload stats trace notrace \
querylog start stop restart )/'
if ($?traditional_complete) then
complete unsetenv n/*/e/
set _maildir = /var/mail
- if (-r $HOME/.mailrc) then
+ if (-r "$HOME/.mailrc") then
complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
- c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
+ "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
n@-u@T:$_maildir@ n/-f/f/ \
- n@*@'`sed -n s/alias//p $HOME/.mailrc | tr -s " " " " | cut -f 2`'@
+ n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
+ tr -s " " " " | cut -f 2`'@
else
complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
- c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
+ "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
n@-u@T:$_maildir@ n/-f/f/ n/*/u/
endif
unset _maildir
N/{-C,--directory}/'`\ls $:-1`'/ \
n/-[0-7]/"(l m h)"/
- # Linux filesystems
- complete mount c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
- n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
- n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
- n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
- complete umount c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
- n/*/'`mount | cut -d " " -f 3`'/
- # Solaris filesystems
- #complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
- # n/-o/x:'<FSType_options>'/ \
- # n@-F@'`\ls -1 /usr/lib/fs`'@ \
- # n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
- #complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
- # n/*/'`mount | cut -d " " -f 1`'/
- #complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
- #complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
- # n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
+ switch ( "$OSTYPE" )
+ case "linux":
+ # Linux filesystems
+ complete mount c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
+ n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
+ n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
+ n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
+ complete umount c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
+ n/*/'`mount | cut -d " " -f 3`'/
+ breaksw
+ case "sunos*":
+ case "solaris":
+ # Solaris filesystems
+ complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
+ n/-o/x:'<FSType_options>'/ \
+ n@-F@'`\ls -1 /usr/lib/fs`'@ \
+ n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
+ complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
+ n/*/'`mount | cut -d " " -f 1`'/
+ complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
+ complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
+ n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
+ breaksw
+ case "cygwin":
+ # Cygwin mounts
+ complete mount c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
+ n/-c/x:'/'/ \
+ n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
+ n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
+ complete umount c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
+ n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
+ breaksw
+ default:
+ breaksw
+ endsw
# these deal with NIS (formerly YP); if it's not running you don't need 'em
if (-X domainname) then
--- /dev/null
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2005 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+cc_basename=`echo "$CC" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case "$cc_basename" in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = yes; then
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case "$cc_basename" in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10* | hpux11*)
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4.2uw2*)
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ ;;
+ sysv5*)
+ hardcode_libdir_flag_spec=
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ ;;
+ aix4* | aix5*)
+ ;;
+ amigaos*)
+ ;;
+ beos*)
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ ;;
+ dgux*)
+ ;;
+ freebsd1*)
+ ;;
+ kfreebsd*-gnu)
+ ;;
+ freebsd*)
+ ;;
+ gnu*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case "$host_cpu" in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux*)
+ ;;
+ knetbsd*-gnu)
+ ;;
+ netbsd*)
+ ;;
+ newsos6)
+ ;;
+ nto-qnx*)
+ ;;
+ openbsd*)
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ ;;
+ osf3* | osf4* | osf5*)
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ ;;
+ sunos4*)
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ ;;
+ sysv4*MP*)
+ ;;
+ uts4*)
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
-/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.40 2006/08/28 14:53:04 mitr Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.42 2009/06/25 12:10:56 christos Exp $ */
/*
* config_f.h -- configure various defines for tcsh
*
* This can be much slower and no memory statistics will be
* provided.
*/
-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__linux__)
+#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__)
# define SYSMALLOC
#else
# undef SYSMALLOC
# ifndef __GNUC__
# define RCSID(id) static char *rcsid = (id);
# else
-# define RCSID(id) static char *rcsid(const char *a) { return rcsid(a = id); }
+# define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id);
# endif /* !__GNUC__ */
#else
# define RCSID(id) /* Nothing */
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.93 2006/08/23 15:03:13 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.95 2009/06/25 21:15:37 christos Exp $ */
/*
* ed.chared.c: Character editing functions.
*/
#include "sh.h"
-RCSID("$tcsh: ed.chared.c,v 3.93 2006/08/23 15:03:13 christos Exp $")
+RCSID("$tcsh: ed.chared.c,v 3.95 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "tw.h"
static Char *c_next_word (Char *, Char *, int);
static Char *c_number (Char *, int *, int);
static Char *c_expand (Char *);
-static void c_excl (Char *);
-static void c_substitute (void);
+static int c_excl (Char *);
+static int c_substitute (void);
static void c_delfini (void);
static int c_hmatch (Char *);
static void c_hsetpat (void);
* space (or the beginning of the buffer) and properly expand all the excl's
* from there up to the current cursor position. We also avoid (trying to)
* expanding '>!'
+ * Returns number of expansions attempted (doesn't matter whether they succeeded
+ * or not).
*/
-static void
+static int
c_excl(Char *p)
{
int i;
Char *q;
+ int nr_exp;
/*
* if />[SPC TAB]*![SPC TAB]/, back up p to just after the >. otherwise,
/*
* Forever: Look for history char. (Stop looking when we find the cursor.)
- * Count backslashes. Of odd, skip history char. Return if all done.
- * Expand if even number of backslashes.
+ * Count backslashes. If odd, skip history char. Expand if even number of
+ * backslashes.
*/
+ nr_exp = 0;
for (;;) {
while (*p != HIST && p < Cursor)
++p;
continue;
if (i % 2 == 0)
++p;
- if (p >= Cursor)
- return;
- if (i % 2 == 1)
+ if (p >= Cursor) /* all done */
+ return nr_exp;
+ if (i % 2 == 1) {
p = c_expand(p);
+ ++nr_exp;
+ }
}
+
+ return nr_exp;
}
-static void
+static int
c_substitute(void)
{
Char *p;
+ int nr_exp;
/*
* Start p out one character before the cursor. Move it backwards looking
* If we found a history character, go expand it.
*/
if (*p == HIST)
- c_excl(p);
+ nr_exp = c_excl(p);
+ else
+ nr_exp = 0;
Refresh();
+
+ return nr_exp;
}
static void
return(CC_NORM);
}
+/* returns the number of (attempted) expansions */
+int
+ExpandHistory(void)
+{
+ *LastChar = '\0'; /* just in case */
+ return c_substitute();
+}
+
/*ARGSUSED*/
CCRETVAL
e_expand_history(Char c)
{
USE(c);
- *LastChar = '\0'; /* just in case */
- c_substitute();
+ (void)ExpandHistory();
return(CC_NORM);
}
{
USE(c);
*LastChar = '\0'; /* just in case */
- c_substitute();
+ (void)c_substitute();
return(e_insert(' '));
}
*/
if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0)
#endif
- xprintf(CGETS(5, 1, "Load average unavailable\n"));
+ xprintf("%s", CGETS(5, 1, "Load average unavailable\n"));
return(CC_REFRESH);
}
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.44 2006/08/23 15:03:13 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.45 2008/10/17 20:25:00 christos Exp $ */
/*
* ed.decls.h: Editor external definitions
*/
* ed.chared.c
*/
extern int InsertStr (Char *);
+extern int ExpandHistory (void);
extern void DeleteBack (int);
extern void SetKillRing (int);
extern CCRETVAL GetHistLine (void);
extern CCRETVAL e_tty_int (Char);
extern CCRETVAL e_run_fg_editor (Char);
extern CCRETVAL e_list_eof (Char);
+extern int e_expand_history_rne (Char);
extern CCRETVAL e_expand_history (Char);
extern CCRETVAL e_magic_space (Char);
extern CCRETVAL e_list_glob (Char);
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.49 2006/08/23 15:03:13 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.50 2007/07/05 14:13:06 christos Exp $ */
/*
* ed.h: Editor declarations and globals
*/
# define NT_NUM_KEYS 256
#endif /* WINNT_NATIVE */
+#ifdef __QNXNTO__
+#undef min
+#undef max
+#endif
+
/****************************************************************************/
/* stuff for the different states returned by the character editor routines */
/****************************************************************************/
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.66 2006/11/29 22:32:24 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.70 2009/06/25 21:15:37 christos Exp $ */
/*
* ed.inputl.c: Input line handling.
*/
*/
#include "sh.h"
-RCSID("$tcsh: ed.inputl.c,v 3.66 2006/11/29 22:32:24 christos Exp $")
+RCSID("$tcsh: ed.inputl.c,v 3.70 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "ed.defns.h" /* for the function names */
extern int MapsAreInited;
/* mismatched first character */
-static Char mismatch[] =
- {'!', '^' , '\\', '-', '%', '\0', '"', '\'', '`', '\0' };
+static Char mismatch[] = { '\\', '-', '%', '\0' };
+/* don't Strchr() for '\0', obey current history character settings */
+#define MISMATCH(c) ((c) == '\0' || (c) == HIST || (c) == HISTSUB || \
+ Strchr(mismatch, (c)))
static int Repair (void);
static int GetNextCommand (KEYCMD *, Char *);
struct varent *imode = adrof(STRinputmode);
Char *SaveChar, *CorrChar;
int matchval; /* from tenematch() */
+ int nr_history_exp; /* number of (attempted) history expansions */
COMMAND fn;
int curlen = 0;
int newlen;
int idx;
+ Char *autoexpand;
if (!MapsAreInited) /* double extra just in case */
ed_InitMaps();
ch = tch;
if (ch == 'y' || ch == ' ') {
LastChar = CorrChar; /* Restore the corrected end */
- xprintf(CGETS(6, 2, "yes\n"));
+ xprintf("%s", CGETS(6, 2, "yes\n"));
}
else {
Strcpy(InputBuf, Origin);
LastChar = SaveChar;
if (ch == 'e') {
- xprintf(CGETS(6, 3, "edit\n"));
+ xprintf("%s", CGETS(6, 3, "edit\n"));
*LastChar-- = '\0';
Cursor = LastChar;
printprompt(3, NULL);
break;
}
else if (ch == 'a') {
- xprintf(CGETS(6, 4, "abort\n"));
+ xprintf("%s", CGETS(6, 4, "abort\n"));
LastChar = InputBuf; /* Null the current line */
Cursor = LastChar;
printprompt(0, NULL);
cleanup_until(Origin);
break;
}
- xprintf(CGETS(6, 5, "no\n"));
+ xprintf("%s", CGETS(6, 5, "no\n"));
}
flush();
}
PastBottom();
}
if (matchval == 0) {
- xprintf(CGETS(6, 6, "No matching command\n"));
+ xprintf("%s", CGETS(6, 6, "No matching command\n"));
} else if (matchval == 2) {
- xprintf(CGETS(6, 7, "Ambiguous command\n"));
+ xprintf("%s", CGETS(6, 7, "Ambiguous command\n"));
}
if (NeedsRedraw) {
ClearLines();
curlen = (int) (LastChar - InputBuf);
- if (adrof(STRautoexpand))
- (void) e_expand_history(0);
- /*
- * Modified by Martin Boyer (gamin@ireq-robot.hydro.qc.ca):
- * A separate variable now controls beeping after
- * completion, independently of autolisting.
- */
- expnum = (int) (Cursor - InputBuf);
- switch (matchval = tenematch(InputBuf, Cursor-InputBuf, fn)){
- case 1:
- if (non_unique_match && matchbeep && matchbeep->vec != NULL &&
- (Strcmp(*(matchbeep->vec), STRnotunique) == 0))
- SoundBeep();
- break;
- case 0:
- if (matchbeep && matchbeep->vec != NULL) {
- if (Strcmp(*(matchbeep->vec), STRnomatch) == 0 ||
- Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
- Strcmp(*(matchbeep->vec), STRnotunique) == 0)
+ nr_history_exp = 0;
+ autoexpand = varval(STRautoexpand);
+ if (autoexpand != STRNULL)
+ nr_history_exp += ExpandHistory();
+
+ /* try normal expansion only if no history references were found */
+ if (nr_history_exp == 0 ||
+ Strcmp(autoexpand, STRonlyhistory) != 0) {
+ /*
+ * Modified by Martin Boyer (gamin@ireq-robot.hydro.qc.ca):
+ * A separate variable now controls beeping after
+ * completion, independently of autolisting.
+ */
+ expnum = (int) (Cursor - InputBuf);
+ switch (matchval = tenematch(InputBuf, Cursor-InputBuf, fn)){
+ case 1:
+ if (non_unique_match && matchbeep &&
+ matchbeep->vec != NULL &&
+ (Strcmp(*(matchbeep->vec), STRnotunique) == 0))
SoundBeep();
- }
- else
- SoundBeep();
- break;
- default:
- if (matchval < 0) { /* Error from tenematch */
- curchoice = -1;
- SoundBeep();
break;
- }
- if (matchbeep && matchbeep->vec != NULL) {
- if ((Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
- Strcmp(*(matchbeep->vec), STRnotunique) == 0))
+ case 0:
+ if (matchbeep && matchbeep->vec != NULL) {
+ if (Strcmp(*(matchbeep->vec), STRnomatch) == 0 ||
+ Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
+ Strcmp(*(matchbeep->vec), STRnotunique) == 0)
+ SoundBeep();
+ }
+ else
SoundBeep();
- }
- else
- SoundBeep();
- /*
- * Addition by David C Lawrence <tale@pawl.rpi.edu>: If an
- * attempted completion is ambiguous, list the choices.
- * (PWP: this is the best feature addition to tcsh I have
- * seen in many months.)
- */
- if (autol && autol->vec != NULL &&
- (Strcmp(*(autol->vec), STRambiguous) != 0 ||
- expnum == Cursor - InputBuf)) {
- if (adrof(STRhighlight) && MarkIsSet) {
- /* clear highlighting before showing completions */
- MarkIsSet = 0;
- ClearLines();
- ClearDisp();
- Refresh();
- MarkIsSet = 1;
+ break;
+ default:
+ if (matchval < 0) { /* Error from tenematch */
+ curchoice = -1;
+ SoundBeep();
+ break;
}
- PastBottom();
- fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST;
- (void) tenematch(InputBuf, Cursor-InputBuf, fn);
+ if (matchbeep && matchbeep->vec != NULL) {
+ if ((Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
+ Strcmp(*(matchbeep->vec), STRnotunique) == 0))
+ SoundBeep();
+ }
+ else
+ SoundBeep();
+ /*
+ * Addition by David C Lawrence <tale@pawl.rpi.edu>: If an
+ * attempted completion is ambiguous, list the choices.
+ * (PWP: this is the best feature addition to tcsh I have
+ * seen in many months.)
+ */
+ if (autol && autol->vec != NULL &&
+ (Strcmp(*(autol->vec), STRambiguous) != 0 ||
+ expnum == Cursor - InputBuf)) {
+ if (adrof(STRhighlight) && MarkIsSet) {
+ /* clear highlighting before showing completions */
+ MarkIsSet = 0;
+ ClearLines();
+ ClearDisp();
+ Refresh();
+ MarkIsSet = 1;
+ }
+ PastBottom();
+ fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST;
+ (void) tenematch(InputBuf, Cursor-InputBuf, fn);
+ }
+ break;
}
- break;
}
if (NeedsRedraw) {
PastBottom();
Cursor--;
endflag = 0;
}
- /* Obey current history character settings */
- mismatch[0] = HIST;
- mismatch[1] = HISTSUB;
- if (!Strchr(mismatch, *argptr) &&
+ if (!MISMATCH(*argptr) &&
(!cmdonly || starting_a_command(argptr, InputBuf))) {
#ifdef WINNT_NATIVE
/*
Cursor--;
endflag = 0;
}
- if (!Strchr(mismatch, *argptr) && starting_a_command(argptr, InputBuf)) {
+ if (!MISMATCH(*argptr) && starting_a_command(argptr, InputBuf)) {
tmatch = tenematch(InputBuf, Cursor - InputBuf, RECOGNIZE);
if (tmatch <= 0) {
return 0;
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.75 2006/08/24 20:56:31 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.76 2009/06/25 21:15:37 christos Exp $ */
/*
* ed.screen.c: Editor/termcap-curses interface
*/
*/
#include "sh.h"
-RCSID("$tcsh: ed.screen.c,v 3.75 2006/08/24 20:56:31 christos Exp $")
+RCSID("$tcsh: ed.screen.c,v 3.76 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "tc.h"
struct termcapstr *t;
char *first, *s;
- xprintf(CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n"));
- xprintf(CGETS(7, 2, "\tfollowing characteristics:\n\n"));
+ xprintf("%s", CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n"));
+ xprintf("%s", CGETS(7, 2, "\tfollowing characteristics:\n\n"));
xprintf(CGETS(7, 3, "\tIt has %d columns and %d lines\n"),
Val(T_co), Val(T_li));
s = strsave(T_HasMeta ? CGETS(7, 5, "a") : CGETS(7, 6, "no"));
scap = tgetstr(cv, &area);
if (!scap || scap[0] == '\0') {
if (tgetflag(cv)) {
- xprintf(CGETS(7, 14, "yes\n"));
+ xprintf("%s", CGETS(7, 14, "yes\n"));
goto end;
}
if (silent)
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.17 2004/12/25 21:15:06 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.18 2007/07/05 14:13:06 christos Exp $ */
/*
* ed.term.h: Local terminal header
*/
* Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
* struct ltchars
*/
-#if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
+#if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
# undef TIOCGLTC /* not really needed */
# undef TIOCSLTC
#endif
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.36 2006/11/29 22:30:09 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.37 2009/06/25 21:15:37 christos Exp $ */
/*
* ed.xmap.c: This module contains the procedures for maintaining
* the extended-key map.
*/
#include "sh.h"
-RCSID("$tcsh: ed.xmap.c,v 3.36 2006/11/29 22:30:09 christos Exp $")
+RCSID("$tcsh: ed.xmap.c,v 3.37 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "ed.defns.h"
cs.buf = Xkey->buf;
cs.len = Xkey->len;
if (Xkey->len == 0) {
- xprintf(CGETS(9, 1, "AddXkey: Null extended-key not allowed.\n"));
+ xprintf("%s", CGETS(9, 1, "AddXkey: Null extended-key not allowed.\n"));
return;
}
if (ntype == XK_CMD && val->cmd == F_XKEY) {
- xprintf(CGETS(9, 2, "AddXkey: sequence-lead-in command not allowed\n"));
+ xprintf("%s",
+ CGETS(9, 2, "AddXkey: sequence-lead-in command not allowed\n"));
return;
}
s = *Xkey;
if (s.len == 0) {
- xprintf(CGETS(9, 3, "DeleteXkey: Null extended-key not allowed.\n"));
+ xprintf("%s",
+ CGETS(9, 3, "DeleteXkey: Null extended-key not allowed.\n"));
return (-1);
}
val = (val << 3) | (ch - '0');
}
if ((val & ~0xff) != 0) {
- xprintf(CGETS(9, 9,
+ xprintf("%s", CGETS(9, 9,
"Octal constant does not fit in a char.\n"));
return 0;
}
len = mblen((const char *)(patnext - 1), MB_LEN_MAX);
if (len == -1)
- mblen(NULL, 0);
- if (len > 1) {
+ (void)mblen(NULL, 0);
+ else if (len > 1) {
*bufnext++ = (Char) c;
while (--len != 0)
*bufnext++ = (Char) (*patnext++ | M_PROTECT);
-/* $Header: /p/tcsh/cvsroot/tcsh/patchlevel.h,v 3.161 2007/03/03 20:01:26 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/patchlevel.h,v 3.167 2009/07/10 17:09:32 christos Exp $ */
/*
* patchlevel.h: Our life story.
*/
#define ORIGIN "Astron"
#define REV 6
-#define VERS 15
+#define VERS 17
#define PATCHLEVEL 0
-#define DATE "2007-03-03"
+#define DATE "2009-07-10"
#endif /* _h_patchlevel */
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.c,v 3.136 2007/02/22 21:57:37 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.c,v 3.145 2009/06/25 21:15:37 christos Exp $ */
/*
* sh.c: Main shell routines
*/
All rights reserved.\n";
#endif /* not lint */
-RCSID("$tcsh: sh.c,v 3.136 2007/02/22 21:57:37 christos Exp $")
+RCSID("$tcsh: sh.c,v 3.145 2009/06/25 21:15:37 christos Exp $")
#include "tc.h"
#include "ed.h"
Char HIST;
int cantell;
struct Bin B;
+ int justpr;
};
static int srccat (Char *, Char *);
xclose(f);
}
-#ifdef O_TEXT
- setmode(0, O_TEXT);
-#endif
-
osinit(); /* Os dependent initialization */
if (*cp) {
/* only for login shells or root and we must have a tty */
if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
- cp = cp2 + 1;
+ cp2 = cp2 + 1;
}
else
cp2 = cp;
if (!(((Strncmp(cp2, STRtty, 3) == 0) && Isalpha(cp2[3])) ||
- ((Strncmp(cp, STRpts, 3) == 0) && cp[3] == '/'))) {
+ Strstr(cp, STRptssl) != NULL)) {
if (getenv("DISPLAY") == NULL) {
/* NOT on X window shells */
setcopy(STRautologout, STRdefautologout, VAR_READWRITE);
}
if (argc > 1 && strcmp(argv[1], "--help") == 0) {
xprintf("%S\n\n", varval(STRversion));
- xprintf(CGETS(11, 8, HELP_STRING));
+ xprintf("%s", CGETS(11, 8, HELP_STRING));
xexit(0);
}
/*
/* ... doesn't return */
stderror(ERR_SYSTEM, tempv[0], strerror(errno));
}
-#ifdef O_TEXT
- setmode(nofile, O_TEXT);
-#endif
xfree(ffile);
dolzero = 1;
ffile = SAVE(tempv[0]);
}
#endif /* NeXT */
#ifdef BSDJOBS /* if we have tty job control */
- retry:
- if ((tpgrp = tcgetpgrp(f)) != -1) {
- if (tpgrp != shpgrp) {
- struct sigaction old;
-
- sigaction(SIGTTIN, NULL, &old);
- signal(SIGTTIN, SIG_DFL);
- (void) kill(0, SIGTTIN);
- sigaction(SIGTTIN, &old, NULL);
- goto retry;
- }
+ if (grabpgrp(f, shpgrp) != -1) {
/*
* Thanks to Matt Day for the POSIX references, and to
* Paul Close for the SGI clarification.
if (tpgrp == -1) {
notty:
xprintf(CGETS(11, 1, "Warning: no access to tty (%s).\n"),
- strerror(errno));
- xprintf(CGETS(11, 2, "Thus no job control in this shell.\n"));
+ strerror(errno));
+ xprintf("%s",
+ CGETS(11, 2, "Thus no job control in this shell.\n"));
/*
* Fix from:Sakari Jalovaara <sja@sirius.hut.fi> if we don't
* have access to tty, disable editing too
if ((unit = xopen(f, O_RDONLY|O_LARGEFILE)) == -1)
return 0;
-#ifdef O_TEXT
- setmode(unit, O_TEXT);
-#endif
cleanup_push(&unit, open_cleanup);
unit = dmove(unit, -1);
cleanup_ignore(&unit);
st->alvec = alvec;
st->onelflg = onelflg;
st->enterhist = enterhist;
+ st->justpr = justpr;
if (hflg)
st->HIST = HIST;
else
HIST = st->HIST;
enterhist = st->enterhist;
cantell = st->cantell;
+ justpr = st->justpr;
if (st->argv != NULL)
setq(STRargv, st->argv, &shvhed, VAR_READWRITE);
size_t omark;
sigset_t set;
+ sigemptyset(&set);
signal(SIGQUIT, SIG_IGN);
sigaddset(&set, SIGQUIT);
sigprocmask(SIG_UNBLOCK, &set, NULL);
jmp_buf_t osetexit;
/* PWP: This might get nuked my longjmp so don't make it a register var */
size_t omark;
+ volatile int didexitset = 0;
getexit(osetexit);
omark = cleanup_push_mark();
- exitset++;
for (;;) {
struct command *t;
int hadhist, old_pintr_disabled;
- (void) setexit();
+ (void)setexit();
+ if (didexitset == 0) {
+ exitset++;
+ didexitset++;
+ }
pendjob();
justpr = enterhist; /* execute if not entering history */
cmd_done:
cleanup_until(¶ml);
}
- exitset--;
cleanup_pop_mark(omark);
resexit(osetexit);
+ exitset--;
}
/*ARGSUSED*/
rechist(NULL, adrof(STRsavehist) != NULL);
}
}
+
+/*
+ * Grab the tty repeatedly, and give up if we are not in the correct
+ * tty process group.
+ */
+int
+grabpgrp(int fd, pid_t desired)
+{
+ struct sigaction old;
+ pid_t pgrp;
+ size_t i;
+
+ for (i = 0; i < 100; i++) {
+ if ((pgrp = tcgetpgrp(fd)) == -1)
+ return -1;
+ if (pgrp == desired)
+ return 0;
+ (void)sigaction(SIGTTIN, NULL, &old);
+ (void)signal(SIGTTIN, SIG_DFL);
+ (void)kill(0, SIGTTIN);
+ (void)sigaction(SIGTTIN, &old, NULL);
+ }
+ errno = EPERM;
+ return -1;
+}
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.c,v 3.19 2006/03/02 18:46:44 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.c,v 3.20 2007/03/07 16:31:37 christos Exp $ */
/*
* sh.char.c: Character classification tables
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.char.c,v 3.19 2006/03/02 18:46:44 christos Exp $")
+RCSID("$tcsh: sh.char.c,v 3.20 2007/03/07 16:31:37 christos Exp $")
#include "sh.char.h"
-#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
/* on default same as original map */
unsigned short _cmap[256] = {
/* 0 nul 1 soh 2 stx 3 etx */
/* 124 | 125 } 126 ~ 127 del */
_META|_CMD|_PUN,_PUN, _PUN, _CTR,
+#ifdef SHORT_STRINGS
/****************************************************************/
/* 128 - 255 The below is supposedly ISO 8859/1 */
/****************************************************************/
/* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */
_LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
};
+#endif /* SHORT_STRINGS */
+
+#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
/* original table */
unsigned short _cmap_c[256] = {
/* 0 nul 1 soh 2 stx 3 etx */
/* f8 f9 fa fb fc fd fe ff*/
_MB1, _MB1, _MB1, _MB1, _MB1, _MB1, 0, 0
};
-
-#else /* !(defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)) */
-unsigned short _cmap[256] = {
-/* 0 nul 1 soh 2 stx 3 etx */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 4 eot 5 enq 6 ack 7 bel */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 8 bs 9 ht 10 nl 11 vt */
- _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR,
-
-/* 12 np 13 cr 14 so 15 si */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 16 dle 17 dc1 18 dc2 19 dc3 */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 20 dc4 21 nak 22 syn 23 etb */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 24 can 25 em 26 sub 27 esc */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 28 fs 29 gs 30 rs 31 us */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 32 sp 33 ! 34 " 35 # */
- _SP|_META, _PUN, _QF|_PUN, _META|_PUN,
-
-/* 36 $ 37 % 38 & 39 ' */
- _DOL|_PUN, _PUN, _META|_CMD|_PUN,_QF|_PUN,
-
-/* 40 ( 41 ) 42 * 43 + */
- _META|_CMD|_PUN,_META|_PUN, _GLOB|_PUN, _PUN,
-
-/* 44 , 45 - 46 . 47 / */
- _PUN, _PUN, _PUN, _PUN,
-
-/* 48 0 49 1 50 2 51 3 */
- _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
-
-/* 52 4 53 5 54 6 55 7 */
- _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
-
-/* 56 8 57 9 58 : 59 ; */
- _DIG|_XD, _DIG|_XD, _PUN, _META|_CMD|_PUN,
-
-/* 60 < 61 = 62 > 63 ? */
- _META|_PUN, _PUN, _META|_PUN, _GLOB|_PUN,
-
-/* 64 @ 65 A 66 B 67 C */
- _PUN, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD,
-
-/* 68 D 69 E 70 F 71 G */
- _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP,
-
-/* 72 H 73 I 74 J 75 K */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 76 L 77 M 78 N 79 O */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 80 P 81 Q 82 R 83 S */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 84 T 85 U 86 V 87 W */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 88 X 89 Y 90 Z 91 [ */
- _LET|_UP, _LET|_UP, _LET|_UP, _GLOB|_PUN,
-
-/* 92 \ 93 ] 94 ^ 95 _ */
- _ESC|_PUN, _PUN, _PUN, _PUN,
-
-/* 96 ` 97 a 98 b 99 c */
- _QB|_GLOB|_META|_PUN, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD,
-
-/* 100 d 101 e 102 f 103 g */
- _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW|_XD, _LET|_DOW,
-
-/* 104 h 105 i 106 j 107 k */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 108 l 109 m 110 n 111 o */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 112 p 113 q 114 r 115 s */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 116 t 117 u 118 v 119 w */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 120 x 121 y 122 z 123 { */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _GLOB|_PUN,
-
-/* 124 | 125 } 126 ~ 127 del */
- _META|_CMD|_PUN,_PUN, _PUN, _CTR,
-
-#ifdef SHORT_STRINGS
-/****************************************************************/
-/* 128 - 255 The below is supposedly ISO 8859/1 */
-/****************************************************************/
-/* 128 (undef) 129 (undef) 130 (undef) 131 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 132 (undef) 133 (undef) 134 (undef) 135 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 136 (undef) 137 (undef) 138 (undef) 139 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 140 (undef) 141 (undef) 142 (undef) 143 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 144 (undef) 145 (undef) 146 (undef) 147 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 148 (undef) 149 (undef) 150 (undef) 151 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 152 (undef) 153 (undef) 154 (undef) 155 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 156 (undef) 157 (undef) 158 (undef) 159 (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* 160 nobreakspace 161 exclamdown 162 cent 163 sterling */
- _PUN, /* XXX */ _PUN, _PUN, _PUN,
-
-/* 164 currency 165 yen 166 brokenbar 167 section */
- _PUN, _PUN, _PUN, _PUN,
-
-/* 168 diaeresis 169 copyright 170 ordfeminine 171 guillemotleft*/
- _PUN, _PUN, _PUN, _PUN,
-
-/* 172 notsign 173 hyphen 174 registered 175 macron */
- _PUN, _PUN, _PUN, _PUN,
-
-/* 176 degree 177 plusminus 178 twosuperior 179 threesuperior*/
- _PUN, _PUN, _PUN, _PUN,
-
-/* 180 acute 181 mu 182 paragraph 183 periodcentered*/
- _PUN, _PUN, /*XXX*/ _PUN, _PUN,
-
-/* 184 cedilla 185 onesuperior 186 masculine 187 guillemotright*/
- _PUN, _PUN, _PUN, _PUN,
-
-/* 188 onequarter 189 onehalf 190 threequarters 191 questiondown*/
- _PUN, _PUN, _PUN, _PUN,
-
-/* 192 Agrave 193 Aacute 194 Acircumflex 195 Atilde */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 196 Adiaeresis 197 Aring 198 AE 199 Ccedilla */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 200 Egrave 201 Eacute 202 Ecircumflex 203 Ediaeresis */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 204 Igrave 205 Iacute 206 Icircumflex 207 Idiaeresis */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 208 ETH 209 Ntilde 210 Ograve 211 Oacute */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 212 Ocircumflex 213 Otilde 214 Odiaeresis 215 multiply */
- _LET|_UP, _LET|_UP, _LET|_UP, _PUN,
-
-/* 216 Ooblique 217 Ugrave 218 Uacute 219 Ucircumflex */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* 220 Udiaeresis 221 Yacute 222 THORN 223 ssharp */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_DOW,
-
-/* 224 agrave 225 aacute 226 acircumflex 227 atilde */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 228 adiaeresis 229 aring 230 ae 231 ccedilla */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 232 egrave 233 eacute 234 ecircumflex 235 ediaeresis */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 236 igrave 237 iacute 238 icircumflex 239 idiaeresis */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 240 eth 241 ntilde 242 ograve 243 oacute */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 244 ocircumflex 245 otilde 246 odiaeresis 247 division */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _PUN,
-
-/* 248 oslash 249 ugrave 250 uacute 251 ucircumflex */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-
-/* 252 udiaeresis 253 yacute 254 thorn 255 ydiaeresis */
- _LET|_DOW, _LET|_DOW, _LET|_DOW, _LET|_DOW,
-#endif /* SHORT_STRINGS */
-};
#endif /* defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE) */
#ifndef NLS
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.h,v 3.32 2006/09/26 16:44:37 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.char.h,v 3.35 2008/09/25 14:41:34 christos Exp $ */
/*
* sh.char.h: Table for spotting special characters quickly
* Makes for very obscure but efficient coding.
extern unsigned short _mbmap_utf8[];
/* VARIABLE Check str */
/* same compiler require #define even not define DSPMBYTE */
+#undef _MB1
#define _MB1 0x0001
+#undef _MB2
#define _MB2 0x0002
#ifndef NLS
#endif
+#ifndef __QNXNTO__
+#undef _QF
#define _QF 0x0001 /* '" (Forward quotes) */
+#undef _QB
#define _QB 0x0002 /* ` (Backquote) */
+#undef _SP
#define _SP 0x0004 /* space and tab */
+#else
+#undef _XD
+#define _XD 0x0001 /* As in <ctype.h> */
+#undef _UP
+#define _UP 0x0002 /* As in <ctype.h> */
+#undef _SP
+#define _SP 0x0004 /* As in <ctype.h> */
+#endif
+#undef _NL
#define _NL 0x0008 /* \n */
+#undef _META
#define _META 0x0010 /* lex meta characters, sp #'`";&<>()|\t\n */
+#undef _GLOB
#define _GLOB 0x0020 /* glob characters, *?{[` */
+#undef _ESC
#define _ESC 0x0040 /* \ */
+#undef _DOL
#define _DOL 0x0080 /* $ */
+#undef _DIG
#define _DIG 0x0100 /* 0-9 */
+#undef _LET
#define _LET 0x0200 /* a-z, A-Z, _, or locale-specific */
+#ifndef __QNXNTO__
+#undef _UP
#define _UP 0x0400 /* A-Z, or locale-specific */
+#else
+#undef _QF
+#define _QF 0x0400 /* '" (Forward quotes) */
+#endif
+#undef _DOW
#define _DOW 0x0800 /* a-z, or locale-specific */
+#ifndef __QNXNTO__
+#undef _XD
#define _XD 0x1000 /* 0-9, a-f, A-F */
+#else
+#undef _QB
+#define _QB 0x1000 /* 0-9, a-f, A-F */
+#endif
+#undef _CMD
#define _CMD 0x2000 /* lex end of command chars, ;&(|` */
+#undef _CTR
#define _CTR 0x4000 /* control */
+#undef _PUN
#define _PUN 0x8000 /* punctuation */
#ifdef IS_ASCII
(iswalnum((tcshuc) (c)) || (c) == '_'))
#else
#define letter(c) (((Char)(c) & QUOTE) ? 0 : \
- (isalpha((tcshuc) (c)) || (c) == '_'))
+ ((isalpha((tcshuc) (c)) && !(cmap((c), _PUN))) \
+ || (c) == '_'))
#define alnum(c) (((Char)(c) & QUOTE) ? 0 : \
- (isalnum((tcshuc) (c)) || (c) == '_'))
+ ((isalnum((tcshuc) (c)) && !(cmap((c), _PUN))) \
+ || (c) == '_'))
+
#endif
#if defined(DSPMBYTE)
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.decls.h,v 3.53 2006/08/24 20:56:31 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.decls.h,v 3.55 2009/02/25 22:54:54 christos Exp $ */
/*
* sh.decls.h External declarations from sh*.c
*/
#else
extern void xexit (int);
#endif
+extern int grabpgrp (int, pid_t);
/*
* sh.dir.c
/*
* sh.sem.c
*/
-extern void execute (struct command *, int, int *,
+extern void execute (struct command *, volatile int, int *,
int *, int);
extern void mypipe (int *);
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.79 2006/09/25 18:17:26 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.dir.c,v 3.80 2007/05/08 21:05:34 christos Exp $ */
/*
* sh.dir.c: Directory manipulation functions
*/
#include "sh.h"
#include "ed.h"
-RCSID("$tcsh: sh.dir.c,v 3.79 2006/09/25 18:17:26 christos Exp $")
+RCSID("$tcsh: sh.dir.c,v 3.80 2007/05/08 21:05:34 christos Exp $")
/*
* C Shell - directory management
static Char *agetcwd (void);
static void dstart (const char *);
static struct directory *dfind (Char *);
-static Char *dfollow (Char *);
+static Char *dfollow (Char *, int);
static void printdirs (int);
static Char *dgoto (Char *);
static void dnewcwd (struct directory *, int);
return;
}
else
- if ((cp = dfollow(cp)) == NULL)
+ if ((cp = dfollow(cp, dflag & DIR_OLD)) == NULL)
return;
dp = xcalloc(sizeof(struct directory), 1);
dp->di_name = cp;
* dfollow - change to arg directory; fall back on cdpath if not valid
*/
static Char *
-dfollow(Char *cp)
+dfollow(Char *cp, int old)
{
Char *dp;
struct varent *c;
int serrno;
- cp = globone(cp, G_ERROR);
+ cp = old ? Strsave(cp) : globone(cp, G_ERROR);
cleanup_push(cp, xfree);
#ifdef apollo
if (Strchr(cp, '`')) {
stderror(ERR_NAME | ERR_NOHOMEDIR);
if (chdir(short2str(cp)) < 0)
stderror(ERR_NAME | ERR_CANTCHANGE);
- if ((cp = dfollow(cp)) == NULL)
+ if ((cp = dfollow(cp, dflag & DIR_OLD)) == NULL)
return;
dp = xcalloc(sizeof(struct directory), 1);
dp->di_name = cp;
else {
Char *ccp;
- if ((ccp = dfollow(cp)) == NULL)
+ if ((ccp = dfollow(cp, dflag & DIR_OLD)) == NULL)
return;
dp = xcalloc(sizeof(struct directory), 1);
dp->di_name = ccp;
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.dol.c,v 3.70 2006/09/14 18:30:16 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.dol.c,v 3.77 2009/06/19 16:25:00 christos Exp $ */
/*
* sh.dol.c: Variable substitutions
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.dol.c,v 3.70 2006/09/14 18:30:16 christos Exp $")
+RCSID("$tcsh: sh.dol.c,v 3.77 2009/06/19 16:25:00 christos Exp $")
/*
* C shell
static Char **
Dfix2(Char *const *v)
{
- struct blk_buf bb = BLK_BUF_INIT;
+ struct blk_buf *bb = bb_alloc();
+ Char **vec;
Dvp = v;
Dcp = STRNULL; /* Setup input vector for Dreadc */
unDredc(0); /* Clear out any old peeks (at error) */
dolp = 0;
dolcnt = 0; /* Clear out residual $ expands (...) */
- cleanup_push(&bb, bb_cleanup);
- while (Dword(&bb))
+ cleanup_push(bb, bb_free);
+ while (Dword(bb))
continue;
- cleanup_ignore(&bb);
- cleanup_until(&bb);
- return bb_finish(&bb);
+ cleanup_ignore(bb);
+ cleanup_until(bb);
+ vec = bb_finish(bb);
+ xfree(bb);
+ return vec;
}
/*
Dword(struct blk_buf *bb)
{
eChar c, c1;
- struct Strbuf wbuf = Strbuf_INIT;
+ struct Strbuf *wbuf = Strbuf_alloc();
int dolflg;
int sofar = 0;
+ Char *str;
- cleanup_push(&wbuf, Strbuf_cleanup);
+ cleanup_push(wbuf, Strbuf_free);
for (;;) {
c = DgetC(DODOL);
switch (c) {
case DEOF:
if (sofar == 0) {
- cleanup_until(&wbuf);
+ cleanup_until(wbuf);
return (0);
}
/* finish this word and catch the code above the next time */
case '`':
/* We preserve ` quotations which are done yet later */
- Strbuf_append1(&wbuf, (Char) c);
+ Strbuf_append1(wbuf, (Char) c);
/*FALLTHROUGH*/
case '\'':
case '"':
c = DgetC(dolflg);
if (c == c1)
break;
- if (c == '\n' || c == DEOF)
+ if (c == '\n' || c == DEOF) {
+ cleanup_until(bb);
stderror(ERR_UNMATCHED, (int)c1);
+ }
if ((c & (QUOTE | TRIM)) == ('\n' | QUOTE)) {
- if (wbuf.len != 0 && (wbuf.s[wbuf.len - 1] & TRIM) == '\\')
- wbuf.len--;
+ if (wbuf->len != 0 && (wbuf->s[wbuf->len - 1] & TRIM) == '\\')
+ wbuf->len--;
}
switch (c1) {
* Leave any `s alone for later. Other chars are all
* quoted, thus `...` can tell it was within "...".
*/
- Strbuf_append1(&wbuf, c == '`' ? '`' : c | QUOTE);
+ Strbuf_append1(wbuf, c == '`' ? '`' : c | QUOTE);
break;
case '\'':
/* Prevent all further interpretation */
- Strbuf_append1(&wbuf, c | QUOTE);
+ Strbuf_append1(wbuf, c | QUOTE);
break;
case '`':
/* Leave all text alone for later */
- Strbuf_append1(&wbuf, (Char) c);
+ Strbuf_append1(wbuf, (Char) c);
break;
default:
}
}
if (c1 == '`')
- Strbuf_append1(&wbuf, '`');
+ Strbuf_append1(wbuf, '`');
sofar = 1;
- if (Dpack(&wbuf) != 0)
+ if (Dpack(wbuf) != 0)
goto end;
continue;
}
unDgetC(c);
sofar = 1;
- if (Dpack(&wbuf) != 0)
+ if (Dpack(wbuf) != 0)
goto end;
}
end:
- cleanup_ignore(&wbuf);
- cleanup_until(&wbuf);
- bb_append(bb, Strbuf_finish(&wbuf));
+ cleanup_ignore(wbuf);
+ cleanup_until(wbuf);
+ str = Strbuf_finish(wbuf);
+ bb_append(bb, str);
+ xfree(wbuf);
return 1;
}
{
Char *np;
struct varent *vp = NULL;
- struct Strbuf name = Strbuf_INIT;
+ struct Strbuf *name = Strbuf_alloc();
eChar c, sc;
int subscr = 0, lwb = 1, upb = 0;
int dimen = 0, bitset = 0, length = 0;
static Char *dolbang = NULL;
- cleanup_push(&name, Strbuf_cleanup);
+ cleanup_push(name, Strbuf_free);
dolmod.len = dolmcnt = dol_flag_a = 0;
c = sc = DgetC(0);
if (c == DEOF) {
xfree(dolbang);
setDolp(dolbang = putn(backpid));
}
- cleanup_until(&name);
+ cleanup_until(name);
goto eatbrac;
case '$':
if (dimen || bitset || length)
stderror(ERR_SYNTAX);
setDolp(doldol);
- cleanup_until(&name);
+ cleanup_until(name);
goto eatbrac;
case '<'|QUOTE: {
fixDolMod();
setDolp(wbuf.s); /* Kept allocated until next $< expansion */
- cleanup_until(&name);
+ cleanup_until(name);
goto eatbrac;
}
case '*':
- Strbuf_append(&name, STRargv);
- Strbuf_terminate(&name);
+ Strbuf_append(name, STRargv);
+ Strbuf_terminate(name);
vp = adrof(STRargv);
subscr = -1; /* Prevent eating [...] */
break;
np = dimen ? STRargv : (bitset ? STRstatus : NULL);
if (np) {
bitset = 0;
- Strbuf_append(&name, np);
- Strbuf_terminate(&name);
+ Strbuf_append(name, np);
+ Strbuf_terminate(name);
vp = adrof(np);
subscr = -1; /* Prevent eating [...] */
unDredc(c);
if (subscr == 0) {
if (bitset) {
dolp = dolzero ? STR1 : STR0;
- cleanup_until(&name);
+ cleanup_until(name);
goto eatbrac;
}
if (ffile == 0)
fixDolMod();
setDolp(ffile);
}
- cleanup_until(&name);
+ cleanup_until(name);
goto eatbrac;
}
#if 0
vp = adrof(STRargv);
if (vp == 0) {
vp = &nulargv;
- cleanup_until(&name);
+ cleanup_until(name);
goto eatmod;
}
break;
np = dimen ? STRargv : (bitset ? STRstatus : NULL);
if (np) {
bitset = 0;
- Strbuf_append(&name, np);
- Strbuf_terminate(&name);
+ Strbuf_append(name, np);
+ Strbuf_terminate(name);
vp = adrof(np);
subscr = -1; /* Prevent eating [...] */
unDredc(c);
stderror(ERR_VARALNUM);
}
for (;;) {
- Strbuf_append1(&name, (Char) c);
+ Strbuf_append1(name, (Char) c);
c = DgetC(0);
if (c == DEOF || !alnum(c))
break;
}
- Strbuf_terminate(&name);
+ Strbuf_terminate(name);
unDredc(c);
- vp = adrof(name.s);
+ vp = adrof(name->s);
}
if (bitset) {
- dolp = (vp || getenv(short2str(name.s))) ? STR1 : STR0;
- cleanup_until(&name);
+ dolp = (vp || getenv(short2str(name->s))) ? STR1 : STR0;
+ cleanup_until(name);
goto eatbrac;
}
if (vp == NULL || vp->vec == NULL) {
- np = str2short(getenv(short2str(name.s)));
+ np = str2short(getenv(short2str(name->s)));
if (np) {
static Char *env_val; /* = NULL; */
- cleanup_until(&name);
+ cleanup_until(name);
fixDolMod();
- xfree(env_val);
- env_val = Strsave(np);
- setDolp(env_val);
+ if (length) {
+ addla(putn(Strlen(np)));
+ } else {
+ xfree(env_val);
+ env_val = Strsave(np);
+ setDolp(env_val);
+ }
goto eatbrac;
}
- udvar(name.s);
+ udvar(name->s);
/* NOTREACHED */
}
- cleanup_until(&name);
+ cleanup_until(name);
c = DgetC(0);
upb = blklen(vp->vec);
if (dimen == 0 && subscr == 0 && c == '[') {
- name = Strbuf_init;
- cleanup_push(&name, Strbuf_cleanup);
- np = name.s;
+ name = Strbuf_alloc();
+ cleanup_push(name, Strbuf_free);
+ np = name->s;
for (;;) {
c = DgetC(DODOL); /* Allow $ expand within [ ] */
if (c == ']')
break;
if (c == '\n' || c == DEOF)
stderror(ERR_INCBR);
- Strbuf_append1(&name, (Char) c);
+ Strbuf_append1(name, (Char) c);
}
- Strbuf_terminate(&name);
- np = name.s;
+ Strbuf_terminate(name);
+ np = name->s;
if (dolp || dolcnt) /* $ exp must end before ] */
stderror(ERR_EXPORD);
if (!*np)
for (i = 0; Isdigit(*np); i = i * 10 + *np++ - '0')
continue;
- if ((i < 0 || i > upb) && !any("-*", *np)) {
- cleanup_until(&name);
+ if (i < 0 || i > upb && !any("-*", *np)) {
+ cleanup_until(name);
dolerror(vp->v_name);
return;
}
while (Isdigit(*np))
i = i * 10 + *np++ - '0';
if (i < 0 || i > upb) {
- cleanup_until(&name);
+ cleanup_until(name);
dolerror(vp->v_name);
return;
}
}
if (lwb == 0) {
if (upb != 0) {
- cleanup_until(&name);
+ cleanup_until(name);
dolerror(vp->v_name);
return;
}
}
if (*np)
stderror(ERR_SYNTAX);
- cleanup_until(&name);
+ cleanup_until(name);
}
else {
if (subscr > 0) {
dolmod.s[i] = 0;
strip(lhsub);
+ strip(rhsub);
strip(cp);
dp = cp;
do {
dp = Strstr(dp, lhsub);
if (dp) {
ptrdiff_t diff = dp - cp;
- np = xmalloc((Strlen(cp) + 1 - lhlen + rhlen) *
- sizeof(Char));
+ size_t len = (Strlen(cp) + 1 - lhlen + rhlen);
+ np = xmalloc(len * sizeof(Char));
(void) Strncpy(np, cp, diff);
(void) Strcpy(np + diff, rhsub);
(void) Strcpy(np + diff + rhlen, dp + lhlen);
dp = np + diff + 1;
xfree(cp);
cp = np;
+ cp[--len] = '\0';
didmod = 1;
+ if (diff >= len)
+ break;
} else {
/* should this do a seterror? */
break;
#ifdef WINNT_NATIVE
__dup_stdin = 1;
#endif /* WINNT_NATIVE */
-#ifdef O_TEXT
- setmode(1, O_TEXT);
-#endif
-#ifdef O_BINARY
- setmode(0, O_BINARY);
-#endif
cleanup_push(&lbuf, Strbuf_cleanup);
cleanup_push(&mbuf, Strbuf_cleanup);
for (;;) {
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.err.c,v 3.48 2006/03/02 18:46:44 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.err.c,v 3.50 2007/09/28 20:25:15 christos Exp $ */
/*
* sh.err.c: Error printing routines.
*/
#include "sh.h"
#include <assert.h>
-RCSID("$tcsh: sh.err.c,v 3.48 2006/03/02 18:46:44 christos Exp $")
+RCSID("$tcsh: sh.err.c,v 3.50 2007/09/28 20:25:15 christos Exp $")
/*
* C Shell
for (i = 0; i < NO_ERRORS; i++)
xfree((char *)(intptr_t)elst[i]);
-# if defined(__FreeBSD__) || defined(hpux)
+# if defined(__FreeBSD__) || defined(hpux) || defined(__MidnightBSD__)
# define NLS_MAXSET 30
for (i = 1; i <= NLS_MAXSET; i++)
CGETS(i, 1, "" );
if (id >= sizeof(elst) / sizeof(elst[0]))
id = ERR_INVALID;
- /*
- * Must flush before we print as we wish output before the error to go
- * on (some form of) standard output, while output after goes on (some
- * form of) diagnostic output. If didfds then output will go to 1/2
- * else to FSHOUT/FSHDIAG. See flush in sh.print.c.
- */
- flush();/*FIXRESET*/
- haderr = 1; /* Now to diagnostic output */
if (!(flags & ERR_SILENT)) {
+ /*
+ * Must flush before we print as we wish output before the error
+ * to go * on (some form of) standard output, while output after
+ * goes on (some * form of) diagnostic output. If didfds then
+ * output will go to 1/2 * else to FSHOUT/FSHDIAG. See flush in
+ * sh.print.c.
+ */
+ flush();/*FIXRESET*/
+ haderr = 1; /* Now to diagnostic output */
if (flags & ERR_NAME)
xprintf("%s: ", bname);/*FIXRESET*/
if ((flags & ERR_OLD)) {
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.73 2006/08/24 20:56:31 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.75 2009/06/25 21:15:37 christos Exp $ */
/*
* sh.exec.c: Search, find, and execute a command!
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.exec.c,v 3.73 2006/08/24 20:56:31 christos Exp $")
+RCSID("$tcsh: sh.exec.c,v 3.75 2009/06/25 21:15:37 christos Exp $")
#include "tc.h"
#include "tw.h"
*/
if ((fd = xopen(f, O_RDONLY|O_LARGEFILE)) != -1) {
int nread;
-#ifdef O_TEXT
- setmode(fd, O_TEXT);
-#endif
if ((nread = xread(fd, pref, 2)) == 2) {
if (!isprint((unsigned char)pref[0]) &&
(pref[0] != '\n' && pref[0] != '\t')) {
int hashval, i, ex, rval = 0;
if (prt && any(short2str(cmd), '/')) {
- xprintf(CGETS(13, 7, "where: / in command makes no sense\n"));
+ xprintf("%s", CGETS(13, 7, "where: / in command makes no sense\n"));
return rval;
}
ex = executable(*pv, sv, 0);
#ifdef FASTHASH
if (!ex && (hashdebug & 2)) {
- xprintf(CGETS(13, 10, "hash miss: "));
+ xprintf("%s", CGETS(13, 10, "hash miss: "));
ex = 1; /* Force printing */
}
#endif /* FASTHASH */
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.exp.c,v 3.51 2006/05/13 21:25:20 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.exp.c,v 3.53 2007/10/01 19:09:28 christos Exp $ */
/*
* sh.exp.c: Expression evaluations
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.exp.c,v 3.51 2006/05/13 21:25:20 christos Exp $")
+RCSID("$tcsh: sh.exp.c,v 3.53 2007/10/01 19:09:28 christos Exp $")
#include "tw.h"
static int isa (Char *, int);
static int egetn (Char *);
-
#ifdef EDEBUG
-static void etracc (char *, Char *, Char ***);
-static void etraci (char *, int, Char ***);
+static void etracc (const char *, const Char *, Char ***);
+static void etraci (const char *, int, Char ***);
#else /* !EDEBUG */
#define etracc(A, B, C) ((void)0)
#define etraci(A, B, C) ((void)0)
#endif /* !EDEBUG */
-
/*
* shell access function according to POSIX and non POSIX
* From Beto Appleton (beto@aixwiz.aix.ibm.com)
int p1 = exp1(vp, ignore);
etraci("exp0 p1", p1, vp);
- if (**vp && eq(**vp, STRor2)) {
+ while (**vp && eq(**vp, STRor2)) {
int p2;
(*vp)++;
- p2 = exp0(vp, (ignore & TEXP_IGNORE) || p1);
- etraci("exp0 p2", p2, vp);
- return (p1 || p2);
+
+ p2 = compat_expr ?
+ exp0(vp, (ignore & TEXP_IGNORE) || p1) :
+ exp1(vp, (ignore & TEXP_IGNORE) || p1);
+ if (compat_expr || !(ignore & TEXP_IGNORE))
+ p1 = (p1 || p2);
+ etraci("exp0 p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
int p1 = exp2x(vp, ignore);
etraci("exp1 p1", p1, vp);
- if (**vp && eq(**vp, STRand2)) {
+ while (**vp && eq(**vp, STRand2)) {
int p2;
(*vp)++;
- p2 = exp1(vp, (ignore & TEXP_IGNORE) || !p1);
+ p2 = compat_expr ?
+ exp1(vp, (ignore & TEXP_IGNORE) || !p1) :
+ exp2x(vp, (ignore & TEXP_IGNORE) || !p1);
+
etraci("exp1 p2", p2, vp);
- return (p1 && p2);
+ if (compat_expr || !(ignore & TEXP_IGNORE))
+ p1 = (p1 && p2);
+ etraci("exp1 p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
{
int p1 = exp2a(vp, ignore);
- etraci("exp3 p1", p1, vp);
- if (**vp && eq(**vp, STRor)) {
+ etraci("exp2x p1", p1, vp);
+ while (**vp && eq(**vp, STRor)) {
int p2;
(*vp)++;
- p2 = exp2x(vp, ignore);
- etraci("exp3 p2", p2, vp);
- return (p1 | p2);
+ p2 = compat_expr ?
+ exp2x(vp, ignore) :
+ exp2a(vp, ignore);
+ etraci("exp2x p2", p2, vp);
+ if (compat_expr || !(ignore & TEXP_IGNORE))
+ p1 = (p1 | p2);
+ etraci("exp2x p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
int p1 = exp2b(vp, ignore);
etraci("exp2a p1", p1, vp);
- if (**vp && eq(**vp, STRcaret)) {
+ while (**vp && eq(**vp, STRcaret)) {
int p2;
(*vp)++;
- p2 = exp2a(vp, ignore);
+ p2 = compat_expr ?
+ exp2a(vp, ignore) :
+ exp2b(vp, ignore);
etraci("exp2a p2", p2, vp);
- return (p1 ^ p2);
+ if (compat_expr || !(ignore & TEXP_IGNORE))
+ p1 = (p1 ^ p2);
+ etraci("exp2a p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
int p1 = exp2c(vp, ignore);
etraci("exp2b p1", p1, vp);
- if (**vp && eq(**vp, STRand)) {
+ while (**vp && eq(**vp, STRand)) {
int p2;
(*vp)++;
- p2 = exp2b(vp, ignore);
+ p2 = compat_expr ?
+ exp2b(vp, ignore) :
+ exp2c(vp, ignore);
etraci("exp2b p2", p2, vp);
- return (p1 & p2);
+ if (compat_expr || !(ignore & TEXP_IGNORE))
+ p1 = (p1 & p2);
+ etraci("exp2b p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
p1 = exp3a(vp, ignore);
etracc("exp3 p1", p1, vp);
- if ((i = isa(**vp, RELOP)) != 0) {
+ while ((i = isa(**vp, RELOP)) != 0) {
(*vp)++;
if (**vp && eq(**vp, STRequal))
i |= 1, (*vp)++;
cleanup_push(p1, xfree);
- p2 = exp3(vp, ignore);
+ p2 = compat_expr ?
+ exp3(vp, ignore) :
+ exp3a(vp, ignore);
cleanup_push(p2, xfree);
etracc("exp3 p2", p2, vp);
if (!(ignore & TEXP_IGNORE))
break;
}
cleanup_until(p1);
- return (putn(i));
+ p1 = putn(i);
+ etracc("exp3 p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
if (op && any("<>", op[0]) && op[0] == op[1]) {
(*vp)++;
cleanup_push(p1, xfree);
- p2 = exp3a(vp, ignore);
+ p2 = compat_expr ?
+ exp3a(vp, ignore) :
+ exp4(vp, ignore);
cleanup_push(p2, xfree);
etracc("exp3a p2", p2, vp);
if (op[0] == '<')
else
i = egetn(p1) >> egetn(p2);
cleanup_until(p1);
- return (putn(i));
+ p1 = putn(i);
+ etracc("exp3a p1", p1, vp);
}
return (p1);
}
p1 = exp5(vp, ignore);
etracc("exp4 p1", p1, vp);
- if (isa(**vp, ADDOP)) {
+ while (isa(**vp, ADDOP)) {
const Char *op = *(*vp)++;
cleanup_push(p1, xfree);
- p2 = exp4(vp, ignore);
+ p2 = compat_expr ?
+ exp4(vp, ignore) :
+ exp5(vp, ignore);
cleanup_push(p2, xfree);
etracc("exp4 p2", p2, vp);
if (!(ignore & TEXP_IGNORE))
break;
}
cleanup_until(p1);
- return (putn(i));
+ p1 = putn(i);
+ etracc("exp4 p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
p1 = exp6(vp, ignore);
etracc("exp5 p1", p1, vp);
- if (isa(**vp, MULOP)) {
+ while (isa(**vp, MULOP)) {
const Char *op = *(*vp)++;
if ((ignore & TEXP_NOGLOB) != 0) {
/*
}
cleanup_push(p1, xfree);
- p2 = exp5(vp, ignore);
+ p2 = compat_expr ?
+ exp5(vp, ignore) :
+ exp6(vp, ignore);
cleanup_push(p2, xfree);
etracc("exp5 p2", p2, vp);
if (!(ignore & TEXP_IGNORE))
break;
}
cleanup_until(p1);
- return (putn(i));
+ p1 = putn(i);
+ etracc("exp5 p1", p1, vp);
+ if (compat_expr)
+ break;
}
return (p1);
}
#ifdef EDEBUG
static void
-etraci(char *str, int i, Char ***vp)
+etraci(const char *str, int i, Char ***vp)
{
xprintf("%s=%d\t", str, i);
blkpr(*vp);
xputchar('\n');
}
static void
-etracc(char *str, Char *cp, Char ***vp)
+etracc(const char *str, const Char *cp, Char ***vp)
{
- xprintf("%s=%s\t", str, cp);
+ xprintf("%s=%S\t", str, cp);
blkpr(*vp);
xputchar('\n');
}
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.file.c,v 3.35 2006/08/23 15:03:14 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.file.c,v 3.36 2007/07/05 14:13:06 christos Exp $ */
/*
* sh.file.c: File completion for csh. This file is not used in tcsh.
*/
#include "sh.h"
#include "ed.h"
-RCSID("$tcsh: sh.file.c,v 3.35 2006/08/23 15:03:14 christos Exp $")
+RCSID("$tcsh: sh.file.c,v 3.36 2007/07/05 14:13:06 christos Exp $")
#if defined(FILEC) && defined(TIOCSTI)
(void) ioctl(SHOUT, TCSETAW, (ioctl_t) &tty);
# endif /* POSIX */
tty_normal = tty;
- tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
+ tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL |
+#ifndef __QNXNTO__
+ ECHOPRT |
+#endif
+ ECHOCTL);
# ifdef POSIX
(void) xtcsetattr(SHOUT, TCSANOW, &tty);
# else
(void) ioctl(SHOUT, TCGETA, (ioctl_t) &tty);
# endif /* POSIX */
+#ifndef __QNXNTO__
tty.c_lflag |= PENDIN;
+#endif
# ifdef POSIX
(void) xtcsetattr(SHOUT, TCSANOW, &tty);
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.func.c,v 3.143 2006/08/24 20:56:31 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.func.c,v 3.153 2009/06/25 21:15:37 christos Exp $ */
/*
* sh.func.c: csh builtin functions
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.func.c,v 3.143 2006/08/24 20:56:31 christos Exp $")
+RCSID("$tcsh: sh.func.c,v 3.153 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "tw.h"
static const char *isrchx (int);
static void search (int, int, Char *);
static int getword (struct Strbuf *);
+static struct wordent *histgetword (struct wordent *);
static void toend (void);
static void xecho (int, Char **);
static int islocale_var (Char *);
reexecute(kp);
--i;
}
- cleanup_until(&pintr_disabled);
+ if (setintr && pintr_disabled == 1)
+ cleanup_until(&pintr_disabled);
donefds();
}
Char *cp;
struct whyle *wp;
int wlevel = 0;
+ struct wordent *histent = NULL, *ohistent = NULL;
Stype = type;
Sgoal = goal;
}
cleanup_push(&word, Strbuf_cleanup);
do {
+
+ if (intty) {
+ histent = xmalloc(sizeof(*histent));
+ ohistent = xmalloc(sizeof(*histent));
+ ohistent->word = STRNULL;
+ ohistent->next = histent;
+ histent->prev = ohistent;
+ }
+
if (intty && fseekp == feobp && aret == TCSH_F_SEEK)
printprompt(1, isrchx(type == TC_BREAK ? zlast : type));
/* xprintf("? "), flush(); */
(void) getword(&word);
Strbuf_terminate(&word);
+
+ if (intty && Strlen(word.s) > 0) {
+ histent->word = Strsave(word.s);
+ histent->next = xmalloc(sizeof(*histent));
+ histent->next->prev = histent;
+ histent = histent->next;
+ }
+
switch (srchx(word.s)) {
case TC_ELSE:
level = -1;
break;
}
- (void) getword(NULL);
+ if (intty) {
+ ohistent->prev = histgetword(histent);
+ ohistent->prev->next = ohistent;
+ savehist(ohistent, 0);
+ freelex(ohistent);
+ xfree(ohistent);
+ } else
+ (void) getword(NULL);
} while (level >= 0);
end:
cleanup_until(&word);
}
+static struct wordent *
+histgetword(struct wordent *histent)
+{
+ int found = 0, first;
+ eChar c, d;
+ int e;
+ struct Strbuf *tmp;
+ tmp = xmalloc(sizeof(*tmp));
+ tmp->size = 0;
+ tmp->s = NULL;
+ c = readc(1);
+ d = 0;
+ e = 0;
+ for (;;) {
+ tmp->len = 0;
+ Strbuf_terminate (tmp);
+ while (c == ' ' || c == '\t')
+ c = readc(1);
+ if (c == '#')
+ do
+ c = readc(1);
+ while (c != CHAR_ERR && c != '\n');
+ if (c == CHAR_ERR)
+ goto past;
+ if (c == '\n')
+ goto nl;
+ unreadc(c);
+ found = 1;
+ first = 1;
+ do {
+ e = (c == '\\');
+ c = readc(1);
+ if (c == '\\' && !e) {
+ if ((c = readc(1)) == '\n') {
+ e = 1;
+ c = ' ';
+ } else {
+ unreadc(c);
+ c = '\\';
+ }
+ }
+ if ((c == '\'' || c == '"') && !e) {
+ if (d == 0)
+ d = c;
+ else if (d == c)
+ d = 0;
+ }
+ if (c == CHAR_ERR)
+ goto past;
+
+ Strbuf_append1(tmp, (Char) c);
+
+ if (!first && !d && c == '(' && !e) {
+ break;
+ }
+ first = 0;
+ } while (d || e || (c != ' ' && c != '\t' && c != '\n'));
+ tmp->len--;
+ if (tmp->len) {
+ Strbuf_terminate(tmp);
+ histent->word = Strsave(tmp->s);
+ histent->next = xmalloc(sizeof (*histent));
+ histent->next->prev = histent;
+ histent = histent->next;
+ }
+ if (c == '\n') {
+ nl:
+ tmp->len = 0;
+ Strbuf_append1(tmp, (Char) c);
+ Strbuf_terminate(tmp);
+ histent->word = Strsave(tmp->s);
+ return histent;
+ }
+ }
+
+ unreadc(c);
+ return histent;
+
+past:
+ switch (Stype) {
+
+ case TC_IF:
+ stderror(ERR_NAME | ERR_NOTFOUND, "then/endif");
+ break;
+
+ case TC_ELSE:
+ stderror(ERR_NAME | ERR_NOTFOUND, "endif");
+ break;
+
+ case TC_BRKSW:
+ case TC_SWITCH:
+ stderror(ERR_NAME | ERR_NOTFOUND, "endsw");
+ break;
+
+ case TC_BREAK:
+ stderror(ERR_NAME | ERR_NOTFOUND, "end");
+ break;
+
+ case TC_GOTO:
+ setname(short2str(Sgoal));
+ stderror(ERR_NAME | ERR_NOTFOUND, "label");
+ break;
+
+ default:
+ break;
+ }
+ /* NOTREACHED */
+ return NULL;
+}
+
static int
getword(struct Strbuf *wp)
{
{ RLIMIT_SBSIZE, "sbsize", 1, "" },
# endif /* RLIMIT_SBSIZE */
+# ifdef RLIMIT_SWAP
+ { RLIMIT_SWAP, "swapsize", 1024, "kbytes" },
+# endif /* RLIMIT_SWAP */
+
{ -1, NULL, 0, NULL }
};
dosuspend(Char **v, struct command *c)
{
#ifdef BSDJOBS
- int ctpgrp;
struct sigaction old;
#endif /* BSDJOBS */
-
+
USE(c);
USE(v);
#ifdef BSDJOBS
if (tpgrp != -1) {
-retry:
- ctpgrp = tcgetpgrp(FSHTTY);
- if (ctpgrp == -1)
+ if (grabpgrp(FSHTTY, opgrp) == -1)
stderror(ERR_SYSTEM, "tcgetpgrp", strerror(errno));
- if (ctpgrp != opgrp) {
- sigaction(SIGTTIN, NULL, &old);
- signal(SIGTTIN, SIG_DFL);
- (void) kill(0, SIGTTIN);
- sigaction(SIGTTIN, &old, NULL);
- goto retry;
- }
(void) setpgid(0, shpgrp);
(void) tcsetpgrp(FSHTTY, shpgrp);
}
close_on_exec(SHDIAG = dmove(state->saveDIAG, state->SHDIAG), 1);
}
+static Char **Ggv;
/*ARGSUSED*/
void
doeval(Char **v, struct command *c)
{
struct doeval_state state;
- int gflag;
+ int gflag, my_reenter;
Char **gv;
+ jmp_buf_t osetexit;
USE(c);
v++;
trim(v);
}
+ Ggv = gv;
state.evalvec = evalvec;
state.evalp = evalp;
state.didfds = didfds;
cleanup_push(&state, doeval_cleanup);
- evalvec = v;
- evalp = 0;
- (void)close_on_exec(SHIN = dcopy(0, -1), 1);
- (void)close_on_exec(SHOUT = dcopy(1, -1), 1);
- (void)close_on_exec(SHDIAG = dcopy(2, -1), 1);
+ getexit(osetexit);
+
+ /* PWP: setjmp/longjmp bugfix for optimizing compilers */
+#ifdef cray
+ my_reenter = 1; /* assume non-zero return val */
+ if (setexit() == 0) {
+ my_reenter = 0; /* Oh well, we were wrong */
+#else /* !cray */
+ if ((my_reenter = setexit()) == 0) {
+#endif /* cray */
+ evalvec = v;
+ evalp = 0;
+ (void)close_on_exec(SHIN = dcopy(0, -1), 1);
+ (void)close_on_exec(SHOUT = dcopy(1, -1), 1);
+ (void)close_on_exec(SHDIAG = dcopy(2, -1), 1);
#ifndef CLOSE_ON_EXEC
- didcch = 0;
+ didcch = 0;
#endif /* CLOSE_ON_EXEC */
- didfds = 0;
- process(0);
+ didfds = 0;
+ gv = Ggv;
+ process(0);
+ Ggv = gv;
+ }
- cleanup_until(&state);
+ if (my_reenter == 0) {
+ cleanup_until(&state);
+ if (Ggv)
+ cleanup_until(Ggv);
+ }
- if (gv)
- cleanup_until(gv);
+ resexit(osetexit);
+ if (my_reenter)
+ stderror(ERR_SILENT);
}
/*************************************************************************/
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.74 2006/10/14 17:57:21 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.76 2008/06/19 15:20:56 christos Exp $ */
/*
* sh.glob.c: Regular expression expansion
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.glob.c,v 3.74 2006/10/14 17:57:21 christos Exp $")
+RCSID("$tcsh: sh.glob.c,v 3.76 2008/06/19 15:20:56 christos Exp $")
#include "tc.h"
#include "tw.h"
}
if (!*rp) {
oops:
+ cleanup_until(&bb);
stderror(ERR_UNMATCHED, '`');
}
ep = Strnsave(lp, rp - lp);
c = (*ip++ & TRIM);
if (c == 0)
break;
-#ifdef WINNT_NATIVE
+#if defined(WINNT_NATIVE) || defined(__CYGWIN__)
if (c == '\r')
c = ' ';
-#endif /* WINNT_NATIVE */
+#endif /* WINNT_NATIVE || __CYGWIN__ */
if (c == '\n') {
/*
* Continue around the loop one more time, so that we can eat
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.h,v 3.146 2006/07/03 22:59:01 mitr Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.h,v 3.150 2009/06/25 21:27:37 christos Exp $ */
/*
* sh.h: Catch it all globals and includes file!
*/
typedef wint_t eChar; /* Can contain any Char value or CHAR_ERR */
#define CHAR_ERR WEOF /* Pretty please, use bit 31... */
#define normal_mbtowc(PWC, S, N) rt_mbtowc(PWC, S, N)
-#define reset_mbtowc() mbtowc(NULL, NULL, 0)
+#define reset_mbtowc() IGNORE(mbtowc(NULL, NULL, 0))
# else
typedef short Char;
typedef unsigned short uChar;
/* Elide unused argument warnings */
#define USE(a) (void) (a)
+#define IGNORE(a) ignore((intptr_t)a)
+static inline void ignore(intptr_t a)
+{
+ USE(a);
+}
/*
* Return true if the path is absolute
EXTERN int editing IZERO; /* doing filename expansion and line editing */
EXTERN int noediting IZERO; /* initial $term defaulted to noedit */
EXTERN int bslash_quote IZERO;/* PWP: tcsh-style quoting? (in sh.c) */
+EXTERN int compat_expr IZERO;/* csh-style expressions? */
EXTERN int isoutatty IZERO; /* is SHOUT a tty */
EXTERN int isdiagatty IZERO;/* is SHDIAG a tty */
EXTERN int is1atty IZERO; /* is file descriptor 1 a tty (didfds mode) */
/* 31st char bit used for 'ing (not 32nd, we want all values nonnegative) */
# define QUOTE 0x40000000
# define TRIM 0x3FFFFFFF /* Mask to strip quote bit */
-# define UNDER 0x20000000 /* Underline flag */
-# define BOLD 0x10000000 /* Bold flag */
-# define STANDOUT 0x08000000 /* Standout flag */
-# define LITERAL 0x04000000 /* Literal character flag */
-# define ATTRIBUTES 0x3C000000 /* The bits used for attributes */
-# define INVALID_BYTE 0x00200000 /* Invalid character on input */
-# define CHAR 0x003FFFFF /* Mask to mask out the character */
+# define UNDER 0x08000000 /* Underline flag */
+# define BOLD 0x04000000 /* Bold flag */
+# define STANDOUT 0x02000000 /* Standout flag */
+# define LITERAL 0x01000000 /* Literal character flag */
+# define ATTRIBUTES 0x0F000000 /* The bits used for attributes */
+# define INVALID_BYTE 0x00800000 /* Invalid character on input */
+# ifdef SOLARIS2
+# define CHAR 0x30FFFFFF /* Mask to mask out the character */
+# else
+# define CHAR 0x00FFFFFF /* Mask to mask out the character */
+# endif
#elif defined (SHORT_STRINGS)
# define QUOTE ((Char) 0100000)/* 16nth char bit used for 'ing */
# define TRIM 0073777 /* Mask to strip quote/lit bit */
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.77 2006/09/27 17:01:06 mitr Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.81 2009/06/25 21:15:37 christos Exp $ */
/*
* sh.lex.c: Lexical analysis into tokens
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.lex.c,v 3.77 2006/09/27 17:01:06 mitr Exp $")
+RCSID("$tcsh: sh.lex.c,v 3.81 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
else {
if (bslash_quote &&
((c == '\'') || (c == '"') ||
- (c == '\\'))) {
+ (c == '\\') || (c == '$'))) {
c |= QUOTE;
}
else {
return (en);
}
slhs.len = 0;
- Strbuf_append(&slhs, lhsb.s);
+ if (lhsb.s != NULL && lhsb.len != 0)
+ Strbuf_append(&slhs, lhsb.s);
Strbuf_terminate(&slhs);
if (exclc)
en = dosub(sc, en, global);
if (adrof(STRignoreeof)) {
/* If so, tell the user to use exit or logout */
if (loginsh) {
- xprintf(CGETS(16, 2,
+ xprintf("%s", CGETS(16, 2,
"\nUse \"logout\" to logout.\n"));
} else {
xprintf(CGETS(16, 3,
return CHAR_ERR;
feobp += c;
}
-#ifndef WINNT_NATIVE
+#if !defined(WINNT_NATIVE) && !defined(__CYGWIN__)
ch = fbuf[0][fseekp - fbobp];
fseekp++;
#else
ch = fbuf[0][fseekp - fbobp];
fseekp++;
} while(ch == '\r');
-#endif /* !WINNT_NATIVE */
+#endif /* !WINNT_NATIVE && !__CYGWIN__ */
return (ch);
}
if (windowchg)
(void) check_window_size(0); /* for window systems */
#endif /* SIG_WINDOW */
-#ifndef WINNT_NATIVE
+#if !defined(WINNT_NATIVE) && !defined(__CYGWIN__)
ch = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
fseekp++;
#else
ch = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
fseekp++;
} while(ch == '\r');
-#endif /* !WINNT_NATIVE */
+#endif /* !WINNT_NATIVE && !__CYGWIN__ */
return (ch);
}
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.c,v 3.104 2006/09/27 16:59:04 mitr Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.c,v 3.109 2009/06/25 21:15:37 christos Exp $ */
/*
* sh.proc.c: Job manipulations
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.proc.c,v 3.104 2006/09/27 16:59:04 mitr Exp $")
+RCSID("$tcsh: sh.proc.c,v 3.109 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "tc.h"
static void pflush (struct process *);
static void pfree (struct process *);
static void pclrcurr (struct process *);
+static void morecommand (size_t);
static void padd (struct command *);
static int pprint (struct process *, int);
static void ptprint (struct process *);
do {
if ((fp->p_flags & (PFOREGND | PRUNNING)) == PRUNNING)
- xprintf(CGETS(17, 1, "BUG: waiting for background job!\n"));
+ xprintf("%s", CGETS(17, 1, "BUG: waiting for background job!\n"));
} while ((fp = fp->p_friends) != pp);
/*
* Now keep pausing as long as we are not interrupted (SIGINT), and the
(void) tcsetpgrp(FSHTTY, tpgrp);
#endif /* BSDJOBS */
if ((jobflags & (PSIGNALED | PSTOPPED | PTIME)) ||
- !eq(dcwd->di_name, fp->p_cwd->di_name)) {
+ fp->p_cwd == NULL || !eq(dcwd->di_name, fp->p_cwd->di_name)) {
if (jobflags & PSTOPPED) {
xputchar('\n');
if (adrof(STRlistjobs)) {
int idx;
if (pp->p_procid == 0) {
- xprintf(CGETS(17, 3, "BUG: process flushed twice"));
+ xprintf("%s", CGETS(17, 3, "BUG: process flushed twice"));
return;
}
while (pp->p_procid != pp->p_jobid)
}
/* +4 here is 1 for '\0', 1 ea for << >& >> */
-static Char command[PMAXLEN + 4];
+static Char *cmdstr;
+static size_t cmdmax;
static size_t cmdlen;
static Char *cmdp;
+#define CMD_INIT 1024
+#define CMD_INCR 64
+
+static void
+morecommand(size_t s)
+{
+ Char *ncmdstr;
+ ptrdiff_t d;
+
+ cmdmax += s;
+ ncmdstr = xrealloc(cmdstr, cmdmax * sizeof(*cmdstr));
+ d = ncmdstr - cmdstr;
+ cmdstr = ncmdstr;
+ cmdp += d;
+}
/* GrP
* unparse - Export padd() functionality
Char *
unparse(struct command *t)
{
- cmdp = command;
+ if (cmdmax == 0)
+ morecommand(CMD_INIT);
+ cmdp = cmdstr;
cmdlen = 0;
padd(t);
*cmdp++ = '\0';
- return Strsave(command);
+ return Strsave(cmdstr);
}
pp->p_flags |= PBACKQ;
if (t->t_dflg & F_HUP)
pp->p_flags |= PHUP;
- cmdp = command;
+ if (cmdmax == 0)
+ morecommand(CMD_INIT);
+ cmdp = cmdstr;
cmdlen = 0;
padd(t);
*cmdp++ = 0;
if (t->t_dflg & F_STDERR)
pp->p_flags |= PDIAG;
}
- pp->p_command = Strsave(command);
+ pp->p_command = Strsave(cmdstr);
if (pcurrjob) {
struct process *fp;
static void
pads(Char *cp)
{
- size_t i;
+ size_t i, len;
/*
* Avoid the Quoted Space alias hack! Reported by:
i = Strlen(cp);
- if (cmdlen >= PMAXLEN)
- return;
- if (cmdlen + i >= PMAXLEN) {
- (void) Strcpy(cmdp, STRsp3dots);
- cmdlen = PMAXLEN;
- cmdp += 4;
- return;
- }
+ len = cmdlen + i + CMD_INCR;
+ if (len >= cmdmax)
+ morecommand(len);
(void) Strcpy(cmdp, cp);
cmdp += i;
cmdlen += i;
xprintf("&");
}
if (flag & (REASON | AREASON) && pp->p_flags & PDUMPED)
- xprintf(CGETS(17, 9, " (core dumped)"));
+ xprintf("%s", CGETS(17, 9, " (core dumped)"));
if (tp == pp->p_friends) {
if (flag & AMPERSAND)
xprintf(" &");
if (flag & JOBDIR &&
!eq(tp->p_cwd->di_name, dcwd->di_name)) {
- xprintf(CGETS(17, 10, " (wd: "));
+ xprintf("%s", CGETS(17, 10, " (wd: "));
dtildepr(tp->p_cwd->di_name);
xprintf(")");
}
if (linp != linbuf)
xputchar('\n');
if (flag & SHELLDIR && !eq(tp->p_cwd->di_name, dcwd->di_name)) {
- xprintf(CGETS(17, 11, "(wd now: "));
+ xprintf("%s", CGETS(17, 11, "(wd now: "));
dtildepr(dcwd->di_name);
xprintf(")\n");
}
pid_t pid;
Char *cp, **vp, **globbed;
- pchild_disabled++;
- cleanup_push(&pchild_disabled, disabled_cleanup);
- if (setintr) {
- pintr_disabled++;
- cleanup_push(&pintr_disabled, disabled_cleanup);
- }
-
/* Avoid globbing %?x patterns */
for (vp = v; vp && *vp; vp++)
if (**vp == '%')
globbed = v;
cleanup_push(globbed, blk_cleanup);
+ pchild_disabled++;
+ cleanup_push(&pchild_disabled, disabled_cleanup);
+ if (setintr) {
+ pintr_disabled++;
+ cleanup_push(&pintr_disabled, disabled_cleanup);
+ }
while (v && (cp = *v)) {
if (*cp == '%') {
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.h,v 3.12 2006/01/12 19:55:38 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.proc.h,v 3.13 2009/06/19 16:35:33 christos Exp $ */
/*
* sh.proc.h: Process data structures and variables
*/
# endif /* POSIX */
# endif /* _SEQUENT_ */
#endif /* BSDTIMES */
- Char *p_command; /* first PMAXLEN chars of command */
+ Char *p_command; /* command */
};
/* flag values for p_flags */
#define PBACKQ (1<<16) /* Process is `` evaluation */
#define PHUP (1<<17) /* Process is marked for SIGHUP on exit */
-#define PMAXLEN 80
-
/* defines for arguments to pprint */
#define NUMBER 01
#define NAME 02
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.sem.c,v 3.78 2006/10/14 17:23:39 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.sem.c,v 3.80 2009/06/25 21:27:38 christos Exp $ */
/*
* sh.sem.c: I/O redirections and job forking. A touchy issue!
* Most stuff with builtins is incorrect
*/
#include "sh.h"
-RCSID("$tcsh: sh.sem.c,v 3.78 2006/10/14 17:23:39 christos Exp $")
+RCSID("$tcsh: sh.sem.c,v 3.80 2009/06/25 21:27:38 christos Exp $")
#include "tc.h"
#include "tw.h"
* Don't run if we're not in a tty
* Don't run if we're not really executing
*/
- if (t->t_dtyp == NODE_COMMAND && !bifunc && !noexec && intty) {
+ /*
+ * CR - Charles Ross Aug 2005
+ * added "isoutatty".
+ * The new behavior is that the jobcmd won't be executed
+ * if stdout (SHOUT) isnt attached to a tty.. IE when
+ * redirecting, or using backquotes etc..
+ */
+ if (t->t_dtyp == NODE_COMMAND && !bifunc && !noexec && intty && isoutatty) {
Char *cmd = unparse(t);
cleanup_push(cmd, xfree);
}
else if (flags & F_PIPEIN) {
xclose(0);
- (void) dup(pipein[0]);
+ IGNORE(dup(pipein[0]));
xclose(pipein[0]);
xclose(pipein[1]);
}
}
else {
xclose(0);
- (void) dup(OLDSTD);
+ IGNORE(dup(OLDSTD));
#if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
/*
* PWP: Unlike Bezerkeley 4.3, FIONCLEX for Pyramid is preserved
}
else if (flags & F_PIPEOUT) {
xclose(1);
- (void) dup(pipeout[1]);
+ IGNORE(dup(pipeout[1]));
is1atty = 0;
}
else {
xclose(1);
- (void) dup(SHOUT);
+ IGNORE(dup(SHOUT));
is1atty = isoutatty;
# if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
(void) close_on_exec(1, 0);
xclose(2);
if (flags & F_STDERR) {
- (void) dup(1);
+ IGNORE(dup(1));
is2atty = is1atty;
}
else {
- (void) dup(SHDIAG);
+ IGNORE(dup(SHDIAG));
is2atty = isdiagatty;
# if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
(void) close_on_exec(2, 0);
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.set.c,v 3.70 2006/08/24 20:56:31 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.set.c,v 3.72 2007/09/28 21:02:03 christos Exp $ */
/*
* sh.set.c: Setting and Clearing of variables
*/
*/
#include "sh.h"
-RCSID("$tcsh: sh.set.c,v 3.70 2006/08/24 20:56:31 christos Exp $")
+RCSID("$tcsh: sh.set.c,v 3.72 2007/09/28 21:02:03 christos Exp $")
#include "ed.h"
#include "tw.h"
else if (eq(vp, STRbackslash_quote)) {
bslash_quote = 1;
}
+ else if (eq(vp, STRcompat_expr)) {
+ compat_expr = 1;
+ }
else if (eq(vp, STRdirstack)) {
dsetstack();
}
{
int n;
int sign;
+ int base;
if (!cp) /* PWP: extra error checking */
stderror(ERR_NAME | ERR_BADNUM);
if (!Isdigit(*cp))
stderror(ERR_NAME | ERR_BADNUM);
}
+
+ if (cp[0] == '0' && cp[1])
+ base = 8;
+ else
+ base = 10;
+
n = 0;
while (Isdigit(*cp))
- n = n * 10 + *cp++ - '0';
+ {
+ if (base == 8 && *cp >= '8')
+ stderror(ERR_NAME | ERR_BADNUM);
+ n = n * base + *cp++ - '0';
+ }
if (*cp)
stderror(ERR_NAME | ERR_BADNUM);
return (sign ? -n : n);
editing = 0;
if (adrof(STRbackslash_quote) == 0)
bslash_quote = 0;
+ if (adrof(STRcompat_expr) == 0)
+ compat_expr = 0;
if (adrof(STRsymlinks) == 0)
symlinks = 0;
if (adrof(STRimplicitcd) == 0)
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.bind.c,v 3.44 2006/03/02 18:46:44 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.bind.c,v 3.45 2009/06/25 21:15:37 christos Exp $ */
/*
* tc.bind.c: Key binding functions
*/
*/
#include "sh.h"
-RCSID("$tcsh: tc.bind.c,v 3.44 2006/03/02 18:46:44 christos Exp $")
+RCSID("$tcsh: tc.bind.c,v 3.45 2009/06/25 21:15:37 christos Exp $")
#include "ed.h"
#include "ed.defns.h"
eChar es;
if (*str == 0) {
- xprintf(CGETS(20, 5, "Null string specification\n"));
+ xprintf("%s", CGETS(20, 5, "Null string specification\n"));
return NULL;
}
nilstr.len = 0;
- xprintf(CGETS(20, 6, "Standard key bindings\n"));
+ xprintf("%s", CGETS(20, 6, "Standard key bindings\n"));
prev = 0;
for (i = 0; i < 256; i++) {
if (CcKeyMap[prev] == CcKeyMap[i])
}
printkeys(CcKeyMap, prev, i - 1);
- xprintf(CGETS(20, 7, "Alternative key bindings\n"));
+ xprintf("%s", CGETS(20, 7, "Alternative key bindings\n"));
prev = 0;
for (i = 0; i < 256; i++) {
if (CcAltMap[prev] == CcAltMap[i])
prev = i;
}
printkeys(CcAltMap, prev, i - 1);
- xprintf(CGETS(20, 8, "Multi-character bindings\n"));
+ xprintf("%s", CGETS(20, 8, "Multi-character bindings\n"));
PrintXkey(NULL); /* print all Xkey bindings */
- xprintf(CGETS(20, 9, "Arrow key bindings\n"));
+ xprintf("%s", CGETS(20, 9, "Arrow key bindings\n"));
PrintArrowKeys(&nilstr);
}
static void
bindkey_usage(void)
{
- xprintf(CGETS(20, 12,
+ xprintf("%s", CGETS(20, 12,
"Usage: bindkey [options] [--] [KEY [COMMAND]]\n"));
- xprintf(CGETS(20, 13,
+ xprintf("%s", CGETS(20, 13,
" -a list or bind KEY in alternative key map\n"));
- xprintf(CGETS(20, 14,
+ xprintf("%s", CGETS(20, 14,
" -b interpret KEY as a C-, M-, F- or X- key name\n"));
- xprintf(CGETS(20, 15,
+ xprintf("%s", CGETS(20, 15,
" -s interpret COMMAND as a literal string to be output\n"));
- xprintf(CGETS(20, 16,
+ xprintf("%s", CGETS(20, 16,
" -c interpret COMMAND as a builtin or external command\n"));
- xprintf(CGETS(20, 17,
+ xprintf("%s", CGETS(20, 17,
" -v bind all keys to vi bindings\n"));
- xprintf(CGETS(20, 18,
+ xprintf("%s", CGETS(20, 18,
" -e bind all keys to emacs bindings\n"));
- xprintf(CGETS(20, 19,
+ xprintf("%s", CGETS(20, 19,
" -d bind all keys to default editor's bindings\n"));
- xprintf(CGETS(20, 20,
+ xprintf("%s", CGETS(20, 20,
" -l list editor commands with descriptions\n"));
- xprintf(CGETS(20, 21,
+ xprintf("%s", CGETS(20, 21,
" -r remove KEY's binding\n"));
- xprintf(CGETS(20, 22,
+ xprintf("%s", CGETS(20, 22,
" -k interpret KEY as a symbolic arrow-key name\n"));
- xprintf(CGETS(20, 23,
+ xprintf("%s", CGETS(20, 23,
" -- force a break from option processing\n"));
- xprintf(CGETS(20, 24,
+ xprintf("%s", CGETS(20, 24,
" -u (or any invalid option) this message\n"));
xprintf("\n");
- xprintf(CGETS(20, 25,
+ xprintf("%s", CGETS(20, 25,
"Without KEY or COMMAND, prints all bindings\n"));
- xprintf(CGETS(20, 26,
+ xprintf("%s", CGETS(20, 26,
"Without COMMAND, prints the binding for KEY.\n"));
}
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.const.c,v 3.84 2006/10/29 19:02:17 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.const.c,v 3.91 2009/06/19 16:35:33 christos Exp $ */
/*
* sh.const.c: String constants for tcsh.
*/
*/
#include "sh.h"
-RCSID("$tcsh: tc.const.c,v 3.84 2006/10/29 19:02:17 christos Exp $")
+RCSID("$tcsh: tc.const.c,v 3.91 2009/06/19 16:35:33 christos Exp $")
Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
Char STRautologout[] = { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't',
Char STRhangup[] = { 'h', 'a', 'n', 'g', 'u', 'p', '\0' };
Char STRaout[] = { 'a', '.', 'o', 'u', 't', '\0' };
Char STRtty[] = { 't', 't', 'y', '\0' };
-Char STRpts[] = { 'p', 't', 's', '\0' };
+Char STRptssl[] = { 'p', 't', 's', '/', '\0' };
Char STRany[] = { 'a', 'n', 'y', '\0' };
Char STRstatus[] = { 's', 't', 'a', 't', 'u', 's', '\0' };
Char STR0[] = { '0', '\0' };
'\0' };
Char STRLANGEUCZH[] = { '\0' };
Char STRLANGEUCZHB[] = { '\0' };
-# elif (defined(__FreeBSD__) || defined(__NetBSD__))
+# elif (defined(__FreeBSD__) || defined(__NetBSD__)) || defined(__MidnightBSD__)
Char STRLANGEUCJP[] = { 'j', 'a', '_', 'J', 'P', '.', 'e', 'u', 'c', 'J',
'P', '\0' };
Char STRLANGEUCJPB[] = { 'j', 'a', '_', 'J', 'P', '.', 'E', 'U', 'C', '\0' };
Char STRspRarrow2[] = { ' ', '>', '>', '\0' };
Char STRspRarrow[] = { ' ', '>', '\0' };
Char STRgt[] = { '>', '\0' };
-Char STRsp3dots[] = { ' ', '.', '.', '.', '\0' };
Char STRcent2[] = { '%', '%', '\0' };
Char STRcentplus[] = { '%', '+', '\0' };
Char STRcentminus[] = { '%', '-', '\0' };
Char STRKHOME[] = { 'H', 'O', 'M', 'E', '\0' };
Char STRbackslash_quote[] = { 'b', 'a', 'c', 'k', 's', 'l', 'a', 's', 'h', '_',
'q', 'u', 'o', 't', 'e', '\0' };
+Char STRcompat_expr[] = { 'c', 'o', 'm', 'p', 'a', 't', '_', 'e', 'x', 'p',
+ 'r', '\0' };
Char STRRparen[] = { ')', '\0' };
Char STRmail[] = { 'm', 'a', 'i', 'l', '\0' };
#ifndef HAVENOUTMP
#endif /* SIG_WINDOW || _VMS_POSIX */
#if defined (_OSD_POSIX) /* BS2000 needs this variable set to "SHELL" */
-Char STRPROGRAM_ENVIRONMENT[] = { 'P', 'R', 'O', 'G', 'R', 'A', 'M', '_', 'E', 'N', 'V', 'I', 'R', 'O', 'N', 'M', 'E', 'N', 'T', '\0'};
+Char STRPROGRAM_ENVIRONMENT[] = { 'P', 'R', 'O', 'G', 'R', 'A', 'M',
+ '_', 'E', 'N', 'V', 'I', 'R', 'O', 'N', 'M',
+ 'E', 'N', 'T', '\0'};
#endif /* _OSD_POSIX */
+Char STRCOMMAND_LINE[] = { 'C', 'O', 'M', 'M', 'A', 'N', 'D', '_', 'L', 'I',
+ 'N', 'E', '\0' };
#ifdef WARP
Char STRwarp[] = { 'w', 'a', 'r', 'p', '\0' };
Char STRrepeat[] = { 'r', 'e', 'p', 'e', 'a', 't', '\0' };
Char STReof[] = { '^', 'D', '\b', '\b', '\0' };
+Char STRonlyhistory[] = { 'o', 'n', 'l', 'y', 'h', 'i', 's', 't', 'o', 'r',
+ 'y', '\0' };
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.decls.h,v 3.63 2006/02/14 14:07:36 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.decls.h,v 3.64 2008/05/14 20:10:30 christos Exp $ */
/*
* tc.decls.h: Function declarations from all the tcsh modules
*/
#endif
extern char *short2qstr (const Char *);
+extern struct blk_buf *bb_alloc (void);
extern void bb_append (struct blk_buf *, Char *);
extern void bb_cleanup (void *);
extern Char **bb_finish (struct blk_buf *);
+extern void bb_free (void *);
+extern struct strbuf *strbuf_alloc(void);
extern void strbuf_terminate(struct strbuf *);
extern void strbuf_append1(struct strbuf *, char);
extern void strbuf_appendn(struct strbuf *, const char *,
extern void strbuf_append (struct strbuf *, const char *);
extern char *strbuf_finish (struct strbuf *);
extern void strbuf_cleanup(void *);
+extern void strbuf_free(void *);
+extern struct Strbuf *Strbuf_alloc(void);
extern void Strbuf_terminate(struct Strbuf *);
extern void Strbuf_append1(struct Strbuf *, Char);
extern void Strbuf_appendn(struct Strbuf *, const Char *,
extern void Strbuf_append (struct Strbuf *, const Char *);
extern Char *Strbuf_finish (struct Strbuf *);
extern void Strbuf_cleanup(void *);
+extern void Strbuf_free(void *);
/*
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.func.c,v 3.136 2006/09/01 12:51:35 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.func.c,v 3.139 2009/06/25 21:15:38 christos Exp $ */
/*
* tc.func.c: New tcsh builtins.
*/
*/
#include "sh.h"
-RCSID("$tcsh: tc.func.c,v 3.136 2006/09/01 12:51:35 christos Exp $")
+RCSID("$tcsh: tc.func.c,v 3.139 2009/06/25 21:15:38 christos Exp $")
#include "ed.h"
#include "ed.defns.h" /* for the function names */
}
strbuf_terminate(&pass);
- cleanup_until(&sa);
+ cleanup_until(&osa);
return pass.s;
}
cleanup_push(&pintr_disabled, disabled_cleanup);
if (precmd_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRprecmd);
- xprintf(CGETS(22, 3, "Faulty alias 'precmd' removed.\n"));
+ xprintf("%s", CGETS(22, 3, "Faulty alias 'precmd' removed.\n"));
goto leave;
}
precmd_active = 1;
cleanup_push(&pintr_disabled, disabled_cleanup);
if (postcmd_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRpostcmd);
- xprintf(CGETS(22, 3, "Faulty alias 'postcmd' removed.\n"));
+ xprintf("%s", CGETS(22, 3, "Faulty alias 'postcmd' removed.\n"));
goto leave;
}
postcmd_active = 1;
cleanup_push(&pintr_disabled, disabled_cleanup);
if (cwdcmd_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRcwdcmd);
- xprintf(CGETS(22, 4, "Faulty alias 'cwdcmd' removed.\n"));
+ xprintf("%s", CGETS(22, 4, "Faulty alias 'cwdcmd' removed.\n"));
goto leave;
}
cwdcmd_active = 1;
cleanup_push(&pintr_disabled, disabled_cleanup);
if (beepcmd_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRbeepcmd);
- xprintf(CGETS(22, 5, "Faulty alias 'beepcmd' removed.\n"));
+ xprintf("%s", CGETS(22, 5, "Faulty alias 'beepcmd' removed.\n"));
}
else {
beepcmd_active = 1;
cleanup_push(&pintr_disabled, disabled_cleanup);
if (periodic_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRperiodic);
- xprintf(CGETS(22, 6, "Faulty alias 'periodic' removed.\n"));
+ xprintf("%s", CGETS(22, 6, "Faulty alias 'periodic' removed.\n"));
goto leave;
}
periodic_active = 1;
cleanup_push(&pintr_disabled, disabled_cleanup);
if (jobcmd_active) { /* an error must have been caught */
aliasrun(2, STRunalias, STRjobcmd);
- xprintf(CGETS(22, 14, "Faulty alias 'jobcmd' removed.\n"));
+ xprintf("%s", CGETS(22, 14, "Faulty alias 'jobcmd' removed.\n"));
goto leave;
}
jobcmd_active = 1;
if (!Strcmp(args->word, STRstar))
star = 1;
if (ask && star) {
- xprintf(CGETS(22, 8,
+ xprintf("%s", CGETS(22, 8,
"Do you really want to delete all files? [n/y] "));
flush();
(void) force_read(SHIN, &c, 1);
switch (*p) {
case ' ':
case '\t':
-#ifdef WINNT_NATIVE
+#if defined(WINNT_NATIVE) || defined (__CYGWIN__)
case '\r':
-#endif /* WINNT_NATIVE */
+#endif /* WINNT_NATIVE || __CYGWIN__ */
if (ws) { /* a blank after a word.. save it */
*p = '\0';
#ifdef WINNT_NATIVE
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.os.h,v 3.101 2006/02/14 00:52:52 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.os.h,v 3.102 2007/07/05 14:13:06 christos Exp $ */
/*
* tc.os.h: Shell os dependent defines
*/
# endif /* POSIX */
#endif /* OREO */
+#ifdef __QNXNTO__
+#include <sys/resource.h>
+#include <fcntl.h>
+#undef O_TEXT
+#undef O_BINARY
+#endif
+
#ifdef convex
# include <sys/dmon.h>
#endif /* convex */
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.sig.h,v 3.32 2006/03/11 15:32:00 mitr Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.sig.h,v 3.33 2007/07/05 14:13:06 christos Exp $ */
/*
* tc.sig.h: Signal handling
*
#ifndef _h_tc_sig
#define _h_tc_sig
-#if (SYSVREL > 0) || defined(BSD4_4) || defined(_MINIX) || defined(DGUX) || defined(WINNT_NATIVE)
+#if (SYSVREL > 0) || defined(BSD4_4) || defined(_MINIX) || defined(DGUX) || defined(WINNT_NATIVE) || defined(__QNXNTO__)
# include <signal.h>
# ifndef SIGCHLD
# define SIGCHLD SIGCLD
-/* $Header: /p/tcsh/cvsroot/tcsh/tc.str.c,v 3.26 2006/03/02 18:46:45 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tc.str.c,v 3.30 2009/06/25 21:27:38 christos Exp $ */
/*
* tc.str.c: Short string package
* This has been a lesson of how to write buggy code!
#include <limits.h>
-RCSID("$tcsh: tc.str.c,v 3.26 2006/03/02 18:46:45 christos Exp $")
+RCSID("$tcsh: tc.str.c,v 3.30 2009/06/25 21:27:38 christos Exp $")
#define MALLOC_INCR 128
#ifdef WIDE_STRINGS
len = rt_mbtowc(pwc, s, n);
if (len == -1) {
- mbtowc(NULL, NULL, 0);
+ reset_mbtowc();
*pwc = (unsigned char)*s | INVALID_BYTE;
}
if (len <= 0)
dst += one_wctomb(dst, *src & CHAR);
src++;
if (dst >= edst) {
+ char *wdst = dst;
+ char *wedst = edst;
+
dstsize += MALLOC_INCR;
sdst = xrealloc(sdst, (dstsize + MALLOC_SURPLUS) * sizeof(char));
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
+ while (wdst > wedst) {
+ dst++;
+ wdst--;
+ }
}
}
*dst = 0;
dst += one_wctomb(dst, *src & CHAR);
src++;
if (dst >= edst) {
+ ptrdiff_t i = dst - edst;
dstsize += MALLOC_INCR;
sdst = xrealloc(sdst, (dstsize + MALLOC_SURPLUS) * sizeof(char));
edst = &sdst[dstsize];
- dst = &edst[-MALLOC_INCR];
+ dst = &edst[-MALLOC_INCR + i];
}
}
*dst = 0;
return (sdst);
}
+struct blk_buf *
+bb_alloc()
+{
+ return xcalloc(1, sizeof(struct blk_buf));
+}
+
static void
bb_store(struct blk_buf *bb, Char *str)
{
xfree(bb->vec);
}
+void
+bb_free(void *bb)
+{
+ bb_cleanup(bb);
+ xfree(bb);
+}
+
Char **
bb_finish(struct blk_buf *bb)
{
}
#define DO_STRBUF(STRBUF, CHAR, STRLEN) \
+ \
+struct STRBUF * \
+STRBUF##_alloc(void) \
+{ \
+ return xcalloc(1, sizeof(struct STRBUF)); \
+} \
+ \
static void \
STRBUF##_store1(struct STRBUF *buf, CHAR c) \
{ \
xfree(buf->s); \
} \
\
+void \
+STRBUF##_free(void *xbuf) \
+{ \
+ STRBUF##_cleanup(xbuf); \
+ xfree(xbuf); \
+} \
+ \
const struct STRBUF STRBUF##_init /* = STRBUF##_INIT; */
DO_STRBUF(strbuf, char, strlen);
.\" used here if you can. In particular, please don't use nroff commands
.\" which aren't already used herein.
.\"
-.TH TCSH 1 "3 March 2007" "Astron 6.15.00"
+.TH TCSH 1 "10 July 2009" "Astron 6.17.00"
.SH NAME
tcsh \- C shell with file name completion and command line editing
.SH SYNOPSIS
and `0' if by neither
.TP 8
.B P\fImode\fB:
-Like \fBP\fImode\fB:\fR, with leading zero
+Like \fBP\fImode\fR, with leading zero
.TP 8
.B U
Numeric userid
starting a background job to mark it.
.PP
When you try to leave the shell while jobs are stopped, you will be
-warned that `You have stopped jobs.' You may use the \fIjobs\fR command to see
-what they are. If you do this or immediately try to exit again, the shell will
-not warn you a second time, and the suspended jobs will be terminated.
+warned that `There are suspended jobs.' You may use the \fIjobs\fR command to
+see what they are. If you do this or immediately try to exit again, the shell
+will not warn you a second time, and the suspended jobs will be terminated.
.SS "Automatic, periodic and timed events (+)"
There are various ways to run commands and take other actions automatically
at various times in the ``life cycle'' of the shell. They are summarized here,
case the fourth delimiter can also be omitted), a slash is appended to
directories and a space to other words.
.PP
+\fIcommand\fR invoked from `...` version has additional environment
+variable set, the variable name is \%\fBCOMMAND_LINE\fR\% and
+contains (as its name indicates) contents of the current (already
+typed in) command line. One can examine and use contents of the
+\%\fBCOMMAND_LINE\fR\% variable in her custom script to build more
+sophisticated completions (see completion for svn(1) included in
+this package).
+.PP
Now for some examples. Some commands take only directories as arguments,
so there's no point completing plain files.
.IP "" 4
.TP
\fIsbsize\fR
the maximum size of socket buffer usage for this user
+.TP
+\fIswapsize\fR
+the maximum amount of swap space reserved or used for this user
.PP
\fImaximum-use\fR may be given as a (floating point or
integer) number followed by a scale factor. For all limits
.B universe \fIuniverse\fR (+)
Sets the universe to \fIuniverse\fR. (Masscomp/RTU only)
.TP 8
-.B unlimit \fR[\fB\-h\fR] [\fIresource\fR]
+.B unlimit \fR[\fB\-hf\fR] [\fIresource\fR]
Removes the limitation on \fIresource\fR or, if no \fIresource\fR is
specified, all \fIresource\fR limitations.
With \fB\-h\fR, the corresponding hard limits are removed.
Only the super-user may do this.
Note that \fBunlimit\fR may not exit successful, since most systems
do not allow \fIdescriptors\fR to be unlimited.
+With \fB\-f\fR errors are ignored.
.TP 8
.B unset \fIpattern
Removes all variables whose names match \fIpattern\fR, unless they are read-only.
This is similar to \fIpostcmd\fR, but it does not print builtins.
.RS +8
.IP "" 4
-> alias jobcmd 'echo \-n "^[]2\e;\e!#^G"'
+> alias jobcmd 'echo \-n "^[]2\e;\e!#:q^G"'
.PP
then executing \fIvi foo.c\fR will put the command string in the xterm title bar.
.RE
Runs before each command gets executed.
.RS +8
.IP "" 4
-> alias postcmd 'echo \-n "^[]2\e;\e!#^G"'
+> alias postcmd 'echo \-n "^[]2\e;\e!#:q^G"'
.PP
then executing \fIvi foo.c\fR will put the command string in the xterm title bar.
.RE
.TP 8
.B autoexpand \fR(+)
If set, the \fIexpand-history\fR editor command is invoked automatically
-before each completion attempt.
+before each completion attempt. If this is set to \fIonlyhistory\fR, then
+only history will be expanded and a second completion will expand filenames.
.TP 8
.B autolist \fR(+)
If set, possibilities are listed after an ambiguous completion.
.B command \fR(+)
If set, the command which was passed to the shell with the \fB-c\fR flag (q.v.).
.TP 8
+.B compat_expr \fR(+)
+If set, the shell will evaluate expressions right to left, like the original
+\fIcsh\fR.
+.TP 8
.B complete \fR(+)
If set to `enhance', completion 1) ignores case and 2) considers
periods, hyphens and underscores (`.', `\-' and `_') to be word
The creator of tcsh was impressed by this feature and several others of TENEX
and TOPS-20, and created a version of csh which mimicked them.
.SH LIMITATIONS
-Words can be no longer than 1024 characters.
-.PP
-The system limits argument lists to 10240 characters.
+The system limits argument lists to ARG_MAX characters.
.PP
The number of arguments to a command which involves filename expansion is
limited to 1/6th the number of characters allowed in an argument list.
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
termio(7), Introduction to the C Shell
.SH VERSION
-This manual documents tcsh 6.15.00 (Astron) 2007-03-03.
+This manual documents tcsh 6.17.00 (Astron) 2009-07-10.
.SH AUTHORS
.PD 0
.TP 2
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="tcsh"\r
+ ProjectGUID="{0DF699BA-6A5E-4B74-AE29-19757D072F19}"\r
+ RootNamespace="tcsh"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine=""\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description=""\r
+ CommandLine=""\r
+ AdditionalDependencies=""\r
+ Outputs=""\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ WholeProgramOptimization="false"\r
+ AdditionalIncludeDirectories="$(SolutionDir)\win32;$(SolutionDir)"\r
+ PreprocessorDefinitions="WINNT_NATIVE;NO_CRYPT;HAVE_DIRENT_H;NTDBG"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="0"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ StackReserveSize="1048576"\r
+ StackCommitSize="524288"\r
+ EntryPointSymbol="silly_entry"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine=""\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description=""\r
+ CommandLine=""\r
+ AdditionalDependencies=""\r
+ Outputs=""\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ WholeProgramOptimization="false"\r
+ AdditionalIncludeDirectories="$(SolutionDir)\win32;$(SolutionDir)"\r
+ PreprocessorDefinitions="WINNT_NATIVE;NO_CRYPT;HAVE_DIRENT_H"\r
+ RuntimeLibrary="0"\r
+ EnableFunctionLevelLinking="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ StackReserveSize="1048576"\r
+ StackCommitSize="524288"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ LinkTimeCodeGeneration="0"\r
+ EntryPointSymbol="silly_entry"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine=""\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description=""\r
+ CommandLine=""\r
+ AdditionalDependencies=""\r
+ Outputs=""\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ WholeProgramOptimization="false"\r
+ AdditionalIncludeDirectories="$(SolutionDir)\win32;$(SolutionDir)"\r
+ PreprocessorDefinitions="WINNT_NATIVE;NO_CRYPT;HAVE_DIRENT_H;NTDBG"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="0"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ DisableSpecificWarnings="4244;4267"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ StackReserveSize="1048576"\r
+ StackCommitSize="524288"\r
+ EntryPointSymbol="silly_entry"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="2"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ CommandLine=""\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description=""\r
+ CommandLine=""\r
+ AdditionalDependencies=""\r
+ Outputs=""\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ WholeProgramOptimization="false"\r
+ AdditionalIncludeDirectories="$(SolutionDir)\win32;$(SolutionDir)"\r
+ PreprocessorDefinitions="WINNT_NATIVE;NO_CRYPT;HAVE_DIRENT_H"\r
+ RuntimeLibrary="0"\r
+ EnableFunctionLevelLinking="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ CompileAs="1"\r
+ DisableSpecificWarnings="4244;4267"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ StackReserveSize="1048576"\r
+ StackCommitSize="524288"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ LinkTimeCodeGeneration="0"\r
+ EntryPointSymbol="silly_entry"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\win32\bogus.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\clip.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\console.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\customstep.cmd"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description="Generating headers"\r
+ CommandLine="$(SolutionDir)\win32\customstep.cmd $(SolutionDir)"\r
+ AdditionalDependencies="ed.defns.c;sh.err.c;tc.const.c;win32\nt.const.c"\r
+ Outputs="ed.defns.h;sh.err.h;tc.const.h;win32\nt.const.h"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description="Generating headers"\r
+ CommandLine="$(SolutionDir)\win32\customstep.cmd $(SolutionDir)"\r
+ AdditionalDependencies="ed.defns.c;sh.err.c;tc.const.c;win32\nt.const.c"\r
+ Outputs="ed.defns.h;sh.err.h;tc.const.h;win32\nt.const.h"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Debug|x64"\r
+ >\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description="Generating headers"\r
+ CommandLine="$(SolutionDir)\win32\customstep.cmd $(SolutionDir)"\r
+ AdditionalDependencies="ed.defns.c;sh.err.c;tc.const.c;win32\nt.const.c"\r
+ Outputs="ed.defns.h;sh.err.h;tc.const.h;win32\nt.const.h"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|x64"\r
+ >\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ Description="Generating headers"\r
+ CommandLine="$(SolutionDir)\win32\customstep.cmd $(SolutionDir)"\r
+ AdditionalDependencies="ed.defns.c;sh.err.c;tc.const.c;win32\nt.const.c"\r
+ Outputs="ed.defns.h;sh.err.h;tc.const.h;win32\nt.const.h"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\dirent.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.chared.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.defns.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.init.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.inputl.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.refresh.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.term.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.xmap.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\fork.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\glob.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\globals.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\io.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\nt.bind.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\nt.char.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\nt.const.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\nt.screen.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\nt.who.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\ntb1.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\ntb2.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\ntfunc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\ps.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.char.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.char.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.dir.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.dol.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.err.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.exec.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.exp.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.file.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.func.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.glob.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.hist.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.init.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.lex.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.misc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.parse.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.print.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.proc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.sem.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.set.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.time.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\signal.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\stdio.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\support.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.alloc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.bind.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.const.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.disc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.func.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.nls.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.os.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.printf.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.prompt.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.sched.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.sig.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.str.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.vers.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.who.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.color.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.comp.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.help.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.init.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.parse.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.spell.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\config.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\config_f.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\config_p.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\dirent.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.decls.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\ed.term.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\forkdata.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\glob.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\ntport.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\patchlevel.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\pathnames.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.decls.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.dir.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.proc.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\sh.types.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\signal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\snames.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.decls.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.nls.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.os.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.sig.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tc.wait.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.decls.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tw.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\version.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ <File\r
+ RelativePath=".\win32\tcshrc.rc"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\win32\WILDCAT.RC"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
-/* $Header: /p/tcsh/cvsroot/tcsh/tw.color.c,v 1.24 2006/03/02 18:46:45 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tw.color.c,v 1.25 2008/10/17 19:57:33 christos Exp $ */
/*
* tw.color.c: builtin color ls-F
*/
*/
#include "sh.h"
-RCSID("$tcsh: tw.color.c,v 1.24 2006/03/02 18:46:45 christos Exp $")
+RCSID("$tcsh: tw.color.c,v 1.25 2008/10/17 19:57:33 christos Exp $")
#include "tw.h"
#include "ed.h"
VAR(NOS, "tw", ""), /* Sticky and other writable dir (+t,o+w) */
VAR(NOS, "ow", ""), /* Other writable dir (o+w) but not sticky */
VAR(NOS, "st", ""), /* Sticky dir (+t) but not other writable */
+ VAR(NOS, "rs", "0"), /* Reset to normal color */
};
enum FileType {
-/* $Header: /p/tcsh/cvsroot/tcsh/tw.comp.c,v 1.41 2006/03/02 18:46:45 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tw.comp.c,v 1.42 2007/10/01 21:52:00 christos Exp $ */
/*
* tw.comp.c: File completion builtin
*/
*/
#include "sh.h"
-RCSID("$tcsh: tw.comp.c,v 1.41 2006/03/02 18:46:45 christos Exp $")
+RCSID("$tcsh: tw.comp.c,v 1.42 2007/10/01 21:52:00 christos Exp $")
#include "tw.h"
#include "ed.h"
default:
abort(); /* Cannot happen */
}
+ tsetenv(STRCOMMAND_LINE, line);
res = tw_result(com, pat);
+ Unsetenv(STRCOMMAND_LINE);
cleanup_until(buf);
return res;
}
-/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.123 2007/03/01 21:21:42 corinna Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.124 2007/07/02 15:48:48 christos Exp $ */
/*
* tw.parse.c: Everyone has taken a shot in this futile effort to
* lexically analyze a csh line... Well we cannot good
*/
#include "sh.h"
-RCSID("$tcsh: tw.parse.c,v 3.123 2007/03/01 21:21:42 corinna Exp $")
+RCSID("$tcsh: tw.parse.c,v 3.124 2007/07/02 15:48:48 christos Exp $")
#include "tw.h"
#include "ed.h"
Char *p;
int found;
- found = !cmd_expand(qline.s + wordp, &p);
+ found = cmd_expand(qline.s + wordp, &p);
if (!found) {
xfree(p);