Commit 7a2d063d authored by Lucas Nussbaum's avatar Lucas Nussbaum

Imported Upstream version 6.17.00

parent e6f49ca5
21. V6.17.00 - 20090710
20. Fix dataroot autoconf issue.
19. Fix directory stuff for unit tests.
18. Fix small bug in history in loops.
17. Provide newer config.{guess,sub}
16. Fix gcc 4 warnings.
15. Fix memory trashing bug introduced in 10.
14. V6.16.01 - 20090624
13. add missing sigemptyset in goodbye()
12. add rlimit swapsize from FreeBSD.
11. restore behavior where a[n-] never prints an error.
10. always save the whole command, not just the first 80 chars of it.
9. fix short2str/short2qstr length adjustment in wide chars
(Vitezslav Crhonek)
8. set histfile=/tmp/history.temp; set savehist=(100 merge);
alias precmd history -S. After that justpr is not restored and commands
don't execute. (Andriy Gapon)
7. Fix "as" $ modifier from corrupting memory.
set t=demfonsftraftionf; echo $t:as/f//
6. Make $% work with environment variable (Ron Johnston)
5. Dragonfly script support (Matthias Schmidt, m65)
4. Add autoexpand=onlyhistory (Don Estabrook, m66)
3. Add history in loops (Laurence Darby, m48)
2. Add missing colorls "rs" variable (Shlomi Fish, m70)
1. Fix pts detection issue (Ruslan Ermilov)
33. V6.16.00 - 20080930 33. V6.16.00 - 20080930
32. longjmp clobbered variable fixes. 32. longjmp clobbered variable fixes.
31. __GNX__ addition 31. __GNX__ addition
......
# $tcsh: Makefile.in,v 3.38 2008/09/25 14:40:35 christos Exp $ # $tcsh: Makefile.in,v 3.40 2009/06/24 22:09:05 christos Exp $
# Makefile.in 4.3 6/11/83 # Makefile.in 4.3 6/11/83
# #
# C Shell with process control; VM/UNIX VAX Makefile # C Shell with process control; VM/UNIX VAX Makefile
...@@ -278,7 +278,7 @@ P= ...@@ -278,7 +278,7 @@ P=
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
bindir=@bindir@ bindir=@bindir@
mandir=@mandir@ mandir=@datarootdir@/man
MANSECT=1 MANSECT=1
DESTBIN=${DESTDIR}${bindir} DESTBIN=${DESTDIR}${bindir}
DESTMAN=${DESTDIR}${mandir}/man${MANSECT} DESTMAN=${DESTDIR}${mandir}/man${MANSECT}
...@@ -463,7 +463,7 @@ $(srcdir)/tests/package.m4: $(srcdir)/configure.in ...@@ -463,7 +463,7 @@ $(srcdir)/tests/package.m4: $(srcdir)/configure.in
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
} >$(srcdir)/tests/package.m4 } >$(srcdir)/tests/package.m4
$(srcdir)/tests/testsuite: tests/package.m4 tests/testsuite.at $(TESTFILES) $(srcdir)/tests/testsuite: $(srcdir)/tests/package.m4 $(srcdir}/tests/testsuite.at $(TESTFILES)
autom4te --language=autotest -I $(srcdir)/tests \ autom4te --language=autotest -I $(srcdir)/tests \
$(srcdir)/tests/testsuite.at -o $@.tmp $(srcdir)/tests/testsuite.at -o $@.tmp
mv $@.tmp $@ mv $@.tmp $@
......
This is tcsh version 6.16.00. 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 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 name completion, listing, etc. and a bunch of small additions to the
shell itself. shell itself.
......
This diff is collapsed.
This diff is collapsed.
/* $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 * config_f.h -- configure various defines for tcsh
* *
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
* This can be much slower and no memory statistics will be * This can be much slower and no memory statistics will be
* provided. * 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 # define SYSMALLOC
#else #else
# undef SYSMALLOC # undef SYSMALLOC
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
# ifndef __GNUC__ # ifndef __GNUC__
# define RCSID(id) static char *rcsid = (id); # define RCSID(id) static char *rcsid = (id);
# else # 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__ */ # endif /* !__GNUC__ */
#else #else
# define RCSID(id) /* Nothing */ # define RCSID(id) /* Nothing */
......
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for tcsh 6.16.00. # Generated by GNU Autoconf 2.61 for tcsh 6.17.00.
# #
# Report bugs to <http://bugs.gw.com/>. # Report bugs to <http://bugs.gw.com/>.
# #
...@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} ...@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='tcsh' PACKAGE_NAME='tcsh'
PACKAGE_TARNAME='tcsh' PACKAGE_TARNAME='tcsh'
PACKAGE_VERSION='6.16.00' PACKAGE_VERSION='6.17.00'
PACKAGE_STRING='tcsh 6.16.00' PACKAGE_STRING='tcsh 6.17.00'
PACKAGE_BUGREPORT='http://bugs.gw.com/' PACKAGE_BUGREPORT='http://bugs.gw.com/'
ac_unique_file="tc.vers.c" ac_unique_file="tc.vers.c"
...@@ -1189,7 +1189,7 @@ if test "$ac_init_help" = "long"; then ...@@ -1189,7 +1189,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures tcsh 6.16.00 to adapt to many kinds of systems. \`configure' configures tcsh 6.17.00 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
...@@ -1254,7 +1254,7 @@ fi ...@@ -1254,7 +1254,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of tcsh 6.16.00:";; short | recursive ) echo "Configuration of tcsh 6.17.00:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
...@@ -1346,7 +1346,7 @@ fi ...@@ -1346,7 +1346,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
tcsh configure 6.16.00 tcsh configure 6.17.00
generated by GNU Autoconf 2.61 generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
...@@ -1360,7 +1360,7 @@ cat >config.log <<_ACEOF ...@@ -1360,7 +1360,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by tcsh $as_me 6.16.00, which was It was created by tcsh $as_me 6.17.00, which was
generated by GNU Autoconf 2.61. Invocation command line was generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@ $ $0 $@
...@@ -1929,6 +1929,11 @@ case "${host}" in ...@@ -1929,6 +1929,11 @@ case "${host}" in
tcsh_config_file=bsd4.4 tcsh_config_file=bsd4.4
;; ;;
## DragonFlyBSD systems
*-*-dragonfly*)
tcsh_config_file=bsd4.4
;;
## OpenBSD systems ## OpenBSD systems
*-*-openbsd*) *-*-openbsd*)
tcsh_config_file=bsd4.4 tcsh_config_file=bsd4.4
...@@ -8939,7 +8944,7 @@ exec 6>&1 ...@@ -8939,7 +8944,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by tcsh $as_me 6.16.00, which was This file was extended by tcsh $as_me 6.17.00, which was
generated by GNU Autoconf 2.61. Invocation command line was generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
...@@ -8992,7 +8997,7 @@ Report bugs to <bug-autoconf@gnu.org>." ...@@ -8992,7 +8997,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\ ac_cs_version="\\
tcsh config.status 6.16.00 tcsh config.status 6.17.00
configured by $0, generated by GNU Autoconf 2.61, configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
......
...@@ -9,7 +9,7 @@ dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96. ...@@ -9,7 +9,7 @@ dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
dnl dnl
AC_PREREQ([2.59])dnl Minimum Autoconf version required. AC_PREREQ([2.59])dnl Minimum Autoconf version required.
AC_INIT([tcsh], [6.16.00], [http://bugs.gw.com/]) AC_INIT([tcsh], [6.17.00], [http://bugs.gw.com/])
AC_CONFIG_SRCDIR([tc.vers.c]) AC_CONFIG_SRCDIR([tc.vers.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([.], [.]) AC_CONFIG_TESTDIR([.], [.])
...@@ -105,6 +105,11 @@ case "${host}" in ...@@ -105,6 +105,11 @@ case "${host}" in
*-*-midnightbsd*) *-*-midnightbsd*)
tcsh_config_file=bsd4.4 tcsh_config_file=bsd4.4
;; ;;
## DragonFlyBSD systems
*-*-dragonfly*)
tcsh_config_file=bsd4.4
;;
## OpenBSD systems ## OpenBSD systems
*-*-openbsd*) *-*-openbsd*)
......
/* $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. * ed.chared.c: Character editing functions.
*/ */
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#include "sh.h" #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 "ed.h"
#include "tw.h" #include "tw.h"
...@@ -120,8 +120,8 @@ static Char *c_prev_word (Char *, Char *, int); ...@@ -120,8 +120,8 @@ static Char *c_prev_word (Char *, Char *, int);
static Char *c_next_word (Char *, Char *, int); static Char *c_next_word (Char *, Char *, int);
static Char *c_number (Char *, int *, int); static Char *c_number (Char *, int *, int);
static Char *c_expand (Char *); static Char *c_expand (Char *);
static void c_excl (Char *); static int c_excl (Char *);
static void c_substitute (void); static int c_substitute (void);
static void c_delfini (void); static void c_delfini (void);
static int c_hmatch (Char *); static int c_hmatch (Char *);
static void c_hsetpat (void); static void c_hsetpat (void);
...@@ -682,13 +682,16 @@ excl_err: ...@@ -682,13 +682,16 @@ excl_err:
* space (or the beginning of the buffer) and properly expand all the excl's * 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) * from there up to the current cursor position. We also avoid (trying to)
* expanding '>!' * expanding '>!'
* Returns number of expansions attempted (doesn't matter whether they succeeded
* or not).
*/ */
static void static int
c_excl(Char *p) c_excl(Char *p)
{ {
int i; int i;
Char *q; Char *q;
int nr_exp;
/* /*
* if />[SPC TAB]*![SPC TAB]/, back up p to just after the >. otherwise, * if />[SPC TAB]*![SPC TAB]/, back up p to just after the >. otherwise,
...@@ -708,9 +711,10 @@ c_excl(Char *p) ...@@ -708,9 +711,10 @@ c_excl(Char *p)
/* /*
* Forever: Look for history char. (Stop looking when we find the cursor.) * Forever: Look for history char. (Stop looking when we find the cursor.)
* Count backslashes. Of odd, skip history char. Return if all done. * Count backslashes. If odd, skip history char. Expand if even number of
* Expand if even number of backslashes. * backslashes.
*/ */
nr_exp = 0;
for (;;) { for (;;) {
while (*p != HIST && p < Cursor) while (*p != HIST && p < Cursor)
++p; ++p;
...@@ -718,18 +722,23 @@ c_excl(Char *p) ...@@ -718,18 +722,23 @@ c_excl(Char *p)
continue; continue;
if (i % 2 == 0) if (i % 2 == 0)
++p; ++p;
if (p >= Cursor) if (p >= Cursor) /* all done */
return; return nr_exp;
if (i % 2 == 1) if (i % 2 == 1) {
p = c_expand(p); p = c_expand(p);
++nr_exp;
}
} }
return nr_exp;
} }
static void static int
c_substitute(void) c_substitute(void)
{ {
Char *p; Char *p;
int nr_exp;
/* /*
* Start p out one character before the cursor. Move it backwards looking * Start p out one character before the cursor. Move it backwards looking
...@@ -743,8 +752,12 @@ c_substitute(void) ...@@ -743,8 +752,12 @@ c_substitute(void)
* If we found a history character, go expand it. * If we found a history character, go expand it.
*/ */
if (*p == HIST) if (*p == HIST)
c_excl(p); nr_exp = c_excl(p);
else
nr_exp = 0;
Refresh(); Refresh();
return nr_exp;
} }
static void static void
...@@ -3441,13 +3454,20 @@ e_tty_stopo(Char c) ...@@ -3441,13 +3454,20 @@ e_tty_stopo(Char c)
return(CC_NORM); return(CC_NORM);
} }
/* returns the number of (attempted) expansions */
int
ExpandHistory(void)
{
*LastChar = '\0'; /* just in case */
return c_substitute();
}
/*ARGSUSED*/ /*ARGSUSED*/
CCRETVAL CCRETVAL
e_expand_history(Char c) e_expand_history(Char c)
{ {
USE(c); USE(c);
*LastChar = '\0'; /* just in case */ (void)ExpandHistory();
c_substitute();
return(CC_NORM); return(CC_NORM);
} }
...@@ -3457,7 +3477,7 @@ e_magic_space(Char c) ...@@ -3457,7 +3477,7 @@ e_magic_space(Char c)
{ {
USE(c); USE(c);
*LastChar = '\0'; /* just in case */ *LastChar = '\0'; /* just in case */
c_substitute(); (void)c_substitute();
return(e_insert(' ')); return(e_insert(' '));
} }
...@@ -3548,7 +3568,7 @@ e_load_average(Char c) ...@@ -3548,7 +3568,7 @@ e_load_average(Char c)
*/ */
if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0) if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0)
#endif #endif
xprintf(CGETS(5, 1, "Load average unavailable\n")); xprintf("%s", CGETS(5, 1, "Load average unavailable\n"));
return(CC_REFRESH); 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.decls.h: Editor external definitions
*/ */
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
* ed.chared.c * ed.chared.c
*/ */
extern int InsertStr (Char *); extern int InsertStr (Char *);
extern int ExpandHistory (void);
extern void DeleteBack (int); extern void DeleteBack (int);
extern void SetKillRing (int); extern void SetKillRing (int);
extern CCRETVAL GetHistLine (void); extern CCRETVAL GetHistLine (void);
...@@ -194,6 +195,7 @@ extern CCRETVAL e_copyregion (Char); ...@@ -194,6 +195,7 @@ extern CCRETVAL e_copyregion (Char);
extern CCRETVAL e_tty_int (Char); extern CCRETVAL e_tty_int (Char);
extern CCRETVAL e_run_fg_editor (Char); extern CCRETVAL e_run_fg_editor (Char);
extern CCRETVAL e_list_eof (Char); extern CCRETVAL e_list_eof (Char);
extern int e_expand_history_rne (Char);
extern CCRETVAL e_expand_history (Char); extern CCRETVAL e_expand_history (Char);
extern CCRETVAL e_magic_space (Char); extern CCRETVAL e_magic_space (Char);
extern CCRETVAL e_list_glob (Char); extern CCRETVAL e_list_glob (Char);
......
/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.67 2007/09/28 21:02:02 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. * ed.inputl.c: Input line handling.
*/ */
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
*/ */
#include "sh.h" #include "sh.h"
RCSID("$tcsh: ed.inputl.c,v 3.67 2007/09/28 21:02:02 christos Exp $") RCSID("$tcsh: ed.inputl.c,v 3.70 2009/06/25 21:15:37 christos Exp $")
#include "ed.h" #include "ed.h"
#include "ed.defns.h" /* for the function names */ #include "ed.defns.h" /* for the function names */
...@@ -91,10 +91,12 @@ Inputl(void) ...@@ -91,10 +91,12 @@ Inputl(void)
struct varent *imode = adrof(STRinputmode); struct varent *imode = adrof(STRinputmode);
Char *SaveChar, *CorrChar; Char *SaveChar, *CorrChar;
int matchval; /* from tenematch() */ int matchval; /* from tenematch() */
int nr_history_exp; /* number of (attempted) history expansions */
COMMAND fn; COMMAND fn;
int curlen = 0; int curlen = 0;
int newlen; int newlen;
int idx; int idx;
Char *autoexpand;
if (!MapsAreInited) /* double extra just in case */ if (!MapsAreInited) /* double extra just in case */
ed_InitMaps(); ed_InitMaps();
...@@ -262,13 +264,13 @@ Inputl(void) ...@@ -262,13 +264,13 @@ Inputl(void)
ch = tch; ch = tch;
if (ch == 'y' || ch == ' ') { if (ch == 'y' || ch == ' ') {
LastChar = CorrChar; /* Restore the corrected end */ LastChar = CorrChar; /* Restore the corrected end */
xprintf(CGETS(6, 2, "yes\n")); xprintf("%s", CGETS(6, 2, "yes\n"));
} }
else { else {
Strcpy(InputBuf, Origin); Strcpy(InputBuf, Origin);
LastChar = SaveChar; LastChar = SaveChar;
if (ch == 'e') { if (ch == 'e') {
xprintf(CGETS(6, 3, "edit\n")); xprintf("%s", CGETS(6, 3, "edit\n"));
*LastChar-- = '\0'; *LastChar-- = '\0';
Cursor = LastChar; Cursor = LastChar;
printprompt(3, NULL); printprompt(3, NULL);
...@@ -279,7 +281,7 @@ Inputl(void) ...@@ -279,7 +281,7 @@ Inputl(void)
break; break;
} }
else if (ch == 'a') { else if (ch == 'a') {
xprintf(CGETS(6, 4, "abort\n")); xprintf("%s", CGETS(6, 4, "abort\n"));
LastChar = InputBuf; /* Null the current line */ LastChar = InputBuf; /* Null the current line */
Cursor = LastChar; Cursor = LastChar;
printprompt(0, NULL); printprompt(0, NULL);
...@@ -287,7 +289,7 @@ Inputl(void) ...@@ -287,7 +289,7 @@ Inputl(void)
cleanup_until(Origin); cleanup_until(Origin);
break; break;
} }
xprintf(CGETS(6, 5, "no\n")); xprintf("%s", CGETS(6, 5, "no\n"));
} }
flush(); flush();
} }
...@@ -307,9 +309,9 @@ Inputl(void) ...@@ -307,9 +309,9 @@ Inputl(void)
PastBottom(); PastBottom();
} }
if (matchval == 0) { if (matchval == 0) {
xprintf(CGETS(6, 6, "No matching command\n")); xprintf("%s", CGETS(6, 6, "No matching command\n"));
} else if (matchval == 2) { } else if (matchval == 2) {
xprintf(CGETS(6, 7, "Ambiguous command\n")); xprintf("%s", CGETS(6, 7, "Ambiguous command\n"));
} }
if (NeedsRedraw) { if (NeedsRedraw) {
ClearLines(); ClearLines();
...@@ -396,65 +398,73 @@ Inputl(void) ...@@ -396,65 +398,73 @@ Inputl(void)
curlen = (int) (LastChar - InputBuf); curlen = (int) (LastChar - InputBuf);
if (adrof(STRautoexpand)) nr_history_exp = 0;
(void) e_expand_history(0); autoexpand = varval(STRautoexpand);
/* if (autoexpand != STRNULL)
* Modified by Martin Boyer (gamin@ireq-robot.hydro.qc.ca): nr_history_exp += ExpandHistory();
* A separate variable now controls beeping after
* completion, independently of autolisting. /* try normal expansion only if no history references were found */
*/ if (nr_history_exp == 0 ||
expnum = (int) (Cursor - InputBuf); Strcmp(autoexpand, STRonlyhistory) != 0) {
switch (matchval = tenematch(InputBuf, Cursor-InputBuf, fn)){ /*
case 1: * Modified by Martin Boyer (gamin@ireq-robot.hydro.qc.ca):
if (non_unique_match && matchbeep && matchbeep->vec != NULL && * A separate variable now controls beeping after
(Strcmp(*(matchbeep->vec), STRnotunique) == 0)) * completion, independently of autolisting.
SoundBeep(); */
break; expnum = (int) (Cursor - InputBuf);
case 0: switch (matchval = tenematch(InputBuf, Cursor-InputBuf, fn)){
if (matchbeep && matchbeep->vec != NULL) { case 1:
if (Strcmp(*(matchbeep->vec), STRnomatch) == 0 || if (non_unique_match && matchbeep &&
Strcmp(*(matchbeep->vec), STRambiguous) == 0 || matchbeep->vec != NULL &&
Strcmp(*(matchbeep->vec), STRnotunique) == 0) (Strcmp(*(matchbeep->vec), STRnotunique) == 0))
SoundBeep(); SoundBeep();
}
else
SoundBeep();
break;
default:
if (matchval < 0) { /* Error from tenematch */
curchoice = -1;
SoundBeep();
break; break;
} case 0:
if (matchbeep && matchbeep->vec != NULL) { if (matchbeep && matchbeep->vec != NULL) {
if ((Strcmp(*(matchbeep->vec), STRambiguous) == 0 || if (Strcmp(*(matchbeep->vec), STRnomatch) == 0 ||
Strcmp(*(matchbeep->vec), STRnotunique) == 0)) Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
Strcmp(*(matchbeep->vec), STRnotunique) == 0)
SoundBeep();
}
else
SoundBeep(); SoundBeep();
} break;
else default:
SoundBeep(); if (matchval < 0) { /* Error from tenematch */
/* curchoice = -1;
* Addition by David C Lawrence <tale@pawl.rpi.edu>: If an SoundBeep();
* attempted completion is ambiguous, list the choices. break;
* (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(); if (matchbeep && matchbeep->vec != NULL) {
fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST; if ((Strcmp(*(matchbeep->vec), STRambiguous) == 0 ||
(void) tenematch(InputBuf, Cursor-InputBuf, fn); 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) { if (NeedsRedraw) {
PastBottom(); PastBottom();
......
/* $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 * ed.screen.c: Editor/termcap-curses interface
*/ */
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
*/ */
#include "sh.h" #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 "ed.h"
#include "tc.h" #include "tc.h"
...@@ -383,8 +383,8 @@ TellTC(void) ...@@ -383,8 +383,8 @@ TellTC(void)
struct termcapstr *t; struct termcapstr *t;
char *first, *s; char *first, *s;