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-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).