Subject: Re: [ast-users] typeset -r COLUMNS # triggers endless loop...
--------

> $ typeset -r COLUMNS
> ... locks the shell in an endless loop which prints:
> -- snip --
> $ ksh93: COLUMNS: is read only
> $ ksh93: COLUMNS: is read only
> $ ksh93: COLUMNS: is read only
> $ ksh93: COLUMNS: is read only
> $ ksh93: COLUMNS: is read only
> $ ksh93: COLUMNS: is read only
> -- snip --
> etc.
> 
> AFAIK the expected behaviour may be that the "set" discipline method for
> "COLUMNS"+"LINES" stops setting these variables if they are marked as
> read-only... or am I wrong ?
> 
> 

This is a bug.  Here is a context diff for a fix.

*** old/sh/fault.c      Fri Nov 30 14:46:01 2007
--- newsh/fault.c       Thu Mar  6 08:58:05 2008
***************
*** 56,64 ****
                int32_t v;
                astwinsize(2,&rows,&cols);
                if(v = cols)
!                       nv_putval(COLUMNS, (char*)&v, NV_INT32);
                if(v = rows)
!                       nv_putval(LINES, (char*)&v, NV_INT32);
        }
  #endif  /* SIGWINCH */
        if(shp->savesig)
--- 56,64 ----
                int32_t v;
                astwinsize(2,&rows,&cols);
                if(v = cols)
!                       nv_putval(COLUMNS, (char*)&v, NV_INT32|NV_RDONLY);
                if(v = rows)
!                       nv_putval(LINES, (char*)&v, NV_INT32|NV_RDONLY);
        }
  #endif  /* SIGWINCH */
        if(shp->savesig)

David Korn
[EMAIL PROTECTED]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to