🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Andy Fyfe Sat, 24 Jun 1989 02:23
continuing trouble with bash 1.01
#54
Author: Andy Fyfe
Date: Sat, 24 Jun 1989 02:23
132 lines
3252 bytes
This is running on a sun3, sunos3.5.

1.
    If you hit break, old_sigwinch will wind up being set to
    rl_handle_sigwinch.  If you now resize the window to get a SIGWINCH,
    bash will fall into an infinite recursion.  (A break will stop it.)
    The enclosed patch merely circumvents this by preventing the recursion
    rather than fixing the problem.

2.
    The builtin test still has the wrong precedence for -a and -o.  The
    diffs enclosed correct this to give -a a higher precedence than -o.

diff -c2 save/readline.c ./readline.c
*** save/readline.c	Fri Jun 23 13:33:16 1989
--- ./readline.c	Fri Jun 23 14:04:35 1989
***************
*** 267,270 ****
--- 267,273 ----
      }
  
+   if (old_sigwinch == rl_handle_sigwinch)	/* badness! */
+     return;
+ 
    if (old_sigwinch && old_sigwinch != (Function *)SIG_IGN &&
        old_sigwinch != (Function *)SIG_DFL)
diff -c2 save/test.c ./test.c
*** save/test.c	Fri Jun 23 13:26:18 1989
--- ./test.c	Fri Jun 23 14:04:36 1989
***************
*** 600,609 ****
  
  /*
!  * or:
!  *	or '-o' term
   *	term
   */
  static int
! or ()
  {
    auto int value;
--- 600,609 ----
  
  /*
!  * and:
!  *	and '-a' term
   *	term
   */
  static int
! and ()
  {
    auto int value;
***************
*** 610,616 ****
  
    value = term ();
!   while (pos < argc && '-' == argv[pos][0] && 'o' == argv[pos][1] && '\000' == argv[pos][2]) {
      advance(0);
!     value = TRUTH_OR (value, term ());
    }
    return (TRUE == value);
--- 610,616 ----
  
    value = term ();
!   while (pos < argc && '-' == argv[pos][0] && 'a' == argv[pos][1] && '\000' == argv[pos][2]) {
      advance(0);
!     value = TRUTH_AND (value, term ());
    }
    return (TRUE == value);
***************
*** 618,634 ****
  
  /*
!  * and:
!  *	and '-a' or
!  *	or
   */
  static int
! and()
  {
    auto int value;
  
!   value = or();
!   while (pos < argc && '-' == argv[pos][0] && 'a' == argv[pos][1] && '\000' == argv[pos][2]) {
!     advance(1);
!     value = TRUTH_AND (value, or());
    }
    return (TRUE == value);
--- 618,634 ----
  
  /*
!  * or:
!  *	or '-o' and
!  *	and
   */
  static int
! or()
  {
    auto int value;
  
!   value = and();
!   while (pos < argc && '-' == argv[pos][0] && 'o' == argv[pos][1] && '\000' == argv[pos][2]) {
!     advance(0);
!     value = TRUTH_OR (value, and());
    }
    return (TRUE == value);
***************
*** 638,642 ****
   * expr:
   *	'!' expr
!  *	and
   */
  int
--- 638,642 ----
   * expr:
   *	'!' expr
!  *	or
   */
  int
***************
*** 656,660 ****
      value ^= (TRUE);
    }
!   return value ^ and();		/* Same with this. */
  }
  
--- 656,660 ----
      value ^= (TRUE);
    }
!   return value ^ or();		/* Same with this. */
  }
  
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads