home *** CD-ROM | disk | FTP | other *** search
- diff -c ./bashline.c /home/scott/work/st-bash-1.10/src/bashline.c
- *** ./bashline.c Thu Jul 11 17:36:28 1991
- --- /home/scott/work/st-bash-1.10/src/bashline.c Wed Oct 23 18:45:03 1991
- ***************
- *** 35,44 ****
-
- static char
- **attempt_shell_completion (), *variable_completion_function (),
- ! *hostname_completion_function (), *command_word_completion_function ();
-
- static void
- snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
-
- /* Externally defined functions used by this file. */
- extern char
- --- 35,49 ----
-
- static char
- **attempt_shell_completion (), *variable_completion_function (),
- ! #if !defined(atarist)
- ! *hostname_completion_function (), /** sjk++ remove network stuff. **/
- ! #endif
- ! *command_word_completion_function ();
-
- + #if !defined(atarist)
- static void
- snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
- + #endif
-
- /* Externally defined functions used by this file. */
- extern char
- ***************
- *** 61,68 ****
- --- 66,78 ----
- bash_complete_filename_internal (),
- bash_complete_username (), bash_possible_username_completions (),
- bash_complete_username_internal (),
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- bash_complete_hostname (), bash_possible_hostname_completions (),
- bash_complete_hostname_internal (),
- + #endif
- bash_complete_variable (), bash_possible_variable_completions (),
- bash_complete_variable_internal (),
- bash_complete_command (), bash_possible_command_completions (),
- ***************
- *** 115,125 ****
- --- 125,140 ----
- rl_bind_key_in_map ('~', bash_possible_username_completions,
- emacs_ctlx_keymap);
-
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- rl_add_defun ("complete-hostname", bash_complete_hostname, META('@'));
- rl_add_defun ("possible-hostname-completions",
- bash_possible_hostname_completions, -1);
- rl_bind_key_in_map ('@', bash_possible_hostname_completions,
- emacs_ctlx_keymap);
- + #endif
-
- rl_add_defun ("complete-variable", bash_complete_variable, META('$'));
- rl_add_defun ("possible-variable-completions",
- ***************
- *** 209,214 ****
- --- 224,233 ----
- /* */
- /* **************************************************************** */
-
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- /* If the user requests hostname completion, then simply build a list
- of hosts, and complete from that forever more. */
- #if !defined (ETCHOSTS)
- ***************
- *** 253,259 ****
- if (hostname_list_length + 2 > hostname_list_size)
- {
- hostname_list = (char **)
- ! xrealloc (hostname_list,
- (1 + (hostname_list_size += 100)) * sizeof (char *));
- }
-
- --- 272,278 ----
- if (hostname_list_length + 2 > hostname_list_size)
- {
- hostname_list = (char **)
- ! xrealloc ((char *)hostname_list,
- (1 + (hostname_list_size += 100)) * sizeof (char *));
- }
-
- ***************
- *** 408,413 ****
- --- 427,433 ----
- }
- return ((char **)NULL);
- }
- + #endif
-
- /* This is a K*rn shell style insert-last-arg function. The
- difference is that Bash puts stuff into the history file before
- ***************
- *** 537,544 ****
- --- 557,570 ----
-
- /* Another one. Why not? If the word starts in '@', then look through
- the world of known hostnames for completion first. */
- +
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- if (!matches && *text == '@')
- matches = completion_matches (text, hostname_completion_function);
- + #endif
-
- /* And last, (but not least) if this word is in a command position, then
- complete over possible command names, including aliases, functions,
- ***************
- *** 794,799 ****
- --- 820,829 ----
- }
- }
-
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- /* How about a completion function for hostnames? */
- static char *
- hostname_completion_function (text, state)
- ***************
- *** 836,841 ****
- --- 866,872 ----
- else
- return ((char *)NULL);
- }
- + #endif
-
- /* History and alias expand the line. But maybe do more? This
- is a test to see what users like. Do expand_string on the string. */
- ***************
- *** 996,1002 ****
- {
- if (numitems + 1 > maxitems)
- ignores = (struct ign *)
- ! xrealloc (ignores, (maxitems += 10) * sizeof (struct ign));
-
- ignores[numitems].val = colon_bit;
- ignores[numitems].len = strlen (colon_bit);
- --- 1027,1033 ----
- {
- if (numitems + 1 > maxitems)
- ignores = (struct ign *)
- ! xrealloc ((char *)ignores, (maxitems += 10) * sizeof (struct ign));
-
- ignores[numitems].val = colon_bit;
- ignores[numitems].len = strlen (colon_bit);
- ***************
- *** 1143,1148 ****
- --- 1174,1183 ----
- rl_completer_word_break_characters = orig_rl_completer_word_break_characters;
- }
-
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- static void
- bash_complete_hostname (ignore, ignore2)
- int ignore, ignore2;
- ***************
- *** 1156,1161 ****
- --- 1191,1197 ----
- {
- bash_complete_hostname_internal ('?');
- }
- + #endif
-
- static void
- bash_complete_variable (ignore, ignore2)
- ***************
- *** 1186,1191 ****
- --- 1222,1231 ----
- bash_complete_command_internal ('?');
- }
-
- + /**
- + ** (sjk)++ Remove hostname/mail references on the Atari ST.
- + **/
- + #if !defined(atarist)
- static void
- bash_complete_hostname_internal (what_to_do)
- int what_to_do;
- ***************
- *** 1193,1198 ****
- --- 1233,1239 ----
- bash_specific_completion
- (what_to_do, (Function *)hostname_completion_function);
- }
- + #endif
-
- static void
- bash_complete_variable_internal (what_to_do)
- diff -c ./braces.c /home/scott/work/st-bash-1.10/src/braces.c
- *** ./braces.c Sun Jul 7 14:36:14 1991
- --- /home/scott/work/st-bash-1.10/src/braces.c Wed Oct 23 18:46:13 1991
- ***************
- *** 110,116 ****
- #if defined (SHELL)
- /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
- without doing any expansion. */
- ! if (index (amble, brace_arg_separator) == NULL)
- {
- free (amble);
- free (preamble);
- --- 110,116 ----
- #if defined (SHELL)
- /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
- without doing any expansion. */
- ! if (index (amble, brace_arg_separator) == (int)NULL)
- {
- free (amble);
- free (preamble);
- ***************
- *** 164,170 ****
- register int lp = array_len (partial);
- register int j;
-
- ! result = (char **)xrealloc (result, (1 + lp + lr) * sizeof (char *));
-
- for (j = 0; j < lp; j++)
- result[lr + j] = partial[j];
- --- 164,170 ----
- register int lp = array_len (partial);
- register int j;
-
- ! result = (char **)xrealloc ((char *)result, (1 + lp + lr) * sizeof (char *));
-
- for (j = 0; j < lp; j++)
- result[lr + j] = partial[j];
- diff -c ./config.h /home/scott/work/st-bash-1.10/src/config.h
- *** ./config.h Tue Sep 3 14:41:45 1991
- --- /home/scott/work/st-bash-1.10/src/config.h Wed Oct 23 19:14:01 1991
- ***************
- *** 59,65 ****
-
- /* Define JOB_CONTROL if your operating system supports
- BSD-like job control. */
- ! #define JOB_CONTROL
-
- /* Note that vanilla System V machines don't support BSD job control,
- although some do support Posix job control. */
- --- 59,65 ----
-
- /* Define JOB_CONTROL if your operating system supports
- BSD-like job control. */
- ! /* #define JOB_CONTROL */
-
- /* Note that vanilla System V machines don't support BSD job control,
- although some do support Posix job control. */
- diff -c ./execute_cmd.c /home/scott/work/st-bash-1.10/src/execute_cmd.c
- *** ./execute_cmd.c Thu Oct 3 16:47:59 1991
- --- /home/scott/work/st-bash-1.10/src/execute_cmd.c Thu Oct 24 00:08:17 1991
- ***************
- *** 617,622 ****
- --- 617,627 ----
- around a bitmap of file descriptors that must be
- closed after making a child process in
- execute_simple_command. */
- + /**
- + ** (sjk)++ This above described problem does not exists on the
- + ** atari ST because of my brain dead pipe implementation.
- + **/
- + #if !defined(atarist)
-
- /* We need fd_bitmap to be at least as big as fildes[0].
- If fildes[0] is less than fds_to_close->size, then
- ***************
- *** 684,689 ****
- --- 689,715 ----
- #if defined (JOB_CONTROL)
- UNBLOCK_CHILD (oset);
- #endif
- + #else
- + if (ignore_return && cmd->value.Connection->first)
- + cmd->value.Connection->first->flags |=
- + CMD_IGNORE_RETURN;
- + execute_command_internal
- + (cmd->value.Connection->first, asynchronous, prev,
- + fildes[1], fds_to_close);
- +
- + prev = fildes[0];
- +
- + }
- + cmd = cmd->value.Connection->second;
- + }
- +
- + /* Now execute the rightmost command in the pipeline. */
- + if (ignore_return && cmd)
- + cmd->flags |= CMD_IGNORE_RETURN;
- + exec_result =
- + execute_command_internal
- + (cmd, asynchronous, prev, pipe_out, fds_to_close);
- + #endif
- }
- break;
-
- ***************
- *** 1574,1580 ****
- {
- /* A command containing a slash is not looked up in PATH. */
- if (absolute_program (words->word->word))
- ! command = savestring (words->word->word);
- else
- command = find_user_command (words->word->word);
-
- --- 1600,1632 ----
- {
- /* A command containing a slash is not looked up in PATH. */
- if (absolute_program (words->word->word))
- ! { /** **/
- ! /**
- ! ** (sjk)++ Add checking of extensions {.tos/.ttp/.prg} on absolute
- ! ** paths on the Atari ST.
- ! **/
- ! #if defined(atarist)
- ! char *name_suffix = alloca(4 + strlen(words->word->word));
- ! struct stat finfo;
- ! strcpy(name_suffix,words->word->word);
- ! if (0 != stat(name_suffix,&finfo))
- ! { strcat(name_suffix,".tos");
- ! if (0 != stat(name_suffix,&finfo))
- ! { strcpy(name_suffix,words->word->word);
- ! strcat(name_suffix,".ttp");
- ! if (0 != stat(name_suffix,&finfo))
- ! { strcpy(name_suffix,words->word->word);
- ! strcat(name_suffix,".prg");
- ! if (0 != stat(name_suffix,&finfo))
- ! strcpy(name_suffix,words->word->word);
- ! }
- ! }
- ! }
- ! command = savestring (name_suffix);
- ! #else
- ! command = savestring (words->word->word);
- ! #endif
- ! }
- else
- command = find_user_command (words->word->word);
-
- ***************
- *** 1632,1637 ****
- --- 1684,1695 ----
- else
- {
- /* Make sure that the pipes are closed in the parent. */
- + /**
- + ** On the Atari ST force GEMDOS buffers into RTL buffers.
- + **/
- + #if defined(atarist)
- + flush_key_buff(fileno(stdin));
- + #endif
- close_pipes (pipe_in, pipe_out);
- free (command);
- }
- ***************
- *** 1884,1889 ****
- --- 1942,1951 ----
- do_piping (pipe_in, pipe_out)
- int pipe_in, pipe_out;
- {
- + /**
- + ** (sjk)++ on the ST we are more carefulll
- + **/
- + #if !defined(atarist)
- if (pipe_in != NO_PIPE)
- {
- dup2 (pipe_in, 0);
- ***************
- *** 1897,1902 ****
- --- 1959,1982 ----
- if (pipe_out == REDIRECT_BOTH)
- dup2 (1, 2);
- }
- + #else
- + int res;
- +
- + if (pipe_in != NO_PIPE)
- + {
- + res = dup2 (pipe_in, 0);
- + if (res < 0)
- + fprintf(stderr,"pipe_in - dup2:%d, errno:%d\n",res,errno);
- + }
- + if (pipe_out != NO_PIPE)
- + {
- + res = dup2 (pipe_out, 1);
- + if (res < 0)
- + fprintf(stderr,"pipe_in - dup2:%d, errno:%d\n",res,errno);
- + if (pipe_out == REDIRECT_BOTH)
- + dup2 (1, 2);
- + }
- + #endif
- }
-
- /* Defined in flags.c. Non-zero means don't overwrite existing files. */
- ***************
- *** 2432,2438 ****
- --- 2512,2548 ----
- find_user_command (name)
- char *name;
- {
- + /**
- + ** (sjk)++ Check the extensions {.tos/.ttp/.prg} for a user command.
- + **/
- + #if defined(atarist)
- + char *win,*name_suffix;
- + name_suffix = (char *)alloca(4 + strlen(name));
- + #endif
- + #if !defined(atarist)
- return (find_user_command_internal (name, FS_EXEC_PREFERRED));
- + #else
- + win = find_user_command_internal(name, 1);
- + if (win != (char *)NULL) return(win);
- +
- + strcpy(name_suffix,name);
- + strcat(name_suffix,".ttp");
- + win = (char *)find_user_command_internal(name_suffix, FS_EXEC_PREFERRED);
- + if (win != (char *)NULL) return(win);
- +
- + strcpy(name_suffix,name);
- + strcat(name_suffix,".tos");
- + win = (char *)find_user_command_internal(name_suffix, FS_EXEC_PREFERRED);
- + if (win != (char *)NULL) return(win);
- +
- + strcpy(name_suffix,name);
- + strcat(name_suffix,".prg");
- + win = (char *)find_user_command_internal(name_suffix, FS_EXEC_PREFERRED);
- + if (win != (char *)NULL) return(win);
- +
- + return(win);
- + #endif
- +
- }
-
- /* Locate the file referenced by NAME, searching along the contents
- diff -c ./expr.c /home/scott/work/st-bash-1.10/src/expr.c
- *** ./expr.c Sun Aug 4 15:17:33 1991
- --- /home/scott/work/st-bash-1.10/src/expr.c Wed Oct 23 19:19:42 1991
- ***************
- *** 147,153 ****
- if (expr_depth >= expr_stack_size)
- {
- expr_stack = (EXPR_CONTEXT **)
- ! xrealloc (expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
- * sizeof (EXPR_CONTEXT *));
- }
-
- --- 147,153 ----
- if (expr_depth >= expr_stack_size)
- {
- expr_stack = (EXPR_CONTEXT **)
- ! xrealloc ((char *)expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
- * sizeof (EXPR_CONTEXT *));
- }
-
- diff -c ./general.c /home/scott/work/st-bash-1.10/src/general.c
- *** ./general.c Sun Jul 7 17:24:41 1991
- --- /home/scott/work/st-bash-1.10/src/general.c Wed Oct 23 19:15:36 1991
- ***************
- *** 69,75 ****
-
- char *
- xmalloc (size)
- ! int size;
- {
- register char *temp = (char *)malloc (size);
-
- --- 69,75 ----
-
- char *
- xmalloc (size)
- ! long size;
- {
- register char *temp = (char *)malloc (size);
-
- ***************
- *** 82,88 ****
- char *
- xrealloc (pointer, size)
- register char *pointer;
- ! int size;
- {
- char *temp;
-
- --- 82,88 ----
- char *
- xrealloc (pointer, size)
- register char *pointer;
- ! long size;
- {
- char *temp;
-
- ***************
- *** 158,166 ****
- unset_nodelay_mode (fd)
- int fd;
- {
- int flags, set = 0;
-
- ! if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
- return;
-
- #if defined (O_NONBLOCK)
- --- 158,174 ----
- unset_nodelay_mode (fd)
- int fd;
- {
- +
- + /**
- + ** (sjk)++ We remove the call to make stdin a noblocking stream, since this
- + is not a feature of our limited fcntl() call. No blocking Input
- + is however taken care of by the console_input_status()
- + and console_read_byte() pair in the readline source code.
- + **/
- + #if !defined(atarist)
- int flags, set = 0;
-
- ! if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
- return;
-
- #if defined (O_NONBLOCK)
- ***************
- *** 181,186 ****
- --- 189,195 ----
-
- if (set)
- fcntl (fd, F_SETFL, flags);
- + #endif
- }
-
-
- ***************
- *** 406,411 ****
- --- 415,429 ----
- {
- register char *cp;
-
- + /**
- + ** (sjk)++ let the string "[a..z]:" pass through as is is a valid drive
- + ** specification on the Atari ST.
- + **/
- + #if defined(atarist)
- + if ((strlen(string)>1) && (string[1] == ':'))
- + return(savestring (string));
- + #endif
- +
- if (!dot_path || *string == '/')
- return (savestring (string));
-
- diff -c ./general.h /home/scott/work/st-bash-1.10/src/general.h
- *** ./general.h Sat Jul 13 23:40:27 1991
- --- /home/scott/work/st-bash-1.10/src/general.h Wed Oct 23 19:15:02 1991
- ***************
- *** 76,82 ****
- #define FS_EXEC_PREFERRED 0x4
- #define FS_EXEC_ONLY 0x8
-
- - extern char *xmalloc (), *malloc (), *xrealloc (), *realloc ();
- extern char *itos ();
-
- #endif /* _GENERAL_ */
- --- 76,84 ----
- #define FS_EXEC_PREFERRED 0x4
- #define FS_EXEC_ONLY 0x8
-
- extern char *itos ();
-
- #endif /* _GENERAL_ */
- +
- +
- +
- diff -c ./mailcheck.c /home/scott/work/st-bash-1.10/src/mailcheck.c
- *** ./mailcheck.c Sun Jul 7 17:25:49 1991
- --- /home/scott/work/st-bash-1.10/src/mailcheck.c Wed Oct 23 19:22:16 1991
- ***************
- *** 24,29 ****
- --- 24,35 ----
- #include <sys/param.h>
- #include "shell.h"
-
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST1
- + **/
- + #if !defined(atarist)
- +
- +
- #include "maxpath.h"
-
- #ifndef NOW
- ***************
- *** 148,153 ****
- --- 154,160 ----
- mailfiles_count = 0;
- mailfiles = (FILEINFO **)NULL;
- }
- + #endif
-
- /* Return the full pathname of FILE. Easy. Filenames that begin
- with a '/' are returned as themselves. Other filenames have
- ***************
- *** 190,195 ****
- --- 197,207 ----
- }
- }
-
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- +
- /* Return non-zero if FILE's mod date has changed. */
- file_mod_date_changed (file)
- char *file;
- ***************
- *** 404,406 ****
- --- 416,419 ----
- free (mailpaths);
- bind_variable ("_", dollar_underscore);
- }
- + #endif
- diff -c ./nojobs.c /home/scott/work/st-bash-1.10/src/nojobs.c
- *** ./nojobs.c Mon Sep 30 23:27:27 1991
- --- /home/scott/work/st-bash-1.10/src/nojobs.c Wed Oct 23 19:28:38 1991
- ***************
- *** 46,56 ****
- #define SIGABRT SIGIOT
- #endif
-
- ! #if defined (USG) || defined (_POSIX_VERSION)
- #define killpg(pg, sig) kill(-(pg),(sig))
- #endif
-
- ! #if defined (USG)
- #define siginterrupt(sig, code)
- #endif
-
- --- 46,62 ----
- #define SIGABRT SIGIOT
- #endif
-
- ! /**
- ! ** (sjk)++ Remove all host/mail references on the Atari ST1
- ! **/
- ! #if defined (USG) || defined (_POSIX_VERSION) || defined(atarist)
- #define killpg(pg, sig) kill(-(pg),(sig))
- #endif
-
- ! /**
- ! ** (sjk)++ Make siginterrupt() a NULL code on the Atari ST
- ! **/
- ! #if defined (USG) || defined(atarist)
- #define siginterrupt(sig, code)
- #endif
-
- ***************
- *** 143,148 ****
- --- 149,161 ----
- return (pid);
- }
-
- + /**
- + ** (sjk)++ Define ECHILD to be an unknown/general ERROR code for the Atari ST
- + **/
- + #if defined(atarist)
- + #define ECHILD (-1)
- + #endif
- +
- /* Wait for a single pid (PID) and return its exit status. */
- wait_for_single_pid (pid)
- pid_t pid;
- ***************
- *** 186,192 ****
- WAIT status;
-
- while ((got_pid = wait(&status)) != -1) /* wait for ECHILD */
- ! ;
- if (errno != EINTR && errno != ECHILD)
- {
- siginterrupt (SIGINT, 0);
- --- 199,206 ----
- WAIT status;
-
- while ((got_pid = wait(&status)) != -1) /* wait for ECHILD */
- ! printf("Stuck in wait loop with got_pid = %d\n",got_pid);
- !
- if (errno != EINTR && errno != ECHILD)
- {
- siginterrupt (SIGINT, 0);
- ***************
- *** 294,300 ****
- --- 308,321 ----
- /* Fill the contents of shell_tty_info with the current tty info. */
- get_tty_state ()
- {
- + /**
- + ** (sjk)++ Attach the terminal to CON: on the Atari ST
- + **/
- + #if !defined(atarist)
- int tty = open ("/dev/tty", O_RDONLY);
- + #else
- + int tty = open("CON:", O_RDONLY);
- + #endif
- if (tty != -1)
- {
-
- ***************
- *** 315,321 ****
- --- 336,349 ----
- /* Make the current tty use the state in shell_tty_info. */
- set_tty_state ()
- {
- + /**
- + ** (sjk)++ Attach the terminal to CON: on the Atari ST
- + **/
- + #if !defined(atarist)
- int tty = open ("/dev/tty", O_RDONLY);
- + #else
- + int tty = open("CON:", O_RDONLY);
- + #endif
- if (tty != -1)
- {
- if (!got_tty_state)
- ***************
- *** 326,336 ****
- #if defined (_POSIX_VERSION)
- tcsetattr (tty, TCSADRAIN, &shell_tty_info);
- #else
- ! # if defined (USG)
- ! ioctl (tty, TCSETAW, &shell_tty_info); /* Wait for output, no flush */
- ! # else
- ioctl (tty, TIOCSETN, &shell_tty_info);
- ! # endif
- #endif
- close (tty);
- }
- --- 354,367 ----
- #if defined (_POSIX_VERSION)
- tcsetattr (tty, TCSADRAIN, &shell_tty_info);
- #else
- ! /**
- ! ** (sjk)++ Set the terminal parameters ala USG if on an Atari ST
- ! **/
- ! #if defined (USG) || defined(atarist)
- ioctl (tty, TIOCSETN, &shell_tty_info);
- ! #else
- ! ioctl (tty, TCSETAW, &shell_tty_info); /* Wait for output, no flush */
- ! #endif
- #endif
- close (tty);
- }
- diff -c ./parse.y /home/scott/work/st-bash-1.10/src/parse.y
- *** ./parse.y Thu Oct 3 17:17:09 1991
- --- /home/scott/work/st-bash-1.10/src/parse.y Wed Oct 23 19:27:08 1991
- ***************
- *** 677,682 ****
- --- 677,686 ----
- /* */
- /* **************************************************************** */
-
- + #if defined(atarist)
- + extern int console_read_byte();
- + #endif
- +
- int
- yy_stream_get ()
- {
- ***************
- *** 684,690 ****
- --- 688,701 ----
- #if defined (USG)
- return (sysv_getc (yy_input_dev));
- #else
- + /**
- + ** (sjk)++ Atari ST hack for input
- + **/
- + #if !defined(atarist)
- return (getc (yy_input_dev));
- + #else
- + return(console_read_byte(fileno(yy_input_dev)));
- + #endif
- #endif /* USG */
- else return (EOF);
- }
- ***************
- *** 1353,1358 ****
- --- 1364,1374 ----
- {
- if (interactive && (!current_token || current_token == '\n'))
- {
- +
- + /**
- + ** (sjk)++
- + **/
- + #if !defined(atarist)
- /* Before we print a prompt, we might have to check mailboxes.
- We do this only if it is time to do so. Notice that only here
- is the mail alarm reset; nothing takes place in check_mail ()
- ***************
- *** 1362,1367 ****
- --- 1378,1384 ----
- check_mail ();
- reset_mail_timer ();
- }
- + #endif
-
- /* Allow the execution of a random command just before the printing
- of each primary prompt. If the shell variable PROMPT_COMMAND
- diff -c ./shell.c /home/scott/work/st-bash-1.10/src/shell.c
- *** ./shell.c Thu Oct 3 16:39:06 1991
- --- /home/scott/work/st-bash-1.10/src/shell.c Wed Oct 23 19:17:26 1991
- ***************
- *** 135,142 ****
- --- 135,150 ----
-
- /* The environment at the top-level REP loop. We use this in the case of
- error return. */
- + /**
- + ** (sjk)++ catch is defined in setjmp.h on the Atari ST
- + **/
- + #if !defined(atarist)
- jmp_buf top_level, catch;
- + #else
- + jmp_buf top_level;
- + #endif
-
- +
- /* Non-zero is the recursion depth for commands. */
- int indirection_level = 0;
-
- ***************
- *** 240,245 ****
- --- 248,263 ----
- }
- #endif /* NeXT */
-
- + /**
- + ** (sjk)++ Set the default unixmode as we cannot assume that the variable
- + ** is set upon entering the shell.
- + **/
- + #if defined(atarist)
- + if (!getenv("UNIXMODE")) _set_unixmode("/.,rCLAHdb");
- + else _set_unixmode(getenv("UNIXMODE"));
- + #endif
- +
- +
- /* Wait forever if we are debugging a login shell. */
- while (debugging_login_shell);
-
- ***************
- *** 602,607 ****
- --- 620,629 ----
- /* Do the things that should be done only for interactive shells. */
- if (interactive_shell)
- {
- + /**
- + ** (sjk)++ Remove all host/mail code on the Atari ST
- + **/
- + #if !defined(atarist)
- /* Set up for checking for presence of mail. */
- #if defined (USG)
- /* Under System V, we can only tell if you have mail if the
- ***************
- *** 625,630 ****
- --- 647,653 ----
- }
-
- reset_mail_timer ();
- + #endif
-
- change_flag_char ('i', FLAG_ON);
-
- ***************
- *** 1015,1021 ****
- /* Only do timeouts if interactive. */
- if (interactive)
- {
- ! tmout_var = find_variable ("TMOUT");
-
- if (tmout_var && tmout_var->value)
- {
- --- 1038,1048 ----
- /* Only do timeouts if interactive. */
- if (interactive)
- {
- ! /**
- ! ** (sjk)++ There is no nead to do an interative timeout on the Atari ST
- ! **/
- ! #if !defined(atarist)
- ! tmout_var = find_variable ("TMOUT");
-
- if (tmout_var && tmout_var->value)
- {
- ***************
- *** 1026,1031 ****
- --- 1053,1059 ----
- alarm (tmout_len);
- }
- }
- + #endif
- }
-
- QUIT;
- ***************
- *** 1032,1042 ****
- --- 1060,1075 ----
-
- result = parse_command ();
-
- + /**
- + ** (sjk)++ There is no need for an interactive timeout on the Atari ST
- + **/
- + #if !defined(atarist)
- if (interactive && tmout_var && (tmout_len > 0))
- {
- alarm(0);
- signal (SIGALRM, old_alrm);
- }
- + #endif
- return (result);
- }
-
- ***************
- *** 1376,1382 ****
- sigint_sighandler (sig)
- int sig;
- {
- ! #if defined (USG) && !defined (_POSIX_VERSION)
- signal (sig, sigint_sighandler);
- #endif
-
- --- 1409,1418 ----
- sigint_sighandler (sig)
- int sig;
- {
- ! /**
- ! ** (sjk)++ Offer up the signal ala USG on the Atari ST
- ! **/
- ! #if (defined (USG) && !defined(_POSIX_VERSION)) || defined(atarist)
- signal (sig, sigint_sighandler);
- #endif
-
- diff -c ./shell.h /home/scott/work/st-bash-1.10/src/shell.h
- *** ./shell.h Mon Sep 30 05:42:53 1991
- --- /home/scott/work/st-bash-1.10/src/shell.h Wed Oct 23 16:30:17 1991
- ***************
- *** 18,24 ****
- --- 18,31 ----
- /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
-
- #include <setjmp.h>
- + /**
- + ** (sjk)++ catch is defined in setjmp.h on the Atari ST
- + **/
- + #if !defined(atarist)
- extern jmp_buf top_level, catch;
- + #else
- + extern jmp_buf top_level;
- + #endif
-
- #define NOT_JUMPED 0 /* Not returning from a longjmp. */
- #define FORCE_EOF 1 /* We want to stop parsing. */
- diff -c ./subst.c /home/scott/work/st-bash-1.10/src/subst.c
- *** ./subst.c Thu Oct 3 16:37:36 1991
- --- /home/scott/work/st-bash-1.10/src/subst.c Wed Oct 23 19:26:36 1991
- ***************
- *** 2694,2700 ****
- continue. In the common case, at least when running shell
- scripts, this will degenerate to a bunch of calls to `index',
- and then what is basically the body of copy_word_list. */
- ! if (index (tlist->word->word, '{') != NULL)
- {
- expansions = brace_expand (tlist->word->word);
-
- --- 2694,2700 ----
- continue. In the common case, at least when running shell
- scripts, this will degenerate to a bunch of calls to `index',
- and then what is basically the body of copy_word_list. */
- ! if (index ((tlist->word->word), '{') != (int)NULL)
- {
- expansions = brace_expand (tlist->word->word);
-
- ***************
- *** 2955,2963 ****
-
- /* The functions that get called. */
- int
- ! sv_path (), sv_mail (), sv_terminal (), sv_histsize (), sv_histfilesize (),
- sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
- ! sv_nolinks (), sv_hostname_completion_file (), sv_history_control (),
- sv_noclobber (), sv_allow_null_glob_expansion ();
-
- #if defined (GETOPTS_BUILTIN)
- --- 2955,2971 ----
-
- /* The functions that get called. */
- int
- ! sv_path (),
- ! #if !defined(atarist)
- ! sv_mail (),
- ! #endif
- ! sv_terminal (), sv_histsize (), sv_histfilesize (),
- sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
- ! sv_nolinks (),
- ! #if !defined(atarist)
- ! sv_hostname_completion_file (),
- ! #endif
- ! sv_history_control (),
- sv_noclobber (), sv_allow_null_glob_expansion ();
-
- #if defined (GETOPTS_BUILTIN)
- ***************
- *** 2973,2981 ****
- --- 2981,2994 ----
- Function *function;
- } special_vars[] = {
- { "PATH", sv_path },
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- { "MAIL", sv_mail },
- { "MAILPATH", sv_mail },
- { "MAILCHECK", sv_mail },
- + #endif
- { "TERMCAP", sv_terminal },
- { "TERM", sv_terminal },
- { "HISTSIZE", sv_histsize },
- ***************
- *** 2995,3001 ****
- --- 3008,3019 ----
- { "allow_null_glob_expansion", sv_allow_null_glob_expansion },
- { "histchars", sv_histchars },
- { "nolinks", sv_nolinks },
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- { "hostname_completion_file", sv_hostname_completion_file },
- + #endif
- { "history_control", sv_history_control },
- { "noclobber", sv_noclobber },
- { (char *)0x00, (Function *)0x00 }
- ***************
- *** 3045,3050 ****
- --- 3063,3072 ----
-
- /* What to do just after one of the MAILxxxx variables has changed. NAME
- is the name of the variable. */
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- sv_mail (name)
- char *name;
- {
- ***************
- *** 3063,3068 ****
- --- 3085,3091 ----
- }
- }
- }
- + #endif
-
- /* What to do just after one of the TERMxxx variables has changed.
- If we are an interactive shell, then try to reset the terminal
- ***************
- *** 3261,3266 ****
- --- 3284,3293 ----
- v->attributes |= (att_readonly | att_integer);
- }
-
- + /**
- + ** (sjk)++ Remove all host/mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- sv_hostname_completion_file (name)
- char *name;
- {
- ***************
- *** 3268,3273 ****
- --- 3295,3301 ----
-
- hostname_list_initialized = 0;
- }
- + #endif
-
- sv_allow_null_glob_expansion (name)
- char *name;
- diff -c ./trap.c /home/scott/work/st-bash-1.10/src/trap.c
- *** ./trap.c Thu Oct 3 16:33:48 1991
- --- /home/scott/work/st-bash-1.10/src/trap.c Wed Oct 23 19:12:53 1991
- ***************
- *** 286,294 ****
- --- 286,299 ----
- /* Non-zero when we catch a trapped signal. */
- static int catch_flag = 0;
-
- + /**
- + ** (sjk)++ NO BSD type signals on the Atari ST1
- + **/
- + #if !defined(atarist)
- #if !defined (USG) && !defined (USGr4)
- #define HAVE_BSD_SIGNALS
- #endif
- + #endif
-
- run_pending_traps ()
- {
- ***************
- *** 437,446 ****
- ignore_signal (sig)
- int sig;
- {
- - #ifdef SIGCHLD
- /* Don't allow the SIGCHLD signal catcher to be overridden. */
- if (sig != SIGCHLD)
- - #endif
- signal (sig, SIG_IGN);
- change_signal (sig, (char *)IGNORE_SIG);
- }
- --- 442,449 ----
- diff -c ./variables.c /home/scott/work/st-bash-1.10/src/variables.c
- *** ./variables.c Sun Jul 28 16:24:29 1991
- --- /home/scott/work/st-bash-1.10/src/variables.c Wed Oct 23 19:22:59 1991
- ***************
- *** 66,76 ****
- --- 66,81 ----
- /* The list of variables that may not be unset in this shell. */
- char **non_unsettable_vars = (char **)NULL;
-
- + /**
- + ** (sjk)++ Remove all mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- #if defined (USG)
- #define DEFAULT_MAIL_PATH "/usr/mail/"
- #else
- #define DEFAULT_MAIL_PATH "/usr/spool/mail/"
- #endif
- + #endif
-
- /* Some forward declarations. */
- SHELL_VAR *set_if_not (); /* returns new or existing entry */
- ***************
- *** 138,143 ****
- --- 143,159 ----
-
- /* Now make our own defaults in case the vars that we think are
- important are missing. */
- +
- + /**
- + ** (sjk)++ We set some default environment variables, provided
- + ** that they are not defined.
- + **/
- + #if defined(atarist)
- + set_if_not("UNIXMODE","/.,rCLAHdb"); /* Set a default Unixmode */
- + set_if_not("HOME","/dev/A");
- + set_if_not("TERM","vt52");
- + #endif
- +
- temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
- set_auto_export (temp_var);
-
- ***************
- *** 152,157 ****
- --- 168,177 ----
- temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
- set_auto_export (temp_var);
-
- + /**
- + ** (sjk)++ Remove all mail references on the Atari ST
- + **/
- + #if !defined(atarist)
- /* Default MAILPATH, and MAILCHECK. */
- set_if_not ("MAILCHECK", "60");
- if ((get_string_value ("MAIL") == (char *)NULL) &&
- ***************
- *** 168,173 ****
- --- 188,194 ----
- bind_variable ("MAILPATH", tem);
- free (tem);
- }
- + #endif
-
- /* Set up $PWD. */
- {
- ***************
- *** 282,288 ****
- set_if_not ("HISTFILE", tem);
- free (tem);
-
- ! set_if_not ("HISTSIZE", "500");
- sv_histsize ("HISTSIZE");
- }
-
- --- 303,309 ----
- set_if_not ("HISTFILE", tem);
- free (tem);
-
- ! set_if_not ("HISTSIZE", "50");
- sv_histsize ("HISTSIZE");
- }
-
- ***************
- *** 352,358 ****
- return;
-
- non_unsettable_vars = (char **)
- ! xrealloc (non_unsettable_vars, (2 + i) * sizeof (char *));
- non_unsettable_vars[i] = savestring (name);
- non_unsettable_vars[i + 1] = (char *)NULL;
- }
- --- 373,379 ----
- return;
-
- non_unsettable_vars = (char **)
- ! xrealloc ((char *)non_unsettable_vars, (2 + i) * sizeof (char *));
- non_unsettable_vars[i] = savestring (name);
- non_unsettable_vars[i + 1] = (char *)NULL;
- }
- ***************
- *** 395,401 ****
- {
- if (list_index + 1 >= list_size)
- list = (SHELL_VAR **)
- ! xrealloc (list, (list_size += 20) * sizeof (SHELL_VAR *));
-
- list[list_index++] = var;
- list[list_index] = (SHELL_VAR *)NULL;
- --- 416,422 ----
- {
- if (list_index + 1 >= list_size)
- list = (SHELL_VAR **)
- ! xrealloc ((char *)list, (list_size += 20) * sizeof (SHELL_VAR *));
-
- list[list_index++] = var;
- list[list_index] = (SHELL_VAR *)NULL;
- ***************
- *** 1365,1371 ****
-
- size = array_len (temporary_env);
- temporary_env = (char **)
- ! xrealloc (temporary_env, (size + 2) * (sizeof (char *)));
-
- temporary_env[size] = (temp);
- temporary_env[size + 1] = (char *)NULL;
- --- 1386,1392 ----
-
- size = array_len (temporary_env);
- temporary_env = (char **)
- ! xrealloc ((char *)temporary_env, (size + 2) * (sizeof (char *)));
-
- temporary_env[size] = (temp);
- temporary_env[size + 1] = (char *)NULL;
- ***************
- *** 1557,1563 ****
- #if !defined (NeXT)
- char *
- getenv (name)
- ! char *name;
- {
- SHELL_VAR *var = find_tempenv_variable (name);
-
- --- 1578,1584 ----
- #if !defined (NeXT)
- char *
- getenv (name)
- ! const char *name;
- {
- SHELL_VAR *var = find_tempenv_variable (name);
-