zsh-workers
 help / color / mirror / code / Atom feed
* 3 bugs for zsh3.0.0
@ 1997-03-07 19:46 Huy Le
  1997-03-10 10:22 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Huy Le @ 1997-03-07 19:46 UTC (permalink / raw)
  To: zsh-workers

Hi, only tried these out HP-UX A.09.01

1) Segmentation fault on:
a="+-------------------------------------------------------+  Under
|            | HYDRO    AUTO     |    Printer | SHRED   |  Graduate
|            |                   | Stereo     | paulvig |  Computer
| MINCE                                                 |  Science
|-----------     -----------------------     -----------|
| LUST             DICE     | WRATH            PULP     |  166 Jorgensen
|                           |                           |  (Building 80)
|-----------     -----------+-----------     -----------|
| AVARICE          FRAPPE   | PRIDE            LIQUEFY  |  (818) 395-2028
|                           |                           |  Door combo: 34-12
|-----------     -----------+-----------     -----------|  Root P/W: |<R@|<
| WHIP             PUREE    | CHOP             CRUSH    |
|                           |                           |  California
|-----------     -----------+-----------     -----------|  Institute of
| GLUTTONY         BEAT     | BLEND          SLO        |  Technology  
|                           |                TH         |  1201 E. California
+-----------     -----------------------     -----------+  Pasadena, CA 91125
|                                                        
|                                                          CS Machine Room
|                                                       +  76 Jorgensen
|       HEDONO   | PHOBO         CLAUSTRO |             |  +----------+
|                |                        |             |  | OFF      |
|     -----------+-----------  -----------+-----------  |  |          |
|       ARACHNO  | AMATHO        XENO     | MYXO        |  | ENVY     |
|       technot  |                        |             |  |          |
|                                                       |  +----------+  
|       MONO     | ACRO          13       | AGORA       |
|                | liubo                  |             |
|     -----------+-----------  -----------+-----------  |
|       TAPHE    | NECRO         PHOTO    | PYRO        |
|                |                        | kkant       |
|                                                       |
+-------------------------------+=========+-------------+"
b="$a"
[[ "$a" != "$b" ]] && echo yes


2) bus error on:
local undefined
echo ${undefined#crap}


3) zsh: error on TTY read: bad file number
echo `echo \`vared -c result\` `


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 3 bugs for zsh3.0.0
  1997-03-07 19:46 3 bugs for zsh3.0.0 Huy Le
@ 1997-03-10 10:22 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 1997-03-10 10:22 UTC (permalink / raw)
  To: Huy Le, Zsh hackers list

Huy Le wrote:
> 3) zsh: error on TTY read: bad file number
> echo `echo \`vared -c result\` `

I couldn't reproduce the other two but the problem here is simply that
vared only works in the top level shell where the line editor is
running but doesn't bother to test so the error message is a bit
indecipherable.

I don't think there's anything in principle stopping it from running
vared in a subshell, but the logic to do with entersubsh() and the
variables it sets would have to be changed... it's a similar problem
to `jobs' not working in a subshell even though there's no objection
in principle to listing them there.

*** Src/Zle/zle_main.c~	Tue Feb 18 09:39:53 1997
--- Src/Zle/zle_main.c	Mon Mar 10 11:12:01 1997
***************
*** 582,587 ****
--- 582,592 ----
  	args++;
      }
  
+     if (SHTTY == -1) {
+ 	zwarnnam(name, "not in interactive shell", NULL, 0);
+ 	return 1;
+     }
+ 
      /* check we have a parameter name */
      if (!*args) {
  	zwarnnam(name, "missing variable", NULL, 0);



-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 3 bugs for zsh3.0.0
@ 1997-03-17 18:18 Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 1997-03-17 18:18 UTC (permalink / raw)
  To: zsh-workers

-----BEGIN PGP SIGNED MESSAGE-----

>2) bus error on:
>local undefined
>echo ${undefined#crap}

The parameter code, when asked for the value of an undefined parameter,
is returning a constant empty string.  The glob code assumes that it can
write into any parameter value.  The real solution would be to stop the
glob code writing into strings that it shouldn't modify, and I'd like
to do this as part of making zsh const-correct.  But for the moment it
will suffice to make the parameter code return an allocated empty string,
as it already does in some cases.

 -zefram

      *** Src/params.c	1997/03/17 00:38:10	1.36
      --- Src/params.c	1997/03/17 13:16:13
      ***************
      *** 677,685 ****
            char *s, **ss;
            static char buf[(SIZEOF_LONG * 8) + 4];
        
      -     if (!v)
      - 	return "";
            HEAPALLOC {
        	if (v->inv) {
        	    sprintf(buf, "%d", v->a);
        	    s = dupstring(buf);
      --- 677,685 ----
            char *s, **ss;
            static char buf[(SIZEOF_LONG * 8) + 4];
        
            HEAPALLOC {
      + 	if (!v)
      + 	    return dupstring("");
        	if (v->inv) {
        	    sprintf(buf, "%d", v->a);
        	    s = dupstring(buf);
      ***************
      *** 694,700 ****
        		ss = v->pm->gets.afn(v->pm);
        		if (v->a < 0)
        		    v->a += arrlen(ss);
      ! 		s = (v->a >= arrlen(ss) || v->a < 0) ? "" : ss[v->a];
        	    }
        	    LASTALLOC_RETURN s;
        	case PM_INTEGER:
      --- 694,700 ----
        		ss = v->pm->gets.afn(v->pm);
        		if (v->a < 0)
        		    v->a += arrlen(ss);
      ! 		s = (v->a >= arrlen(ss) || v->a < 0) ? dupstring("") : ss[v->a];
        	    }
        	    LASTALLOC_RETURN s;
        	case PM_INTEGER:
      ***************
      *** 1188,1194 ****
        char *
        strgetfn(Param pm)
        {
      !     return pm->u.str ? pm->u.str : "";
        }
        
        /* Function to set value of a scalar (string) parameter */
      --- 1188,1194 ----
        char *
        strgetfn(Param pm)
        {
      !     return pm->u.str ? pm->u.str : hcalloc(1);
        }
        
        /* Function to set value of a scalar (string) parameter */
      ***************
      *** 1314,1320 ****
            char *s = *((char **)pm->data);
        
            if (!s)
      ! 	return "";
            return s;
        }
        
      --- 1314,1320 ----
            char *s = *((char **)pm->data);
        
            if (!s)
      ! 	return hcalloc(1);
            return s;
        }
        

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: ascii

iQCVAwUBMy1FZXD/+HJTpU/hAQE5kQP/aYmYQVr7bUhFhdjissNyzeFn1Bb6DpYG
Hs7X+VpQut8RkqoKXhe9Dqy3DW2xr1DhW9anNhOHkYf5Aqo0KhlNuB1stPrpi/tT
4pLIjxZUuGhQv3XShafyaxJoxGwWSnfXgBNa47zNVvsJAfMGs7UD+FR0KBAc7PXl
uPehnmaqnHg=
=ooJu
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-03-17 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-07 19:46 3 bugs for zsh3.0.0 Huy Le
1997-03-10 10:22 ` Peter Stephenson
1997-03-17 18:18 Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).