Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bash 0.99 fixes & improvements

192 views
Skip to first unread message

The Dark Notes

unread,
Jun 12, 1989, 10:18:49 AM6/12/89
to

Here is a shar file with a bunch of patches for bash, version 0.99 and a
README.CWRU file explaining them. It has both bug fixes and some more
features from ksh.

One thing: I was the one that originally did the V9_ECHO stuff, but what's
in vanilla bash 0.99 is not a Ninth Edition-style echo. The Ninth Edition
has a flag (-e) to turn on backslash escape interpretation; it is not
enabled by default. The stuff I sent to Brian had this flag, but he took
it out -- I believe that POSIX has specified it the way vanilla bash 0.99
has it. I think we should all be migrating towards Ninth Edition behavior
on this, so these diffs put the flag back. Those of you who want echo to
do escape interpretation by default should read the articles Chris Torek
has posted on the subject.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting test in a file
# 3. Execute the file with /bin/sh (not csh) to create the files:
#
# README.CWRU
# diffs.0.99
#
# Created by chet (Chet Ramey) on Mon Jun 12 10:10:25 EDT 1989
#
if test -f 'README.CWRU'
then
echo shar: will not over-write existing file "'README.CWRU'"
else
echo extracting "'README.CWRU'"
sed 's/^X//' >README.CWRU <<'SHAR_EOF'
X
XHere's a description of the changes made to version 0.99 of bash at CWRU:
X
X1. Added a ksh-like TMOUT variable, which, when set to a value greater than
X 0, will exit the shell after that many seconds have passed with no input
X read after a prompt is printed. Setting it to 0 cancels the whole thing.
X
X2. Added a tcsh-like HOST variable. We're getting the information, so why
X not publish it?
X
X3. V9_ECHO is not a real V9 echo. It might be a POSIX echo; I don't have the
X POSIX spec. In Version 9, echo(1) has a -e flag to enable escape
X interpretation. I put that back.
X
X4. Various cleanups to get it through all the compilers out there (Ultrix 3.0
X cc, Sun 3.5 cc, gcc 1.35, IBM RT hc 2.1, IBM RT pcc, and so on).
X
X5. Added arrow key support to readline, mostly for xterm. It's introduced
X by M-O (or M-[), the arrow key prefix. The up-down arrows move you through
X the history list, the left-right arrows move along the current input line.
X
X6. Added a ksh-like PPID variable; it holds the parent pid of the shell.
X
X7. Doing 59 dup2's in jobs.c to initialize the terminal seemed like a little
X bit of overkill, so the code now dup2's to an fd returned by
X getdtablesize(), if SYSV is not defined. Seems to work.
X
X8. Changed the stub SYSV and SONY routines at the end of general.c to be
X defines at the end of shell.h.
X
X9. Added three new options to the test builtin, inspired by Arnold Robbins'
X shell and the PD ksh:
X -S file is a Unix domain socket
X -O file is owned by the same effective UID
X -G file is owned by the same effective GID
X
X
X
X Stuff for later
X
X1. S5r3 (and ksh-88)-like getopts builtin, using either the getopt code
X placed into the public domain by AT&T or the gnu getopt released with
X gawk 2.10.
X
X
X
X
SHAR_EOF
if test 1789 -ne "`wc -c < 'README.CWRU'`"
then
echo shar: error transmitting "'README.CWRU'" '(should have been 1789 characters)'
fi
fi
if test -f 'diffs.0.99'
then
echo shar: will not over-write existing file "'diffs.0.99'"
else
echo extracting "'diffs.0.99'"
sed 's/^X//' >diffs.0.99 <<'SHAR_EOF'
Xdiff -rc2 bash-0.99/Makefile src-0.99/Makefile
XCommon subdirectories: bash-0.99/alloc-files and src-0.99/alloc-files
Xdiff -rc2 bash-0.99/builtins.c src-0.99/builtins.c
X*** bash-0.99/builtins.c Sat Jun 3 14:32:24 1989
X--- src-0.99/builtins.c Thu Jun 8 16:47:44 1989
X***************
X*** 361,371 ****
X { "type", type_builtin, 1, "type [-type | -path] [name ...]",
X " For each NAME, indicate how it would be interpreted if used as a\n\
X! command name.
X!
X If the -type flag is used, returns a single word which is one of\n\
X `alias', `function', `builtin', `file' or `', if NAME is an\n\
X alias, shell function, shell builtin, disk file, or unfound,\n\
X! respectively.
X!
X If the -path flag is used, either returns the name of the disk file\n\
X that would be exec'ed, or nothing if -type wouldn't return `file'" },
X--- 361,371 ----
X { "type", type_builtin, 1, "type [-type | -path] [name ...]",
X " For each NAME, indicate how it would be interpreted if used as a\n\
X! command name.\n\
X! \n\
X If the -type flag is used, returns a single word which is one of\n\
X `alias', `function', `builtin', `file' or `', if NAME is an\n\
X alias, shell function, shell builtin, disk file, or unfound,\n\
X! respectively.\n\
X! \n\
X If the -path flag is used, either returns the name of the disk file\n\
X that would be exec'ed, or nothing if -type wouldn't return `file'" },
X***************
X*** 561,565 ****
X int tt; /* Temporary result. */
X char *string; /* String to execute. */
X- COMMAND *command; /* Parsed command tree. */
X register char *filename = list->word->word;
X struct stat finfo;
X--- 561,564 ----
X***************
X*** 590,595 ****
X char *string;
X {
X! #ifndef NOJOBS
X! /* #ifdef NEVER */
X extern int job_control;
X int old_job_control = job_control;
X--- 589,594 ----
X char *string;
X {
X! /*#ifndef NOJOBS */
X! #ifdef NEVER
X extern int job_control;
X int old_job_control = job_control;
X***************
X*** 720,724 ****
X--- 719,728 ----
X of the absolute directory. The shell variable `nolinks' controls this
X flag. */
X+
X+ #ifdef SYSV
X+ int follow_symbolic_links = 0;
X+ #else
X int follow_symbolic_links = 1;
X+ #endif
X
X cd_builtin (list)
X***************
X*** 832,836 ****
X extern char *the_current_working_directory;
X char *get_working_directory (), *make_absolute ();
X! char *t, *t1;
X
X if (follow_symbolic_links)
X--- 836,840 ----
X extern char *the_current_working_directory;
X char *get_working_directory (), *make_absolute ();
X! char *t;
X
X if (follow_symbolic_links)
X***************
X*** 915,919 ****
X
X /* Print the words in LIST to standard output. If the first word is
X! `-n', then don't print a trailing newline. */
X echo_builtin (list)
X WORD_LIST *list;
X--- 919,924 ----
X
X /* Print the words in LIST to standard output. If the first word is
X! `-n', then don't print a trailing newline. Re-added -e to make
X! V9_ECHO a real V9-style echo */
X echo_builtin (list)
X WORD_LIST *list;
X***************
X*** 920,930 ****
X {
X int display_return = 1;
X
X if (list)
X {
X! while (strcmp (list->word->word, "-n") == 0)
X {
X list = list->next;
X- display_return = 0;
X }
X }
X--- 925,943 ----
X {
X int display_return = 1;
X+ #ifdef V9_ECHO
X+ int interp_escapes = 0;
X+ #endif
X
X if (list)
X {
X! while (*list->word->word == '-')
X {
X+ if (list->word->word[1] == 'n')
X+ display_return = 0;
X+ #ifdef V9_ECHO
X+ else if (list->word->word[1] == 'e')
X+ interp_escapes = 1;
X+ #endif
X list = list->next;
X }
X }
X***************
X*** 940,944 ****
X while (c = *s++)
X {
X! if (c == '\\')
X {
X switch (c = *s++)
X--- 953,957 ----
X while (c = *s++)
X {
X! if (interp_escapes && c == '\\')
X {
X switch (c = *s++)
X***************
X*** 954,960 ****
X case '4': case '5': case '6': case '7':
X c -= '0';
X! if (*s >= 0 && *s <= '7')
X c = c * 8 + (*s++ - '0');
X! if (*s >= 0 && *s <= '7')
X c = c * 8 + (*s++ - '0');
X break;
X--- 967,973 ----
X case '4': case '5': case '6': case '7':
X c -= '0';
X! if (*s >= '0' && *s <= '7')
X c = c * 8 + (*s++ - '0');
X! if (*s >= '0' && *s <= '7')
X c = c * 8 + (*s++ - '0');
X break;
X***************
X*** 981,988 ****
X /* Parse the string that these words make, and execute the command found. */
X eval_builtin (list)
X {
X- char *string; /* String to execute. */
X- COMMAND *command; /* Parsed command tree. */
X-
X char *string_list ();
X
X--- 994,999 ----
X /* Parse the string that these words make, and execute the command found. */
X eval_builtin (list)
X+ WORD_LIST *list;
X {
X char *string_list ();
X
X***************
X*** 1135,1139 ****
X {
X register SHELL_VAR *var;
X- register char *name;
X int assign, undo = 0;
X extern int array_needs_making;
X--- 1146,1149 ----
X***************
X*** 1525,1529 ****
X char *input_string = (char *)xmalloc (5000);
X WORD_LIST *words, *list_string ();
X- char *ifs_chars = get_string_value ("IFS");
X
X
X--- 1535,1538 ----
X***************
X*** 1728,1731 ****
X--- 1737,1741 ----
X the name of the command which is checking. */
X no_args (command, list)
X+ char *command;
X WORD_LIST *list;
X {
X***************
X*** 2739,2743 ****
X register int i;
X int which = 0;
X- char *get_working_directory (), *new_dir;
X
X if (list)
X--- 2749,2752 ----
X***************
X*** 2956,2960 ****
X WORD_LIST *list;
X {
X! register char c, *word;
X int job = NO_JOB;
X int substring = 0;
X--- 2965,2969 ----
X WORD_LIST *list;
X {
X! register char *word;
X int job = NO_JOB;
X int substring = 0;
XCommon subdirectories: bash-0.99/documentation and src-0.99/documentation
Xdiff -rc2 bash-0.99/emacs_keymap.c src-0.99/emacs_keymap.c
X*** bash-0.99/emacs_keymap.c Tue Apr 4 14:03:22 1989
X--- src-0.99/emacs_keymap.c Thu Jun 8 13:10:22 1989
X***************
X*** 23,27 ****
X--- 23,31 ----
X rl_forward, /* Control-f */
X rl_abort, /* Control-g */
X+ #if defined(ibm032)
X+ rl_rubout, /* Control-h */
X+ #else
X rl_backward, /* Control-h */
X+ #endif
X rl_complete, /* Control-i */
X rl_newline, /* Control-j */
X***************
X*** 254,258 ****
X (Function *)0x0, /* Meta-M */
X (Function *)0x0, /* Meta-N */
X! (Function *)0x0, /* Meta-O */
X (Function *)0x0, /* Meta-P */
X (Function *)0x0, /* Meta-Q */
X--- 258,262 ----
X (Function *)0x0, /* Meta-M */
X (Function *)0x0, /* Meta-N */
X! rl_arrow_keys, /* Meta-O */
X (Function *)0x0, /* Meta-P */
X (Function *)0x0, /* Meta-Q */
X***************
X*** 268,272 ****
X
X /* Some more punctuation. */
X! (Function *)0x0, /* Meta-[ */
X (Function *)0x0, /* Meta-\ */
X (Function *)0x0, /* Meta-] */
X--- 272,276 ----
X
X /* Some more punctuation. */
X! rl_arrow_keys, /* Meta-[ */
X (Function *)0x0, /* Meta-\ */
X (Function *)0x0, /* Meta-] */
Xdiff -rc2 bash-0.99/execute_cmd.c src-0.99/execute_cmd.c
X*** bash-0.99/execute_cmd.c Sat May 27 18:39:22 1989
X--- src-0.99/execute_cmd.c Thu Jun 8 13:11:51 1989
X***************
X*** 684,689 ****
X if (errno != ENOEXEC)
X {
X- int error_no = errno;
X-
X if ((stat (command, &finfo) == 0) &&
X (finfo.st_mode & S_IFDIR))
X--- 684,687 ----
Xdiff -rc2 bash-0.99/funmap.c src-0.99/funmap.c
X*** bash-0.99/funmap.c Tue Apr 4 14:03:22 1989
X--- src-0.99/funmap.c Thu Jun 8 13:12:27 1989
X***************
X*** 15,18 ****
X--- 15,19 ----
X
X FUNMAP funmap[] = {
X+ {"arrow-key-prefix", rl_arrow_keys},
X {"beginning-of-line", rl_beg_of_line},
X {"backward-char", rl_backward},
Xdiff -rc2 bash-0.99/general.c src-0.99/general.c
X*** bash-0.99/general.c Wed May 24 21:16:07 1989
X--- src-0.99/general.c Thu Jun 8 13:13:39 1989
X***************
X*** 11,15 ****
X--- 11,19 ----
X
X #include "shell.h"
X+ #ifdef SYSV
X+ #include <string.h>
X+ #else
X #include <strings.h>
X+ #endif
X
X #ifndef NULL
X***************
X*** 325,349 ****
X }
X
X- #if defined SONY || defined VAX
X- #include <strings.h>
X-
X- char *
X- strchr (s, c)
X- char *s;
X- int c;
X- {
X- return (index (s, c));
X- }
X-
X- #endif /* SONY */
X-
X #ifdef SYSV
X extern int errno;
X #include <sys/errno.h>
X-
X- bcopy(s,d,n) char *d,*s; { while(n--) *d++ = *s++; }
X- char *getwd(s) char *s; { getcwd(s,MAXPATHLEN); return s; }
X- char *index(s,c) char *s; { char *strchr(); return strchr(s,c); }
X- char *rindex(s,c) char *s; { char *strrchr(); return strrchr(s,c); }
X
X int
X--- 329,335 ----
Xdiff -rc2 bash-0.99/general.h src-0.99/general.h
X*** bash-0.99/general.h Mon May 22 14:38:13 1989
X--- src-0.99/general.h Thu Jun 8 13:53:09 1989
X***************
X*** 36,40 ****
X
X /* The output of `signal' is different on different systems. Yechh. */
X! #if defined(SUNOS4) || defined (NeXT)
X #define sighandler void
X #else
X--- 36,40 ----
X
X /* The output of `signal' is different on different systems. Yechh. */
X! #if defined(SUNOS4) || defined (NeXT) || defined(ultrix)
X #define sighandler void
X #else
Xdiff -rc2 bash-0.99/history.c src-0.99/history.c
X*** bash-0.99/history.c Wed May 17 17:00:03 1989
X--- src-0.99/history.c Thu Jun 8 13:16:42 1989
X***************
X*** 356,360 ****
X line[i] = '\0';
X if (line[0])
X! add_history (line, (char *)NULL);
X }
X free (line);
X--- 356,360 ----
X line[i] = '\0';
X if (line[0])
X! add_history (line);
X }
X free (line);
X***************
X*** 613,617 ****
X register int j, l = strlen (string);
X int i, word_spec_error = 0;
X! int index, cc, modified = 0;
X char *word_spec, *event;
X int starting_index, only_printing = 0;
X--- 613,617 ----
X register int j, l = strlen (string);
X int i, word_spec_error = 0;
X! int cc, modified = 0;
X char *word_spec, *event;
X int starting_index, only_printing = 0;
X***************
X*** 1228,1232 ****
X continue;
X
X! add_history (line, (char *)0);
X }
X
X--- 1228,1232 ----
X continue;
X
X! add_history (line);
X }
X
Xdiff -rc2 bash-0.99/jobs.c src-0.99/jobs.c
X*** bash-0.99/jobs.c Wed May 10 18:59:43 1989
X--- src-0.99/jobs.c Thu Jun 8 13:20:20 1989
X***************
X*** 1113,1117 ****
X extern char *sys_siglist[];
X register int job, termsig;
X- register PROCESS *p;
X char *dir = (char *)get_string_value ("PWD");
X int oldmask = sigblock (sigmask (SIGCHLD) | sigmask (SIGTTOU));
X--- 1113,1116 ----
X***************
X*** 1203,1206 ****
X--- 1202,1206 ----
X {
X extern int interactive;
X+ int highfd = getdtablesize() - 1;
X
X /* We can only have job control if we are interactive?
X***************
X*** 1228,1237 ****
X shell_tty = dup (fileno (stdin));
X
X! /* Sorry purists. */
X! while (dup2 (shell_tty, shell_tty + 1) != -1)
X! {
X! close (shell_tty);
X! shell_tty++;
X }
X
X if (ioctl (shell_tty, TIOCGETD, &ldisc) < 0)
X--- 1228,1245 ----
X shell_tty = dup (fileno (stdin));
X
X! if (dup2(shell_tty, highfd) >= 0)
X! {
X! close(shell_tty);
X! shell_tty = highfd;
X }
X+ else
X+ {
X+ /* Sorry purists. */
X+ while (dup2 (shell_tty, shell_tty + 1) != -1)
X+ {
X+ close (shell_tty);
X+ shell_tty++;
X+ }
X+ }
X
X if (ioctl (shell_tty, TIOCGETD, &ldisc) < 0)
X***************
X*** 1291,1297 ****
X static sighandler stop_signal_handler ();
X
X! old_tstp = signal (SIGTSTP, stop_signal_handler);
X! old_ttou = signal (SIGTTOU, stop_signal_handler);
X! old_ttin = signal (SIGTTIN, stop_signal_handler);
X }
X }
X--- 1299,1305 ----
X static sighandler stop_signal_handler ();
X
X! old_tstp = (SigHandler *)signal (SIGTSTP, stop_signal_handler);
X! old_ttou = (SigHandler *)signal (SIGTTOU, stop_signal_handler);
X! old_ttin = (SigHandler *)signal (SIGTTIN, stop_signal_handler);
X }
X }
Xdiff -rc2 bash-0.99/mailcheck.c src-0.99/mailcheck.c
X*** bash-0.99/mailcheck.c Sat Jun 3 14:26:30 1989
X--- src-0.99/mailcheck.c Thu Jun 8 13:21:09 1989
X***************
X*** 113,118 ****
X free_mail_files ()
X {
X- register int i = 0;
X-
X while (mailfiles_count--) {
X free (mailfiles[mailfiles_count]->name);
X--- 113,116 ----
Xdiff -rc2 bash-0.99/parse.y src-0.99/parse.y
X*** bash-0.99/parse.y Tue Jun 6 18:55:01 1989
X--- src-0.99/parse.y Thu Jun 8 16:32:59 1989
X***************
X*** 492,496 ****
X yy_stream_get ()
X {
X- int c;
X if (yy_input_dev)
X #ifdef SYSV
X--- 492,495 ----
X***************
X*** 1101,1107 ****
X double-quotes. */
X int delimited_paren_level = 0;
X-
X- /* The first character of the word. */
X- int first_character = character;
X
X for (;;)
X--- 1100,1103 ----
Xdiff -rc2 bash-0.99/readline.c src-0.99/readline.c
X*** bash-0.99/readline.c Tue Jun 6 19:31:12 1989
X--- src-0.99/readline.c Thu Jun 8 17:35:18 1989
X***************
X*** 232,235 ****
X--- 232,236 ----
X
X #ifdef SIGWINCH
X+ static int
X rl_handle_sigwinch (sig, code, scp)
X int sig, code;
X***************
X*** 236,239 ****
X--- 237,242 ----
X struct sigcontext *scp;
X {
X+ extern char *get_string_value();
X+
X if (readline_echoing_p)
X {
X***************
X*** 303,307 ****
X rl_set_signals ()
X {
X! static int rl_signal_handler ();
X
X old_int = (Function *)signal (SIGINT, rl_signal_handler);
X--- 306,310 ----
X rl_set_signals ()
X {
X! int rl_signal_handler (); /* hc 2.1 on the RT running 4.3 likes this better */
X
X old_int = (Function *)signal (SIGINT, rl_signal_handler);
X***************
X*** 340,344 ****
X readline_internal ()
X {
X! int c, i;
X
X in_stream = rl_instream; out_stream = rl_outstream;
X--- 343,347 ----
X readline_internal ()
X {
X! int c;
X
X in_stream = rl_instream; out_stream = rl_outstream;
X***************
X*** 433,438 ****
X int key;
X {
X- register int i;
X-
X if (keymap[key]) (*keymap[key])(rl_numeric_arg * arg_sign, key);
X else ding ();
X--- 436,439 ----
X***************
X*** 538,542 ****
X--- 539,547 ----
X keymap[CTRL('F')] = rl_forward;
X keymap[CTRL('G')] = rl_abort;
X+ #if defined(ibm032)
X+ keymap[CTRL('H')] = rl_rubout;
X+ #else
X keymap[CTRL('H')] = rl_backward;
X+ #endif
X keymap[CTRL('I')] = rl_complete;
X keymap[NEWLINE] = rl_newline;
X***************
X*** 570,573 ****
X--- 575,579 ----
X keymap[META('I')] = rl_tab_insert;
X keymap[META('L')] = rl_downcase_word;
X+ keymap[META('O')] = rl_arrow_keys;
X keymap[META('R')] = rl_revert_line;
X keymap[META('U')] = rl_upcase_word;
X***************
X*** 575,578 ****
X--- 581,585 ----
X keymap[META('Y')] = rl_yank_pop;
X keymap[META('?')] = rl_possible_completions;
X+ keymap[META('[')] = rl_arrow_keys;
X keymap[META(RUBOUT)] = rl_backward_kill_word;
X }
X***************
X*** 723,727 ****
X register char *line = invisible_line;
X static void move_cursor_relative ();
X! int c_pos = 0, v_pos = 0;
X int inv_botlin = 0; /* Number of lines in newly drawn buffer. */
X
X--- 730,734 ----
X register char *line = invisible_line;
X static void move_cursor_relative ();
X! int c_pos = 0;
X int inv_botlin = 0; /* Number of lines in newly drawn buffer. */
X
X***************
X*** 919,922 ****
X--- 926,932 ----
X
X Could be made even smarter, but this works well enough */
X+
X+ static void output_some_chars(); /* forward declaration */
X+
X static
X update_line (old, new, current_line)
X***************
X*** 925,929 ****
X {
X register char *ofd, *ols, *oe, *nfd, *nls, *ne;
X! int i, lendiff, wsatend;
X
X /* Find first difference. */
X--- 935,939 ----
X {
X register char *ofd, *ols, *oe, *nfd, *nls, *ne;
X! int lendiff, wsatend;
X
X /* Find first difference. */
X***************
X*** 1551,1555 ****
X {
X extern int doing_an_undo;
X! register int i, l = strlen (string);
X while (rl_end + l >= rl_line_buffer_len) {
X rl_line_buffer =
X--- 1561,1566 ----
X {
X extern int doing_an_undo;
X! register int i,l = strlen (string);
X!
X while (rl_end + l >= rl_line_buffer_len) {
X rl_line_buffer =
X***************
X*** 1589,1593 ****
X extern int doing_an_undo;
X register char *text;
X- register int i;
X
X /* Fix it if the caller is confused. */
X--- 1600,1603 ----
X***************
X*** 1765,1768 ****
X--- 1775,1807 ----
X }
X
X+ rl_arrow_keys(count,c)
X+ int count, c;
X+ {
X+ int ch;
X+
X+ ch = rl_read_key();
X+ switch(ch) {
X+ case 'a':
X+ case 'A':
X+ rl_get_previous_history(count,ch);
X+ return;
X+ case 'b':
X+ case 'B':
X+ rl_get_next_history(count,ch);
X+ return;
X+ case 'c':
X+ case 'C':
X+ rl_forward(count);
X+ return;
X+ case 'd':
X+ case 'D':
X+ rl_backward(count);
X+ return;
X+ default:
X+ ding();
X+ return;
X+ }
X+ }
X+
X
X /* **************************************************************** */
X***************
X*** 2216,2220 ****
X char **completion_matches (), **matches;
X char *text;
X! Function *our_func, *func_stack;
X int start, end, delimiter = 0;
X
X--- 2255,2259 ----
X char **completion_matches (), **matches;
X char *text;
X! Function *our_func;
X int start, end, delimiter = 0;
X
X***************
X*** 2781,2784 ****
X--- 2820,2826 ----
X #include <sys/socket.h>
X #include <netdb.h>
X+ #ifdef Bsd
X+ #include <sys/param.h>
X+ #endif /* Bsd */
X
X char *
X***************
X*** 2787,2790 ****
X--- 2829,2835 ----
X char *text;
X {
X+ #if BSD >= 43
X+ return ((char *) NULL);
X+ #else
X static char *hostname = (char *)NULL;
X static struct hostent *entry;
X***************
X*** 2814,2819 ****
X return (value);
X }
X }
X-
X #endif /* SHELL */
X
X--- 2859,2864 ----
X return (value);
X }
X+ #endif /* BSD >= 43 */
X }
X #endif /* SHELL */
X
X***************
X*** 3114,3119 ****
X rl_end_of_history ()
X {
X- HIST_ENTRY *temp;
X-
X maybe_replace_line ();
X using_history ();
X--- 3159,3162 ----
X***************
X*** 3156,3160 ****
X {
X HIST_ENTRY *old_temp = (HIST_ENTRY *)NULL;
X! HIST_ENTRY *temp;
X
X if (count < 0)
X--- 3199,3203 ----
X {
X HIST_ENTRY *old_temp = (HIST_ENTRY *)NULL;
X! HIST_ENTRY *temp = (HIST_ENTRY *)NULL;
X
X if (count < 0)
X***************
X*** 3798,3802 ****
X }
X
X! rl_newline ();
X }
X
X--- 3841,3845 ----
X }
X
X! rl_newline (count,c);
X }
X
X***************
X*** 4301,4306 ****
X {
X char *strindex ();
X- register int i, l;
X- int len = strlen (string);
X
X while (*array) {
X--- 4344,4347 ----
Xdiff -rc2 bash-0.99/readline.h src-0.99/readline.h
X*** bash-0.99/readline.h Tue Apr 4 14:03:23 1989
X--- src-0.99/readline.h Thu Jun 8 13:37:28 1989
X***************
X*** 18,22 ****
X rl_revert_line (), rl_beginning_of_history (), rl_end_of_history (),
X rl_forward_search_history (), rl_insert (), rl_upcase_word (),
X! rl_downcase_word (), rl_capitalize_word (), rl_emacs_editing_mode ();
X
X /* Things for vi mode. */
X--- 18,23 ----
X rl_revert_line (), rl_beginning_of_history (), rl_end_of_history (),
X rl_forward_search_history (), rl_insert (), rl_upcase_word (),
X! rl_downcase_word (), rl_capitalize_word (), rl_emacs_editing_mode (),
X! rl_arrow_keys();
X
X /* Things for vi mode. */
Xdiff -rc2 bash-0.99/shell.c src-0.99/shell.c
X*** bash-0.99/shell.c Thu May 25 12:02:02 1989
X--- src-0.99/shell.c Thu Jun 8 17:29:41 1989
X***************
X*** 359,363 ****
X
X /* Do the things that should be done only for interactive shells. */
X! if (interactive)
X {
X /* Set up for checking for presence of mail. */
X--- 359,363 ----
X
X /* Do the things that should be done only for interactive shells. */
X! if (interactive && argc == arg_index)
X {
X /* Set up for checking for presence of mail. */
X***************
X*** 527,531 ****
X {
X SigHandler throw_to_top_level;
X- int parse_error;
X int code = setjmp (top_level);
X
X--- 527,530 ----
X***************
X*** 544,548 ****
X EOF_Reached = EOF;
X goto exec_done;
X- break;
X
X case DISCARD:
X--- 543,546 ----
X***************
X*** 609,615 ****
X--- 607,624 ----
X }
X
X+ sighandler
X+ alrm_catcher(sig)
X+ int sig;
X+ {
X+ printf("auto-logout\n");
X+ longjmp(top_level, EXITPROG);
X+ }
X+
X read_command ()
X {
X SHELL_VAR *prompt_var = find_variable ("PS1");
X+ SHELL_VAR *tmout_var = find_variable ("TMOUT");
X+ int r, tmout_len;
X+ Function *old_alrm = (Function *) NULL;
X
X if (prompt_var && !function_p (prompt_var))
X***************
X*** 616,622 ****
X prompt_string = prompt_var->value;
X else prompt_string = "";
X!
X global_command = (COMMAND *)NULL;
X! return (yyparse ());
X }
X
X--- 625,645 ----
X prompt_string = prompt_var->value;
X else prompt_string = "";
X! if (tmout_var)
X! {
X! tmout_len = atoi(tmout_var->value);
X! if (tmout_len)
X! {
X! old_alrm = (Function *) signal (SIGALRM, alrm_catcher);
X! alarm(tmout_len);
X! }
X! }
X global_command = (COMMAND *)NULL;
X! r = yyparse ();
X! if (tmout_var && tmout_len)
X! {
X! alarm(0);
X! (void) signal (SIGALRM, old_alrm);
X! }
X! return r;
X }
X
X***************
X*** 625,631 ****
X shell_initialize ()
X {
X- char *string;
X- int integer;
X-
X /* The initialization of the baic underlying signal handlers must
X happen before we initialize_traps (). */
X--- 648,651 ----
X***************
X*** 636,640 ****
X {
X struct passwd *entry = getpwuid (getuid ());
X! char hostname[255];
X
X #if defined(SYSV) && !defined(HPUX)
X--- 656,660 ----
X {
X struct passwd *entry = getpwuid (getuid ());
X! char hostname[256];
X
X #if defined(SYSV) && !defined(HPUX)
X***************
X*** 646,649 ****
X--- 666,670 ----
X current_host_name = savestring (hostname);
X #endif
X+ bind_variable("HOST",current_host_name);
X if (entry)
X current_user_name = savestring (entry->pw_name);
X***************
X*** 766,769 ****
X--- 787,791 ----
X
X /* This function belongs here? */
X+ sighandler
X termination_unwind_protect (sig)
X int sig;
X***************
X*** 775,778 ****
X--- 797,801 ----
X
X /* What to do when we've been interrupted. */
X+ sighandler
X throw_to_top_level ()
X {
Xdiff -rc2 bash-0.99/shell.h src-0.99/shell.h
X*** bash-0.99/shell.h Mon May 22 17:38:25 1989
X--- src-0.99/shell.h Thu Jun 8 17:50:52 1989
X***************
X*** 193,194 ****
X--- 193,204 ----
X /* Generalized global variables. */
X extern int executing, login_shell;
X+
X+ #ifdef SYSV
X+ #define bcopy(s,d,n) memcpy((d),(s),(n))
X+ #define rindex strrchr
X+ #endif
X+
X+ #if defined(SONY) || defined(pyr)
X+ #define strrchr rindex
X+ #define strchr index
X+ #endif
Xdiff -rc2 bash-0.99/subst.c src-0.99/subst.c
X*** bash-0.99/subst.c Thu Jun 1 12:15:10 1989
X--- src-0.99/subst.c Mon Jun 12 09:48:20 1989
X***************
X*** 11,14 ****
X--- 11,15 ----
X #include <pwd.h>
X #include <fcntl.h>
X+ #include <sys/types.h>
X #include "shell.h"
X #include "flags.h"
X***************
X*** 180,184 ****
X {
X if (c == '"' || c == '\'' || c == '\\')
X! delimiter == c;
X }
X }
X--- 181,185 ----
X {
X if (c == '"' || c == '\'' || c == '\\')
X! delimiter = c;
X }
X }
X***************
X*** 209,213 ****
X {
X register int c, j, i;
X- int last_char;
X char *temp = (char *)xmalloc (1 + strlen (string + (*index)));
X
X--- 210,213 ----
X***************
X*** 271,276 ****
X WORD_LIST *result = (WORD_LIST *)NULL;
X char *current_word = (char *)NULL;
X! int index =0;
X! WORD_DESC *temp_word;
X
X while (string[index] &&
X--- 271,275 ----
X WORD_LIST *result = (WORD_LIST *)NULL;
X char *current_word = (char *)NULL;
X! int index = 0;
X
X while (string[index] &&
X***************
X*** 437,441 ****
X register WORD_LIST *list;
X {
X- register int i;
X register char *s;
X
X--- 436,439 ----
X***************
X*** 886,890 ****
X extern int last_made_pid;
X int pid, old_pid, fildes[2];
X- COMMAND *command;
X
X if (pipe (fildes) < 0) {
X--- 884,887 ----
X***************
X*** 1440,1444 ****
X
X /* What to do just after the PATH variable has changed. */
X! sv_path ()
X {
X /* hash -r */
X--- 1437,1442 ----
X
X /* What to do just after the PATH variable has changed. */
X! sv_path (name)
X! char *name;
X {
X /* hash -r */
Xdiff -rc2 bash-0.99/test.c src-0.99/test.c
X*** bash-0.99/test.c Mon Jun 5 12:27:59 1989
X--- src-0.99/test.c Thu Jun 8 14:13:11 1989
X***************
X*** 57,61 ****
X--- 57,65 ----
X #endif /* STANDALONE */
X
X+ #ifndef SYSV
X int sys_v = 0;
X+ #else
X+ int sys_v = 1;
X+ #endif
X
X static int pos; /* position in list */
X***************
X*** 63,66 ****
X--- 67,71 ----
X static char **argv; /* the argument list */
X
X+ #ifndef SYSV
X static void
X test_syntax_error (pchFmt, args)
X***************
X*** 73,77 ****
X--- 78,96 ----
X /*NOTREACHED*/
X }
X+ #else
X+ #include <varargs.h>
X
X+ static void
X+ test_syntax_error(fmt, va)
X+ char *fmt;
X+ va_list va;
X+ {
X+ (void) fprintf(stderr,"%s: ", argv[0]);
X+ (void) vfprintf(stderr, fmt, va);
X+ (void) fflush(stderr); /* just in case */
X+ test_exit(SHELL_BOOLEAN(FALSE));
X+ }
X+ #endif
X+
X test_io_error (name)
X char *name;
X***************
X*** 553,556 ****
X--- 572,604 ----
X }
X return (TRUE == (isatty (1)));
X+
X+ /* New options from CWRU */
X+
X+ case 'S': /* File is a socket ? */
X+ unary_advance ();
X+ if (stat (argv[pos - 1], &stat_buf) < 0)
X+ return (FALSE);
X+
X+ #ifndef S_IFSOCK
X+ return (FALSE);
X+ #else /* S_IFSOCK */
X+ return (TRUE == (S_IFSOCK == (stat_buf.st_mode & S_IFMT)));
X+ #endif /* S_IFSOCK */
X+
X+ case 'U': /* File is owned by same effective uid? */
X+ unary_advance ();
X+ if (stat (argv[pos - 1], &stat_buf) < 0) {
X+ return (FALSE);
X+ }
X+ return (TRUE == (stat_buf.st_uid == geteuid()));
X+
X+ case 'G': /* File is owned by same effective gid ? */
X+ unary_advance ();
X+ if (stat (argv[pos - 1], &stat_buf) < 0) {
X+ return (FALSE);
X+ }
X+ return (TRUE == (stat_buf.st_gid == getegid()));
X+
X+ /* End of new options from CWRU */
X
X case 'n': /* True if arg has some length. */
Xdiff -rc2 bash-0.99/trap.c src-0.99/trap.c
X*** bash-0.99/trap.c Wed May 10 18:16:56 1989
X--- src-0.99/trap.c Thu Jun 8 16:51:37 1989
X***************
X*** 120,124 ****
X int sig;
X {
X- char *string;
X if ((sig >= NSIG) || (((int)trap_list[sig]) == 0))
X programming_error ("trap_handler: Bad signal %d", sig);
X--- 120,123 ----
X***************
X*** 159,163 ****
X {
X signal (sig, original_signals[sig]);
X! change_signal (sig, DEFAULT_SIG);
X }
X
X--- 158,162 ----
X {
X signal (sig, original_signals[sig]);
X! change_signal (sig, (char *)DEFAULT_SIG);
X }
X
X***************
X*** 168,171 ****
X {
X signal (sig, SIG_IGN);
X! change_signal (sig, IGNORE_SIG);
X }
X--- 167,170 ----
X {
X signal (sig, SIG_IGN);
X! change_signal (sig, (char *)IGNORE_SIG);
X }
Xdiff -rc2 bash-0.99/unwind_protect.c src-0.99/unwind_protect.c
X*** bash-0.99/unwind_protect.c Wed May 10 18:21:39 1989
X--- src-0.99/unwind_protect.c Thu Jun 8 17:42:00 1989
X***************
X*** 23,27 ****
X without_interrupts (function, arg1, arg2)
X Function *function;
X! void *arg1, *arg2;
X {
X SigHandler *old_int;
X--- 23,28 ----
X without_interrupts (function, arg1, arg2)
X Function *function;
X! Function *arg1;
X! char *arg2;
X {
X SigHandler *old_int;
X***************
X*** 45,49 ****
X {
X int remove_unwind_protect_internal ();
X! without_interrupts (remove_unwind_protect_internal);
X }
X
X--- 46,50 ----
X {
X int remove_unwind_protect_internal ();
X! without_interrupts (remove_unwind_protect_internal, (Function *) NULL, (char *) NULL);
X }
X
X***************
X*** 52,56 ****
X {
X int run_unwind_protects_internal ();
X! without_interrupts (run_unwind_protects_internal);
X }
X
X--- 53,57 ----
X {
X int run_unwind_protects_internal ();
X! without_interrupts (run_unwind_protects_internal, (Function *)NULL, (char *)NULL);
X }
X
Xdiff -rc2 bash-0.99/variables.c src-0.99/variables.c
X*** bash-0.99/variables.c Thu Jun 1 11:11:47 1989
X--- src-0.99/variables.c Thu Jun 8 14:27:02 1989
X***************
X*** 10,13 ****
X--- 10,14 ----
X #include <ctype.h>
X #include <pwd.h>
X+ #include <sys/types.h>
X #include "shell.h"
X #include "flags.h"
X***************
X*** 58,62 ****
X int c, char_index;
X int string_index = 0;
X- int shell_level;
X SHELL_VAR *temp_var;
X
X--- 59,62 ----
X***************
X*** 118,122 ****
X }
X }
X!
X /* Do some things with shell level. */
X {
X--- 118,131 ----
X }
X }
X!
X! /* Set up $PPID, the pid of the shell's parent, a la the ksh. */
X! {
X! char pptr[8];
X!
X! sprintf(pptr,"%d", (int) getppid());
X! bind_variable("PPID", pptr);
X! set_var_read_only("PPID");
X! non_unsettable("PPID");
X! }
X /* Do some things with shell level. */
X {
X***************
X*** 138,141 ****
X--- 147,153 ----
X extern int login_shell;
X char *tname = find_user_command (shell_name);
X+ #ifdef SYSV
X+ extern struct passwd *getpwuid();
X+ #endif
X
X if ((login_shell == 1) && (*shell_name != '/'))
X***************
X*** 510,514 ****
X {
X register SHELL_VAR *list = variable_list;
X! register SHELL_VAR *temp, *prev = (SHELL_VAR *)NULL;
X
X while (list)
X--- 522,526 ----
X {
X register SHELL_VAR *list = variable_list;
X! register SHELL_VAR *prev = (SHELL_VAR *)NULL;
X
X while (list)
X***************
X*** 623,627 ****
X char *string;
X {
X! register int c, delimiter = 0;
X register int index = 0;
X
X--- 635,639 ----
X char *string;
X {
X! register int c;
X register int index = 0;
X
X***************
X*** 707,713 ****
X dispose_used_env_vars ()
X {
X- register char *temp;
X- int i = 0;
X-
X if (!temporary_env)
X return;
X--- 719,722 ----
X***************
X*** 733,737 ****
X {
X register int i;
X- char *temp;
X int equal_offset = assignment (assign);
X
X--- 742,745 ----
Xdiff -rc2 bash-0.99/vi_keymap.c src-0.99/vi_keymap.c
X*** bash-0.99/vi_keymap.c Tue Apr 4 14:03:25 1989
X--- src-0.99/vi_keymap.c Thu Jun 8 14:23:49 1989
X***************
X*** 23,27 ****
X--- 23,31 ----
X (Function *)0x0, /* Control-f */
X rl_abort, /* Control-g */
X+ #if defined(ibm032)
X+ rl_rubout, /* Control-h */
X+ #else
X rl_backward, /* Control-h */
X+ #endif
X (Function *)0x0, /* Control-i */
X rl_newline, /* Control-j */
X***************
X*** 254,258 ****
X (Function *)0x0, /* Meta-M */
X (Function *)0x0, /* Meta-N */
X! (Function *)0x0, /* Meta-O */
X (Function *)0x0, /* Meta-P */
X (Function *)0x0, /* Meta-Q */
X--- 258,262 ----
X (Function *)0x0, /* Meta-M */
X (Function *)0x0, /* Meta-N */
X! rl_arrow_keys, /* Meta-O */
X (Function *)0x0, /* Meta-P */
X (Function *)0x0, /* Meta-Q */
X***************
X*** 268,272 ****
X
X /* Some more punctuation. */
X! (Function *)0x0, /* Meta-[ */
X (Function *)0x0, /* Meta-\ */
X (Function *)0x0, /* Meta-] */
X--- 272,276 ----
X
X /* Some more punctuation. */
X! rl_arrow_keys, /* Meta-[ */
X (Function *)0x0, /* Meta-\ */
X (Function *)0x0, /* Meta-] */
XOnly in src-0.99/documentation: brian-readline.texinfo
SHAR_EOF
if test 31096 -ne "`wc -c < 'diffs.0.99'`"
then
echo shar: error transmitting "'diffs.0.99'" '(should have been 31096 characters)'
fi
fi
# end of shell archive
exit 0


Chet Ramey Network Services Group, CWRU chet@{cwjcc,pirate}.INS.CWRU.Edu

"The flagon with the dragon has the potion with the poison;
the vessel with the pestle holds the brew that is true!"

0 new messages