Update of /cvsroot/winbash/winbash
In directory usw-pr-cvs1:/tmp/cvs-serv28243
Modified Files:
.build .patchlevel Makefile bashhist.c config.h config.h.mini
cpp-Makefile execute_cmd.c externs.h flags.c flags.h general.c
general.h jobs.c machines.h mailcheck.c nojobs.c parse.y
print_cmd.c shell.c siglist.h stdc.h subst.c trap.c
variables.c version.h
Log Message:
Applied 1.14.4 GNU diffs
Index: .build
===================================================================
RCS file: /cvsroot/winbash/winbash/.build,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- .build 10 Mar 2002 20:33:03 -0000 1.5
+++ .build 10 Mar 2002 23:25:30 -0000 1.6
@@ -1 +1 @@
-2
+3
Index: .patchlevel
===================================================================
RCS file: /cvsroot/winbash/winbash/.patchlevel,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- .patchlevel 9 Mar 2002 16:05:41 -0000 1.2
+++ .patchlevel 10 Mar 2002 23:25:31 -0000 1.3
@@ -1 +1 @@
-3
+4
Index: Makefile
===================================================================
RCS file: /cvsroot/winbash/winbash/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile 10 Mar 2002 21:42:16 -0000 1.5
+++ Makefile 10 Mar 2002 23:25:31 -0000 1.6
@@ -193,7 +193,7 @@
clean:
$(RM) $(BASH-OBJS) y.tab.c y.tab.h bash.exe sh.exe bash.pdb \
- newversion.pdb newversion.ilk \
+ builtins.pdb newversion.pdb newversion.ilk \
TAGS
cd builtins ; $(MAKE) clean
Index: bashhist.c
===================================================================
RCS file: /cvsroot/winbash/winbash/bashhist.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bashhist.c 10 Mar 2002 21:45:13 -0000 1.2
+++ bashhist.c 10 Mar 2002 23:25:31 -0000 1.3
@@ -150,7 +150,7 @@
{
int result = 0;
- if (interactive && history_lines_this_session)
+ if (history_lines_this_session)
{
char *hf = get_string_value ("HISTFILE");
Index: config.h
===================================================================
RCS file: /cvsroot/winbash/winbash/config.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- config.h 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ config.h 10 Mar 2002 23:25:31 -0000 1.2
@@ -84,9 +84,13 @@
# define HISTORY
#endif /* BANG_HISTORY && !HISTORY */
+#if defined (READLINE) && !defined (HISTORY)
+# define HISTORY
+#endif
+
#ifndef __NT_VC__
#define DEFAULT_PATH_VALUE \
- ":/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/etc"
+ "/bin:/usr/bin:/usr/ucb:/usr/sbin:/sbin:/etc:/usr/etc:/usr/lib"
#else
#define DEFAULT_PATH_VALUE \
";c:/usr/gnu/bin;c:/usr/local/bin;c:/dos;c:/winnt35/system32;c:/win32"
@@ -97,7 +101,20 @@
/* The value for PATH when invoking `command -p'. This is only used when
the Posix.2 confstr () function, or CS_PATH define are not present. */
#define STANDARD_UTILS_PATH \
- "/bin:/usr/bin:/usr/ucb:/usr/sbin:/etc:/usr/etc"
+ "/bin:/usr/bin:/usr/ucb:/usr/sbin:/sbin:/etc:/usr/etc:/usr/lib"
+
+/* Put system-specific default mail directories here. */
+#if defined (__bsdi__) || defined (__FreeBSD__) || defined (__NetBSD__)
+# define DEFAULT_MAIL_PATH "/var/mail/"
+#endif
+
+#if !defined (DEFAULT_MAIL_PATH)
+#if defined (USG)
+# define DEFAULT_MAIL_PATH "/usr/mail/"
+#else
+# define DEFAULT_MAIL_PATH "/usr/spool/mail/"
+#endif
+#endif
/* Define V9_ECHO if you want to give the echo builtin backslash-escape
interpretation using the -e option, in the style of the Bell Labs 9th
Index: config.h.mini
===================================================================
RCS file: /cvsroot/winbash/winbash/config.h.mini,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- config.h.mini 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ config.h.mini 10 Mar 2002 23:25:31 -0000 1.2
@@ -92,14 +92,31 @@
# define HISTORY
#endif /* BANG_HISTORY && !HISTORY */
+#if defined (READLINE) && !defined (HISTORY)
+# define HISTORY
+#endif
+
/* The default value of the PATH variable. */
#define DEFAULT_PATH_VALUE \
- ":/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/etc"
+ "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:."
/* The value for PATH when invoking `command -p'. This is only used when
the Posix.2 confstr () function, or CS_PATH define are not present. */
#define STANDARD_UTILS_PATH \
- "/bin:/usr/bin:/usr/ucb:/usr/sbin:/etc:/usr/etc"
+ "/bin:/usr/bin:/usr/ucb:/usr/sbin:/sbin:/etc:/usr/etc:/usr/lib"
+
+/* Put system-specific default mail directories here. */
+#if defined (__bsdi__) || defined (__FreeBSD__) || defined (__NetBSD__)
+# define DEFAULT_MAIL_PATH "/var/mail/"
+#endif
+
+#if !defined (DEFAULT_MAIL_PATH)
+#if defined (USG)
+# define DEFAULT_MAIL_PATH "/usr/mail/"
+#else
+# define DEFAULT_MAIL_PATH "/usr/spool/mail/"
+#endif
+#endif
/* Define V9_ECHO if you want to give the echo builtin backslash-escape
interpretation using the -e option, in the style of the Bell Labs 9th
Index: cpp-Makefile
===================================================================
RCS file: /cvsroot/winbash/winbash/cpp-Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- cpp-Makefile 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ cpp-Makefile 10 Mar 2002 23:25:31 -0000 1.2
@@ -312,8 +312,8 @@
$(VARARGSH) $(STRCHR) $(STRCASE) $(DEVFD) \
-D$(Machine) -D$(OS)
LDFLAGS = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(PROFILE_FLAGS) $(CFLAGS)
-CCFLAGS = $(PROFILE_FLAGS) $(CFLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
- $(MALLOC_CFLAGS)
+CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
+ $(MALLOC_CFLAGS) $(CFLAGS)
CPPFLAGS= -I. -I$(srcdir) -I$(LIBSRC)
GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wwrite-strings -Werror -Wstrict-prototypes \
@@ -385,11 +385,9 @@
/**/# The type of machine and OS Bash is being compiled on.
HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)' -DOSTYPE='$(OS_NAME)'
-MAINTAIN_DEFINE = -DMAINTAINER='"bug...@pr..."'
-
/**/# The group of configuration flags. These are for shell.c
-CFG_FLAGS = -DOS_NAME='$(OS_NAME)' -DProgram=$(Program) \
- -DSYSTEM_NAME='$(SYSTEM_NAME)' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
+CFG_FLAGS = -DOS_NAME='$(OS_NAME)' -DSYSTEM_NAME='$(SYSTEM_NAME)' \
+ $(SIGLIST_FLAG)
/* **************************************************************** */
/* */
Index: execute_cmd.c
===================================================================
RCS file: /cvsroot/winbash/winbash/execute_cmd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- execute_cmd.c 10 Mar 2002 21:45:13 -0000 1.3
+++ execute_cmd.c 10 Mar 2002 23:25:31 -0000 1.4
@@ -3511,7 +3511,7 @@
/* We have to use access(2) to determine access because AFS does not
support Unix file system semantics. This may produce wrong
answers for non-AFS files when ruid != euid. I hate AFS. */
- if (access (name, X_OK))
+ if (access (name, X_OK) == 0)
return (FS_EXISTS | FS_EXECABLE);
else
return (FS_EXISTS);
Index: externs.h
===================================================================
RCS file: /cvsroot/winbash/winbash/externs.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- externs.h 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ externs.h 10 Mar 2002 23:25:31 -0000 1.2
@@ -57,6 +57,7 @@
extern void reset_mail_timer __P((void));
extern void reset_mail_files __P((void));
extern void free_mail_files __P((void));
+extern char *make_default_mailpath __P((void));
extern void remember_mail_dates __P((void));
extern void check_mail __P((void));
Index: flags.c
===================================================================
RCS file: /cvsroot/winbash/winbash/flags.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- flags.c 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ flags.c 10 Mar 2002 23:25:31 -0000 1.2
@@ -113,11 +113,11 @@
/* Non-zero means don't look up or remember command names in a hash table, */
int hashing_disabled = 0;
-#if defined (HISTORY)
+#if defined (BANG_HISTORY)
/* Non-zero means that we are doing history expansion. The default.
This means !22 gets the 22nd line of history. */
int history_expansion = 1;
-#endif /* HISTORY */
+#endif /* BANG_HISTORY */
/* Non-zero means that we allow comments to appear in interactive commands. */
#if defined (INTERACTIVE_COMMENTS)
@@ -179,10 +179,10 @@
{ 'P', &no_symbolic_links },
-#if defined (HISTORY)
+#if defined (BANG_HISTORY)
/* Once again, we don't have the right mnemonic. */
{ 'H', &history_expansion },
-#endif /* HISTORY */
+#endif /* BANG_HISTORY */
{0, (int *)NULL}
};
Index: flags.h
===================================================================
RCS file: /cvsroot/winbash/winbash/flags.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- flags.h 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ flags.h 10 Mar 2002 23:25:31 -0000 1.2
@@ -47,9 +47,9 @@
hashing_disabled, forced_interactive, privileged_mode,
asynchronous_notification, interactive_comments, no_symbolic_links;
-#if defined (HISTORY)
+#if defined (BANG_HISTORY)
extern int history_expansion;
-#endif /* HISTORY */
+#endif /* BANG_HISTORY */
#if defined (RESTRICTED_SHELL)
extern int restricted;
Index: general.c
===================================================================
RCS file: /cvsroot/winbash/winbash/general.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- general.c 9 Mar 2002 16:05:41 -0000 1.2
+++ general.c 10 Mar 2002 23:25:31 -0000 1.3
@@ -661,7 +661,7 @@
if (result[i + 1] == '/')
{
strcpy (result + i, result + i + 1);
- i = start;
+ i = (start < 0) ? 0 : start;
continue;
}
@@ -679,7 +679,7 @@
#endif
while (--start > -1 && result[start] != '/');
strcpy (result + start + 1, result + i + 2);
- i = start;
+ i = (start < 0) ? 0 : start;
continue;
}
}
Index: general.h
===================================================================
RCS file: /cvsroot/winbash/winbash/general.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- general.h 9 Mar 2002 16:05:41 -0000 1.2
+++ general.h 10 Mar 2002 23:25:31 -0000 1.3
@@ -23,6 +23,17 @@
#include "stdc.h"
+/* just to make sure */
+#if defined (HAVE_UNISTD_H)
+# ifdef CRAY
+# define word __word
+# endif
+# include <unistd.h>
+# ifdef CRAY
+# undef word
+# endif
+#endif
+
#if !defined (NULL)
# if defined (__STDC__)
# define NULL ((void *) 0)
Index: jobs.c
===================================================================
RCS file: /cvsroot/winbash/winbash/jobs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- jobs.c 10 Mar 2002 21:45:13 -0000 1.3
+++ jobs.c 10 Mar 2002 23:25:31 -0000 1.4
@@ -1496,31 +1496,23 @@
}
}
- /* XXX - the linux people say to check for JOBSTATE (job) == JSTOPPED */
if (child->running || ((job != NO_JOB) && (JOBSTATE (job) == JRUNNING)))
{
-#if defined (_POSIX_VERSION)
- struct sigaction act, oact;
-
- act.sa_handler = SIG_DFL;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
-
- sigaction (SIGCHLD, &act, &oact);
-#else
- SigHandler *ihandler;
-
- ihandler = set_signal_handler (SIGCHLD, SIG_DFL);
-#endif /* !_POSIX_VERSION */
-
- flush_child (0);
-
-#if defined (_POSIX_VERSION)
- sigaction (SIGCHLD, &oact, (struct sigaction *)NULL);
-#else
- set_signal_handler (SIGCHLD, ihandler);
-#endif /* !_POSIX_VERSION */
-
+#if defined (WAITPID_BROKEN) /* SCOv4 */
+ sigset_t suspend_set;
+ sigemptyset (&suspend_set);
+ sigsuspend (&suspend_set);
+#else /* !WAITPID_BROKEN */
+# if defined (MUST_UNBLOCK_CHILD) /* SCO */
+UNBLOCK_CHILD (oset);
+# endif
+ waiting_for_job = 1;
+ waitchld (0);
+ waiting_for_job = 0;
+# if defined (MUST_UNBLOCK_CHILD)
+ BLOCK_CHILD (set, oset);
+# endif
+#endif /* !WAITPID_BROKEN */
goto wait_loop;
}
@@ -2043,7 +2035,6 @@
{
WAIT status;
PROCESS *child;
- int any_tstped = 0;
pid_t pid;
int call_set_current = 0, last_stopped_job = NO_JOB;
int children_exited = 0, flag;
@@ -2052,7 +2043,7 @@
{
flag = WUNTRACED;
if (sigchld || s)
- flag |= WNOHANG;
+ flag |= WNOHANG;
pid = WAITPID (-1, &status, flag);
if (sigchld && (flag & WNOHANG))
sigchld--;
@@ -2177,7 +2168,7 @@
children_exited++;
}
}
- while (sig && pid > (pid_t)0);
+ while ((s || sigchld) && pid > (pid_t)0);
/* If a job was running and became stopped, then set the current
job. Otherwise, don't change a thing. */
Index: machines.h
===================================================================
RCS file: /cvsroot/winbash/winbash/machines.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- machines.h 9 Mar 2002 16:05:42 -0000 1.2
+++ machines.h 10 Mar 2002 23:25:31 -0000 1.3
@@ -280,6 +280,13 @@
# define MACHINE_CFLAGS -Wf,-XNl3072
# endif
# endif /* Irix5 */
+# if defined (Irix6)
+# define M_OS "Irix6"
+# if !defined (HAVE_GCC)
+# undef MACHINE_CFLAGS
+# define MACHINE_CFLAGS -mips2
+# endif /* !HAVE_GCC */
+# endif /* Irix6 */
# define M_MACHINE "sgi"
# define HAVE_GETGROUPS
# define VOID_SIGHANDLER
@@ -293,7 +300,7 @@
# else
# define ANSIC
# endif /* !__EXTENSIONS__ || __STDC__ */
-# if defined (Irix5)
+# if defined (Irix5) || defined (Irix6)
# define SGI_CFLAGS -DUSG -DPGRP_PIPE -DHAVE_BCOPY -DHAVE_GETPW_DECLS \
-DHAVE_SOCKETS -DNO_SBRK_DECL
# else
@@ -667,7 +674,7 @@
# define SYSDEP_LDFLAGS -Xp
# define ISC_POSIX -Xp
# endif
-# define ISC_SYSDEPS -DUSGr3 -DPGRP_PIPE -DHAVE_GETPW_DECLS -D_POSIX_SOURCE -DOPENDIR_NOT_ROBUST -DMEMMOVE_MISSING
+# define ISC_SYSDEPS -DUSGr3 -DPGRP_PIPE -DHAVE_GETPW_DECLS -D_POSIX_SOURCE -DOPENDIR_NOT_ROBUST -DMEMMOVE_MISSING -DWAITPID_BROKEN
# if defined (__STDC__)
# if defined (HAVE_GCC)
# define ISC_EXTRA -DO_NDELAY=O_NONBLOCK
@@ -725,9 +732,9 @@
# define M_OS "SCO"
# define SCO_CFLAGS -DUSG -DUSGr3 -DPGRP_PIPE
# if defined (SCOv4)
-# define SYSDEP_CFLAGS SCO_CFLAGS
+# define SYSDEP_CFLAGS SCO_CFLAGS -DWAITPID_BROKEN
# else /* !SCOv4 */
-# define SYSDEP_CFLAGS SCO_CFLAGS -DOPENDIR_NOT_ROBUST
+# define SYSDEP_CFLAGS SCO_CFLAGS -DOPENDIR_NOT_ROBUST -DMUST_UNBLOCK_CHILD
# endif /* !SCOv4 */
# define HAVE_VFPRINTF
# define VOID_SIGHANDLER
@@ -758,12 +765,17 @@
# define REQUIRED_LIBRARIES -lbsd
# endif /* OSF/1 */
-/* BSDI BSD/386 running on a 386 or 486. */
+/* BSDI BSD/OS running on a 386 or 486. */
# if !defined (done386) && defined (__bsdi__)
# define done386
# define M_MACHINE "i386"
-# define M_OS "BSD386"
-# define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DINT_GROUPS_ARRAY
+# if defined (BSDI2)
+# define M_OS "BSD_OS"
+# define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DRLIMTYPE=quad_t
+# else
+# define M_OS "BSD386"
+# define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DINT_GROUPS_ARRAY
+# endif
# define HAVE_SYS_SIGLIST
# define HAVE_SETLINEBUF
# define HAVE_GETGROUPS
@@ -854,7 +866,7 @@
# define done386
# define M_MACHINE "i386"
# define M_OS "Linux"
-# define SYSDEP_CFLAGS -DUSG -DUSGr3 -DHAVE_GETDTABLESIZE -DHAVE_BCOPY \
+# define SYSDEP_CFLAGS -DHAVE_GETDTABLESIZE -DHAVE_BCOPY \
-DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME
# define REQUIRED_LIBRARIES
# define HAVE_GETGROUPS
@@ -966,7 +978,7 @@
#if defined (m68k) && defined (sysV68)
# define M_MACHINE "Delta"
# define M_OS "USG"
-# define SYSDEP_CFLAGS -DUSGr3
+# define SYSDEP_CFLAGS -DUSGr3 -DMEMMOVE_MISSING
# define VOID_SIGHANDLER
# define HAVE_VFPRINTF
# define REQUIRED_LIBRARIES -lm881
@@ -1821,7 +1833,7 @@
# if defined (USGr4)
# define SYSDEP_CFLAGS -DUSGr4 -D_POSIX_JOB_CONTROL
# else
-# define SYSDEP_CFLAGS -D_POSIX_JOB_CONTROL
+# define SYSDEP_CFLAGS -D_POSIX_JOB_CONTROL -DWAITPID_BROKEN
# endif
# define HAVE_DIRENT
# define HAVE_VFPRINTF
@@ -2042,6 +2054,56 @@
# endif /* !HAVE_GCC */
# undef HAVE_GETWD
#endif /* Tandem running SVR3 */
+
+/* ****************** */
+/* */
+/* Amdahl UTS */
+/* */
+/* ****************** */
+
+#if defined (UTS)
+# define M_MACHINE "uts"
+# define M_OS "systemV"
+# define SYSDEP_CFLAGS -DUSG -DMEMMOVE_MISSING
+# define REQUIRED_LIBRARIES
+# undef HAVE_SYS_SIGLIST
+# undef HAVE_GETWD
+# undef HAVE_ALLOCA
+# define HAVE_VFPRINTF
+# define HAVE_DIRENT
+# undef HAVE_RESOURCE
+#endif /* UTS */
+
+/* ************************ */
+/* */
+/* Stratus i860 running FTX (jon...@sy... (Jonathan Stockley)) */
+/* */
+/* ************************ */
+/* Use 'make CPP_DEFINES=-D_FTX' to build as /usr/ccs/lib/cpp doesn't set
+ anything other than i860 which may be set on other i860 machines.
+ The C compiler, cc, sets _FTX & i860 but, unfortunately it barfs at stuff
+ in cpp-Makefile that has a # in it (it has it's own builtin cpp).
+*/
+#if defined(_FTX) && defined (i860) && !defined (M_MACHINE)
+#define M_MACHINE "Stratus_i860"
+#define M_OS "FTX"
+#define VOID_SIGHANDLER
+#define HAVE_POSIX_SIGNALS
+#define HAVE_VFPRINTF
+#define HAVE_SETVBUF
+#define REVERSED_SETVBUF_ARGS
+#define HAVE_STRCHR
+#define HAVE_STRERROR
+#define HAVE_GETGROUPS
+#define HAVE_DUP2
+#undef HAVE_ALLOCA
+#undef HAVE_GETWD
+#define HAVE_GETCWD
+#define HAVE_SYS_SIGLIST
+#define SYSDEP_CFLAGS -DHAVE_UID_T -Dsys_siglist=_sys_siglist -DUSGr4
+#define EXTRA_LIB_SEARCH_PATH /usr/ucblib
+#define REQUIRED_LIBRARIES -lc -lucb
+#endif /* _FTX */
/* ************************ */
/* */
Index: mailcheck.c
===================================================================
RCS file: /cvsroot/winbash/winbash/mailcheck.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- mailcheck.c 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ mailcheck.c 10 Mar 2002 23:25:31 -0000 1.2
@@ -229,13 +229,16 @@
return ((stat (file, &finfo) == 0) && (finfo.st_size > size));
}
-#if defined (USG)
-# define DEFAULT_MAIL_PATH "/usr/mail/"
-# define DEFAULT_PATH_LEN 10
-#else
-# define DEFAULT_MAIL_PATH "/usr/spool/mail/"
-# define DEFAULT_PATH_LEN 16
-#endif
+char *
+make_default_mailpath ()
+{
+ char *mp;
+
+ mp = xmalloc (1 + sizeof (DEFAULT_MAIL_PATH) + strlen (current_user.user_name));
+ strcpy (mp, DEFAULT_MAIL_PATH);
+ strcpy (mp + sizeof (DEFAULT_MAIL_PATH) - 1, current_user.user_name);
+ return (mp);
+}
/* Return the colon separated list of pathnames to check for mail. */
static char *
@@ -251,10 +254,7 @@
if (mailpaths)
return (savestring (mailpaths));
- mailpaths = xmalloc (1 + DEFAULT_PATH_LEN + strlen (current_user.user_name));
- strcpy (mailpaths, DEFAULT_MAIL_PATH);
- strcpy (mailpaths + DEFAULT_PATH_LEN, current_user.user_name);
- return (mailpaths);
+ return (make_default_mailpath ());
}
/* Take an element from $MAILPATH and return the portion from
@@ -291,10 +291,11 @@
void
remember_mail_dates ()
{
- char *mailpaths = get_mailpaths ();
+ char *mailpaths;
char *mailfile, *mp;
int i = 0;
-
+
+ mailpaths = get_mailpaths ();
while (mailfile = extract_colon_unit (mailpaths, &i))
{
mp = parse_mailpath_spec (mailfile);
Index: nojobs.c
===================================================================
RCS file: /cvsroot/winbash/winbash/nojobs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- nojobs.c 10 Mar 2002 21:45:13 -0000 1.2
+++ nojobs.c 10 Mar 2002 23:25:31 -0000 1.3
@@ -37,6 +37,7 @@
#include "jobs.h"
#include "execute_cmd.h"
#include "externs.h"
+#include "error.h"
#if defined (__NT_VC__)
# include <process.h>
Index: parse.y
===================================================================
RCS file: /cvsroot/winbash/winbash/parse.y,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- parse.y 10 Mar 2002 21:45:13 -0000 1.3
+++ parse.y 10 Mar 2002 23:25:31 -0000 1.4
@@ -1610,6 +1610,9 @@
bind_variable ("_", last_lastarg);
FREE (last_lastarg);
+
+ if (token_to_read == '\n')
+ token_to_read = 0;
}
/* Command to read_token () explaining what we want it to do. */
@@ -2469,14 +2472,19 @@
static void
reset_readline_prompt ()
{
- if (prompt_string_pointer && *prompt_string_pointer)
+ if (prompt_string_pointer)
{
char *temp_prompt;
- temp_prompt = decode_prompt_string (*prompt_string_pointer);
+ temp_prompt = *prompt_string_pointer
+ ? decode_prompt_string (*prompt_string_pointer)
+ : (char *)NULL;
- if (!temp_prompt)
- temp_prompt = savestring ("");
+ if (temp_prompt == 0)
+ {
+ temp_prompt = xmalloc (1);
+ temp_prompt[0] = '\0';
+ }
FREE (current_readline_prompt);
@@ -2533,10 +2541,15 @@
if (!prompt_string_pointer)
prompt_string_pointer = &ps1_prompt;
- if (*prompt_string_pointer)
- temp_prompt = decode_prompt_string (*prompt_string_pointer);
- else
- temp_prompt = savestring ("");
+ temp_prompt = (*prompt_string_pointer)
+ ? decode_prompt_string (*prompt_string_pointer)
+ : (char *)NULL;
+
+ if (temp_prompt == 0)
+ {
+ temp_prompt = xmalloc (1);
+ temp_prompt[0] = '\0';
+ }
current_prompt_string = *prompt_string_pointer;
prompt_string_pointer = &ps2_prompt;
@@ -2762,6 +2775,7 @@
temp = savestring (geteuid () == 0 ? "#" : "$");
goto add_string;
+#if defined (READLINE)
case '[':
case ']':
temp = xmalloc(3);
@@ -2769,6 +2783,7 @@
temp[1] = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE;
temp[2] = '\0';
goto add_string;
+#endif
case '\\':
temp = savestring ("\\");
Index: print_cmd.c
===================================================================
RCS file: /cvsroot/winbash/winbash/print_cmd.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- print_cmd.c 10 Mar 2002 21:45:13 -0000 1.2
+++ print_cmd.c 10 Mar 2002 23:25:31 -0000 1.3
@@ -664,7 +664,7 @@
char char_arg[2], *argp, *args[2];
int arg_len, c, arg_index;
- args[0] = arg1;
+ args[arg_index = 0] = arg1;
args[1] = arg2;
arg_len = strlen (format);
Index: shell.c
===================================================================
RCS file: /cvsroot/winbash/winbash/shell.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- shell.c 10 Mar 2002 21:45:13 -0000 1.4
+++ shell.c 10 Mar 2002 23:25:31 -0000 1.5
@@ -95,7 +95,7 @@
/* The current maintainer of the shell. You change this in the
Makefile. */
#if !defined (MAINTAINER)
-#define MAINTAINER "deliberately-anonymous"
+#define MAINTAINER "bas...@pr..."
#endif
char *the_current_maintainer = MAINTAINER;
@@ -511,7 +511,10 @@
else
{
#if defined (HISTORY)
- history_expansion = remember_on_history = 0;
+# if defined (BANG_HISTORY)
+ history_expansion = 0;
+# endif
+ remember_on_history = 0;
#endif /* HISTORY */
interactive_shell = startup_state = interactive = 0;
no_line_editing = 1;
@@ -740,7 +743,9 @@
if (!interactive_shell || (!isatty (fd)))
{
#if defined (HISTORY)
+# if defined (BANG_HISTORY)
history_expansion = 0;
+# endif
remember_on_history = 0;
#endif /* HISTORY */
interactive = interactive_shell = 0;
@@ -821,7 +826,7 @@
#endif /* PROCESS_SUBSTITUTION */
#if defined (HISTORY)
- if (interactive && remember_on_history)
+ if (interactive_shell)
maybe_save_shell_history ();
#endif /* HISTORY */
@@ -1078,8 +1083,9 @@
{
/* Some kind of throw to top_level has occured. */
case FORCE_EOF:
- case EXITPROG:
return last_command_exit_value = 127;
+ case EXITPROG:
+ return last_command_exit_value;
case DISCARD:
return last_command_exit_value = 1;
default:
@@ -1192,17 +1198,20 @@
indirection_level_string ()
{
register int i, j;
- char *ps4 = get_string_value ("PS4");
+ char *ps4;
- if (!ps4)
- ps4 = savestring ("+ ");
- else
- ps4 = decode_prompt_string (ps4);
+ indirection_string[0] = '\0';
+ ps4 = get_string_value ("PS4");
- for (i = 0; i < indirection_level && i < 99; i++)
+ if (ps4 == 0 || *ps4 == '\0')
+ return (indirection_string);
+
+ ps4 = decode_prompt_string (ps4);
+
+ for (i = 0; *ps4 && i < indirection_level && i < 99; i++)
indirection_string[i] = *ps4;
- for (j = 1; ps4[j] && i < 99; i++, j++)
+ for (j = 1; *ps4 && ps4[j] && i < 99; i++, j++)
indirection_string[i] = ps4[j];
indirection_string[i] = '\0';
@@ -1405,7 +1414,10 @@
debugging = do_version = line_number = last_command_exit_value = 0;
forced_interactive = interactive_shell = subshell_environment = 0;
#if defined (HISTORY)
- remember_on_history = history_expansion = 0;
+# if defined (BANG_HISTORY)
+ history_expansion = 0;
+# endif
+ remember_on_history = 0;
#endif /* HISTORY */
#if defined (RESTRICTED_SHELL)
@@ -1558,7 +1570,7 @@
run_interrupt_trap ();
#if defined (HISTORY)
- if (interactive && remember_on_history)
+ if (interactive_shell)
maybe_save_shell_history ();
#endif /* HISTORY */
@@ -1573,7 +1585,7 @@
#endif /* PROCESS_SUBSTITUTION */
run_exit_trap ();
- signal (sig, SIG_DFL);
+ set_signal_handler (sig, SIG_DFL);
kill (getpid (), sig);
#if !defined (VOID_SIGHANDLER)
@@ -1619,12 +1631,12 @@
for (i = 0; i < TERMSIGS_LENGTH; i++)
{
terminating_signals[i].orig_handler =
- signal (XSIG (i), termination_unwind_protect);
+ set_signal_handler (XSIG (i), termination_unwind_protect);
/* Don't do anything with signals that are ignored at shell entry
if the shell is not interactive. */
if (!interactive_shell && terminating_signals[i].orig_handler == SIG_IGN)
{
- signal (XSIG (i), SIG_IGN);
+ set_signal_handler (XSIG (i), SIG_IGN);
set_signal_ignored (XSIG (i));
}
}
@@ -1641,12 +1653,12 @@
#if defined (SIGQUIT)
/* And, some signals that are specifically ignored by the shell. */
- signal (SIGQUIT, SIG_IGN);
+ set_signal_handler (SIGQUIT, SIG_IGN);
if (interactive)
{
set_signal_handler (SIGINT, sigint_sighandler);
- signal (SIGTERM, SIG_IGN);
+ set_signal_handler (SIGTERM, SIG_IGN);
}
#endif /* SIGQUIT */
}
@@ -1677,7 +1689,7 @@
if (signal_is_trapped (XSIG (i)) || signal_is_special (XSIG (i)))
continue;
- signal (XSIG (i), XHANDLER (i));
+ set_signal_handler (XSIG (i), XHANDLER (i));
}
#endif
}
Index: siglist.h
===================================================================
RCS file: /cvsroot/winbash/winbash/siglist.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- siglist.h 9 Mar 2002 16:05:42 -0000 1.2
+++ siglist.h 10 Mar 2002 23:25:31 -0000 1.3
@@ -28,10 +28,10 @@
#endif /* Solaris || USGr4_2 || drs6000 || amiga || Minix */
#if !defined (Solaris) && !defined (Linux) && !defined (__BSD_4_4__) && \
- !defined (Minix) && !defined (NetBSD) && !defined (FreeBSD) && \
- !defined (__linux__)
+ !defined (Minix) && !defined (NetBSD) && !defined (FreeBSD) && \
+ !defined (BSD_OS)
extern char *sys_siglist[];
-#endif /* !Solaris && !Linux && !__BSD_4_4__ && !Minix && !NetBSD && !FreeBSD */
+#endif /* !Solaris && !Linux && !__BSD_4_4__ && !Minix && !NetBSD && !FreeBSD && !BSD_OS */
#if !defined (strsignal) && !defined (Solaris) && !defined (NetBSD)
# define strsignal(sig) (char *)sys_siglist[sig]
Index: stdc.h
===================================================================
RCS file: /cvsroot/winbash/winbash/stdc.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- stdc.h 9 Mar 2002 03:39:12 -0000 1.1.1.1
+++ stdc.h 10 Mar 2002 23:25:31 -0000 1.2
@@ -45,19 +45,33 @@
# endif
# define __STRING(x) "x"
-#if !defined (const)
-# if defined (__GNUC__) /* gcc with -traditional */
+#if defined (__GNUC__) /* gcc with -traditional */
+# if !defined (const)
# define const __const
+# endif
+# if !defined (inline)
# define inline __inline
+# endif
+# if !defined (signed)
# define signed __signed
+# endif
+# if !defined (volatile)
# define volatile __volatile
-# else /* !__GNUC__ */
+# endif
+#else /* !__GNUC__ */
+# if !defined (const)
# define const
+# endif
+# if !defined (inline)
# define inline
+# endif
+# if !defined (signed)
# define signed
+# endif
+# if !defined (volatile)
# define volatile
-# endif /* !__GNUC__ */
-#endif /* !const */
+# endif
+#endif /* !__GNUC__ */
#endif /* !__STDC__ */
Index: subst.c
===================================================================
RCS file: /cvsroot/winbash/winbash/subst.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- subst.c 10 Mar 2002 21:45:13 -0000 1.3
+++ subst.c 10 Mar 2002 23:25:31 -0000 1.4
@@ -2438,7 +2438,7 @@
SHELL_VAR *var = find_variable (name);
if (var && !invisible_p (var) && (temp = value_cell (var)))
- temp = quote_escapes (temp);
+ temp = quote_escapes (temp);
}
return (temp);
}
@@ -2453,6 +2453,7 @@
{
WORD_LIST *l;
char *t, *t1, *temp;
+ int i;
if (value[0] == '~' ||
(strchr (value, '~') && unquoted_substring ("=~", value)))
@@ -2460,7 +2461,15 @@
else
temp = savestring (value);
- l = *temp ? expand_string_internal (temp, 0) : (WORD_LIST *)NULL;
+ /* This is a hack. A better fix is coming later. */
+ if (*temp == '"')
+ {
+ i = 1;
+ t = string_extract_double_quoted (temp, &i); /* XXX */
+ free (temp);
+ temp = t;
+ }
+ l = *temp ? expand_string_internal (temp, quoted) : (WORD_LIST *)NULL;
free (temp);
if (l)
@@ -2690,6 +2699,7 @@
int old_index;
if (string[++sindex] != '(' || quoted || posixly_correct)
+ temp = (char *)NULL;
{
sindex--;
goto add_character;
@@ -2742,10 +2752,17 @@
case '7':
case '8':
case '9':
- if (dollar_vars[digit_value (c)])
- temp = savestring (dollar_vars[digit_value (c)]);
- else
- temp = (char *) NULL;
+ temp = dollar_vars[digit_value (c)];
+ if (unbound_vars_is_error && temp == (char *)NULL)
+ {
+ report_error ("$%c: unbound variable", c);
+ free (string);
+ free (istring);
+ last_command_exit_value = 1;
+ return (&expand_word_error);
+ }
+ if (temp)
+ temp = savestring (temp);
goto dollar_add_string;
/* $$ -- pid of the invoking shell. */
@@ -3577,72 +3594,51 @@
int quoted;
{
char *r, *result_string, *temp, *temp1;
- int sindex, tindex, c;
+ int sindex, tindex, c, dquote;
/* The result can be no longer than the original string. */
r = result_string = xmalloc (strlen (string) + 1);
- sindex = 0;
- for (;;)
+ for (sindex = dquote = 0; c = string[sindex];)
{
- c = string[sindex];
- if (c == '\0')
- break;
-
switch (c)
- {
- case '\\':
- c = string[++sindex];
- if (quoted && !member (c, slashify_in_quotes))
- {
- *r++ = '\\';
- *r++ = c;
- }
- else
- *r++ = c;
-
- sindex++;
- break;
-
- case '"':
- tindex = ++sindex;
- temp = string_extract_double_quoted (string, &tindex);
- sindex = tindex;
-
- if (temp)
- {
- strcpy (r, temp);
- r += strlen (r);
- free (temp);
- }
- break;
-
- case '\'':
- if (quoted)
+ {
+ case '\\':
+ c = string[++sindex];
+ if ((quoted || dquote) && !member (c, slashify_in_quotes))
+ *r++ = '\\';
+
+ default:
+ *r++ = c;
+ sindex++;
+ break;
+
+ case '\'':
+ if (quoted || dquote)
{
*r++ = c;
sindex++;
}
- else
- {
- tindex = ++sindex;
- temp = string_extract_single_quoted (string, &tindex);
- sindex = tindex;
-
- if (temp)
- {
- strcpy (r, temp);
- r += strlen (r);
- free (temp);
- }
- }
- break;
-
- default:
- *r++ = c;
- sindex++;
- break;
- }
+ else
+ {
+ tindex = ++sindex;
+ temp = string_extract_single_quoted (string, &tindex);
+ sindex = tindex;
+
+ if (temp)
+ {
+ strcpy (r, temp);
+ r += strlen (r);
+ free (temp);
+ }
+ }
+ break;
+
+ case '"':
+ dquote = 1 - dquote;
+ sindex++;
+ break;
+ }
}
*r = '\0';
return (result_string);
@@ -4426,8 +4422,11 @@
#endif
#if defined (HISTORY)
-void sv_histsize (), sv_histfilesize (), sv_histchars (), sv_history_control (),
- sv_command_oriented_history ();
+void sv_histsize (), sv_histfilesize (),
+ sv_history_control (), sv_command_oriented_history ();
+# if defined (BANG_HISTORY)
+void sv_histchars ();
+# endif
#endif /* HISTORY */
#if defined (GETOPTS_BUILTIN)
@@ -4440,144 +4439,57 @@
#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0
-struct name_and_function
- {
- char *name;
- VFunction *function;
- }
-special_vars[] =
-{
- {
- "PATH", sv_path
- }
- ,
- {
- "MAIL", sv_mail
- }
- ,
- {
- "MAILPATH", sv_mail
- }
- ,
- {
- "MAILCHECK", sv_mail
- }
- ,
+struct name_and_function {
+ char *name;
+ VFunction *function;
+} special_vars[] = {
+ { "PATH", sv_path },
+ { "MAIL", sv_mail },
+ { "MAILPATH", sv_mail },
+ { "MAILCHECK", sv_mail },
- {
- "POSIXLY_CORRECT", sv_strict_posix
- }
- ,
- {
- "POSIX_PEDANTIC", sv_strict_posix
- }
- ,
+ { "POSIXLY_CORRECT", sv_strict_posix },
+ { "POSIX_PEDANTIC", sv_strict_posix },
/* Variables which only do something special when READLINE is defined. */
#if defined (READLINE)
- {
- "TERM", sv_terminal
- }
- ,
- {
- "TERMCAP", sv_terminal
- }
- ,
- {
- "TERMINFO", sv_terminal
- }
- ,
- {
- "hostname_completion_file", sv_hostname_completion_file
- }
- ,
- {
- "HOSTFILE", sv_hostname_completion_file
- }
- ,
+ { "TERM", sv_terminal },
+ { "TERMCAP", sv_terminal },
+ { "TERMINFO", sv_terminal },
+ { "hostname_completion_file", sv_hostname_completion_file },
+ { "HOSTFILE", sv_hostname_completion_file },
#endif /* READLINE */
/* Variables which only do something special when HISTORY is defined. */
#if defined (HISTORY)
- {
- "HISTSIZE", sv_histsize
- }
- ,
- {
- "HISTFILESIZE", sv_histfilesize
- }
- ,
- {
- "command_oriented_history", sv_command_oriented_history
- }
- ,
- {
- "histchars", sv_histchars
- }
- ,
- {
- "history_control", sv_history_control
- }
- ,
- {
- "HISTCONTROL", sv_history_control
- }
- ,
+ { "HISTSIZE", sv_histsize },
+ { "HISTFILESIZE", sv_histfilesize },
+ { "command_oriented_history", sv_command_oriented_history },
+# if defined (BANG_HISTORY)
+ { "histchars", sv_histchars },
+# endif
+ { "history_control", sv_history_control },
+ { "HISTCONTROL", sv_history_control },
#endif /* HISTORY */
- {
- "EUID", sv_uids
- }
- ,
- {
- "UID", sv_uids
- }
- ,
- {
- "IGNOREEOF", sv_ignoreeof
- }
- ,
- {
- "ignoreeof", sv_ignoreeof
- }
- ,
+ { "EUID", sv_uids},
+ { "UID", sv_uids},
+ { "IGNOREEOF", sv_ignoreeof },
+ { "ignoreeof", sv_ignoreeof },
#if defined (GETOPTS_BUILTIN)
- {
- "OPTIND", sv_optind
- }
- ,
- {
- "OPTERR", sv_opterr
- }
- ,
+ { "OPTIND", sv_optind },
+ { "OPTERR", sv_opterr },
#endif /* GETOPTS_BUILTIN */
#if defined (JOB_CONTROL)
- {
- "notify", sv_notify
- }
- ,
-#endif /* JOB_CONTROL */
+ { "notify", sv_notify },
+#endif /* JOB_CONTROL */
- {
- "glob_dot_filenames", sv_glob_dot_filenames
- }
- ,
- {
- "allow_null_glob_expansion", sv_allow_null_glob_expansion
- }
- ,
- {
- "noclobber", sv_noclobber
- }
- ,
- {
- "nolinks", sv_nolinks
- }
- ,
- {
- (char *) 0x00, (VFunction *) 0x00
- }
+ { "glob_dot_filenames", sv_glob_dot_filenames },
+ { "allow_null_glob_expansion", sv_allow_null_glob_expansion },
+ { "noclobber", sv_noclobber },
+ { "nolinks", sv_nolinks },
+ { (char *)0x00, (VFunction *)0x00 }
};
/* The variable in NAME has just had its state changed. Check to see if it
@@ -4732,6 +4644,7 @@
SET_INT_VAR (name, command_oriented_history);
}
+# if defined (BANG_HISTORY)
/* Setting/unsetting of the history expansion character. */
void
@@ -4757,6 +4670,7 @@
history_comment_char = '#';
}
}
+# endif /* BANG_HISTORY */
#endif /* HISTORY */
void
Index: trap.c
===================================================================
RCS file: /cvsroot/winbash/winbash/trap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- trap.c 10 Mar 2002 21:45:13 -0000 1.3
+++ trap.c 10 Mar 2002 23:25:31 -0000 1.4
@@ -89,8 +89,8 @@
/* Show which signals are treated specially by the shell. */
#if defined (SIGCHLD)
- original_signals[SIGCHLD] = (SigHandler *) signal (SIGCHLD, SIG_DFL);
- signal (SIGCHLD, original_signals[SIGCHLD]);
+ original_signals[SIGCHLD] = (SigHandler *) set_signal_handler (SIGCHLD, SIG_DFL);
+ set_signal_handler (SIGCHLD, original_signals[SIGCHLD]);
sigmodes[SIGCHLD] |= (SIG_SPECIAL | SIG_NO_TRAP);
#endif /* SIGCHLD */
@@ -112,8 +112,8 @@
if (interactive)
{
- original_signals[SIGTERM] = (SigHandler *)signal (SIGTERM, SIG_DFL);
- signal (SIGTERM, original_signals[SIGTERM]);
+ original_signals[SIGTERM] = (SigHandler *)set_signal_handler (SIGTERM, SIG_DFL);
+ set_signal_handler (SIGTERM, original_signals[SIGTERM]);
sigmodes[SIGTERM] |= SIG_SPECIAL;
}
}
@@ -232,7 +232,7 @@
else
{
#if defined (USG) && !defined (HAVE_BSD_SIGNALS) && !defined (_POSIX_VERSION)
- signal (sig, trap_handler);
+ set_signal_handler (sig, trap_handler);
#endif /* USG && !HAVE_BSD_SIGNALS && !_POSIX_VERSION */
catch_flag = 1;
@@ -323,7 +323,7 @@
/* If we aren't sure of the original value, check it. */
if (original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER)
{
- original_signals[sig] = (SigHandler *)signal (sig, SIG_DFL);
+ original_signals[sig] = (SigHandler *)set_signal_handler (sig, SIG_DFL);
set_signal_handler (sig, original_signals[sig]);
}
@@ -392,7 +392,7 @@
{
original_signals[sig] =
(SigHandler *) set_signal_handler (sig, SIG_DFL);
- signal (sig, original_signals[sig]);
+ set_signal_handler (sig, original_signals[sig]);
/* Signals ignored on entry to the shell cannot be trapped. */
if (original_signals[sig] == SIG_IGN)
@@ -457,7 +457,7 @@
/* Only change the signal handler for SIG if it allows it. */
if (!(sigmodes[sig] & SIG_NO_TRAP))
- signal (sig, SIG_IGN);
+ set_signal_handler (sig, SIG_IGN);
/* Change the trap command in either case. */
change_signal (sig, (char *)IGNORE_SIG);
@@ -511,11 +511,7 @@
for (i = 0; i < NSIG; i++)
{
- if ((sigmodes[i] & SIG_TRAPPED) && trap_list[i] &&
- (trap_list[i] != (char *)IGNORE_SIG) &&
- (trap_list[i] != (char *)DEFAULT_SIG) &&
- (trap_list[i] != (char *)IMPOSSIBLE_TRAP_HANDLER))
- free (trap_list[i]);
+ free_trap_command (i);
trap_list[i] = (char *)DEFAULT_SIG;
sigmodes[i] &= ~SIG_TRAPPED;
}
@@ -526,7 +522,7 @@
reset_signal (sig)
int sig;
{
- signal (sig, original_signals[sig]);
+ set_signal_handler (sig, original_signals[sig]);
}
/* Reset the handlers for all trapped signals to the values they had when
@@ -536,6 +532,13 @@
{
register int i;
+ if (sigmodes[0] & SIG_TRAPPED)
+ {
+ free_trap_command (0);
+ trap_list[0] = (char *)NULL;
+ sigmodes[0] &= ~SIG_TRAPPED;
+ }
+
for (i = 1; i < NSIG; i++)
{
if (sigmodes[i] & SIG_SPECIAL)
@@ -543,7 +546,7 @@
else if (sigmodes[i] & SIG_TRAPPED)
{
if (trap_list[i] == (char *)IGNORE_SIG)
- signal (i, SIG_IGN);
+ set_signal_handler (i, SIG_IGN);
else
reset_signal (i);
}
@@ -559,6 +562,14 @@
register int i;
reset_terminating_signals (); /* in shell.c */
+
+ if (sigmodes[0] & SIG_TRAPPED)
+ {
+ free_trap_command (0);
+ trap_list[0] = (char *)NULL;
+ sigmodes[0] &= ~SIG_TRAPPED;
+ }
+
for (i = 1; i < NSIG; i++)
{
if (sigmodes[i] & SIG_SPECIAL)
@@ -566,7 +577,7 @@
else if (sigmodes[i] & SIG_TRAPPED)
{
if (trap_list[i] == (char *)IGNORE_SIG)
- signal (i, SIG_IGN);
+ set_signal_handler (i, SIG_IGN);
else
restore_signal (i);
}
Index: variables.c
===================================================================
RCS file: /cvsroot/winbash/winbash/variables.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- variables.c 10 Mar 2002 21:45:13 -0000 1.3
+++ variables.c 10 Mar 2002 23:25:31 -0000 1.4
@@ -92,12 +92,6 @@
/* The list of variables that may not be unset in this shell. */
char **non_unsettable_vars = (char **)NULL;
-#if defined (USG)
-#define DEFAULT_MAIL_PATH "/usr/mail/"
-#else
-#define DEFAULT_MAIL_PATH "/usr/spool/mail/"
-#endif
-
static char *have_local_variables; /* XXX */
static int local_variable_stack_size = 0; /* XXX */
@@ -289,6 +283,7 @@
set_if_not ("PS1", primary_prompt);
set_if_not ("PS2", secondary_prompt);
}
+ set_if_not ("PS4", "+ ");
#if defined (INSECURITY)
set_if_not ("IFS", " \t\n");
@@ -304,25 +299,9 @@
set_auto_export (temp_var);
#endif
- /* Default MAILPATH, and MAILCHECK for interactive shells. */
+ /* Default MAILCHECK for interactive shells. */
if (interactive_shell)
- {
- set_if_not ("MAILCHECK", "60");
-
- if ((get_string_value ("MAIL") == (char *)NULL) &&
- (get_string_value ("MAILPATH") == (char *)NULL))
- {
- char *tem;
-
- tem = xmalloc (1 + sizeof (DEFAULT_MAIL_PATH)
- + strlen (current_user.user_name));
- strcpy (tem, DEFAULT_MAIL_PATH);
- strcat (tem, current_user.user_name);
-
- bind_variable ("MAILPATH", tem);
- free (tem);
- }
- }
+ set_if_not ("MAILCHECK", "60");
/* Do some things with shell level. */
temp_var = set_if_not ("SHLVL", "0");
@@ -408,7 +387,6 @@
/* Make a variable called BASH, which is the name of THIS shell. */
temp_var = bind_variable ("BASH", name);
- temp_var->attributes |= att_exported;
free (name);
}
Index: version.h
===================================================================
RCS file: /cvsroot/winbash/winbash/version.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- version.h 10 Mar 2002 20:33:03 -0000 1.4
+++ version.h 10 Mar 2002 23:25:31 -0000 1.5
@@ -5,12 +5,12 @@
#define DISTVERSION "1.14"
/* The patch level of this version of the shell. */
-#define PATCHLEVEL 3
+#define PATCHLEVEL 4
/* The last built version of this shell. */
-#define BUILDVERSION 2
+#define BUILDVERSION 3
/* A version string for use by sccs and the what command. */
-#define SCCSVERSION "@(#)Bash version 1.14.3(2) GNU"
+#define SCCSVERSION "@(#)Bash version 1.14.4(3) GNU"
|