zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <A.Main@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: Updated history expansion patch
Date: Wed, 5 Jul 1995 14:34:31 +0100 (BST)	[thread overview]
Message-ID: <15723.199507051334@stone.dcs.warwick.ac.uk> (raw)

I thought I had sent this to the list, but it hasn't appeared here.
Sorry if you get it twice.

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

The patch below is an updated version of my history reference
infinite-loop bug fix (message 30), which wasn't in beta10.  This
version of the patch is made after the history/input patch and my
completion patch, but should only depend on the former.  I think it
will apply with fuzz even if that patch hasn't been applied.

The update is not a change in functionality; I simply found that the
old patch won't apply to the new source.

 -zefram

      *** Src/zle_tricky.c.old	Wed Jul  5 02:37:32 1995
      --- Src/zle_tricky.c	Wed Jul  5 02:50:56 1995
      ***************
      *** 957,963 ****
        	    im &= ~2;
        
        	/* We reached the end. */
      ! 	if (tok == ENDINPUT)
        	    break;
        	if (tok == BAR || tok == AMPER || tok == BARAMP ||
        	    tok == DBAR || tok == DAMPER)
      --- 957,963 ----
        	    im &= ~2;
        
        	/* We reached the end. */
      ! 	if (tok == ENDINPUT || tok == LEXERR)
        	    break;
        	if (tok == BAR || tok == AMPER || tok == BARAMP ||
        	    tok == DBAR || tok == DAMPER)
      ***************
      *** 1009,1017 ****
        	if (clwpos == i++ && addedx)
        	    chuck(&clwords[i - 1][((cs - wb - 1) >= sl) ?
        				  (sl - 1) : (cs - wb - 1)]);
      !     }
      !     while (tok != LEXERR && tok != ENDINPUT &&
      ! 	   (tok != SEPER || (zleparse && !tt0)));
            /* Calculate the number of words stored in the clwords array. */
            clwnum = (tt || !i) ? i : i - 1;
            zsfree(clwords[clwnum]);
      --- 1009,1016 ----
        	if (clwpos == i++ && addedx)
        	    chuck(&clwords[i - 1][((cs - wb - 1) >= sl) ?
        				  (sl - 1) : (cs - wb - 1)]);
      !     } while (tok != LEXERR && tok != ENDINPUT &&
      ! 	(tok != SEPER || (zleparse && !tt0)));
            /* Calculate the number of words stored in the clwords array. */
            clwnum = (tt || !i) ? i : i - 1;
            zsfree(clwords[clwnum]);
      ***************
      *** 1020,1026 ****
            lincmd = cp;
            linredir = rd;
        
      !     if (!t0 || t0 == ENDINPUT) {
        	/* There was no word (empty line). */
        	s = ztrdup("");
        	we = wb = cs;
      --- 1019,1025 ----
            lincmd = cp;
            linredir = rd;
        
      !     if (!t0 || t0 == ENDINPUT || t0 == LEXERR) {
        	/* There was no word (empty line). */
        	s = ztrdup("");
        	we = wb = cs;
      ***************
      *** 2930,2942 ****
        	noaliases = 1;
        	do {
        	    ctxtlex();
      ! 	    if (tok == ENDINPUT)
        		break;
        	    if (!first && tokstr && *tokstr)
        		addlinknode(foo, ztrdup(tokstr));
        	    first = 0;
      ! 	}
      ! 	while (tok != ENDINPUT);
        	noaliases = 0;
        	strinend();
        	inpop();
      --- 2929,2940 ----
        	noaliases = 1;
        	do {
        	    ctxtlex();
      ! 	    if (tok == ENDINPUT || tok == LEXERR)
        		break;
        	    if (!first && tokstr && *tokstr)
        		addlinknode(foo, ztrdup(tokstr));
        	    first = 0;
      ! 	} while (tok != ENDINPUT && tok != LEXERR);
        	noaliases = 0;
        	strinend();
        	inpop();
      ***************
      *** 3795,3802 ****
            noerrs = 1;
            do {
        	ctxtlex();
      !     }
      !     while (tok != ENDINPUT && zleparse);
            noerrs = ne;
            noaliases = 0;
            popheap();
      --- 3793,3799 ----
            noerrs = 1;
            do {
        	ctxtlex();
      !     } while (tok != ENDINPUT && tok != LEXERR && zleparse);
            noerrs = ne;
            noaliases = 0;
            popheap();
      ***************
      *** 3869,3875 ****
            do {
        	curlincmd = incmdpos;
        	ctxtlex();
      ! 	if (tok == ENDINPUT)
        	    break;
        	if (tok == STRING && curlincmd) {
        	    zsfree(s);
      --- 3866,3872 ----
            do {
        	curlincmd = incmdpos;
        	ctxtlex();
      ! 	if (tok == ENDINPUT || tok == LEXERR)
        	    break;
        	if (tok == STRING && curlincmd) {
        	    zsfree(s);
      ***************
      *** 3878,3884 ****
        	    cmdwe = ll + 1 - inbufct;
        	}
            }
      !     while (tok != ENDINPUT && zleparse);
            popheap();
            strinend();
            inpop();
      --- 3875,3881 ----
        	    cmdwe = ll + 1 - inbufct;
        	}
            }
      !     while (tok != ENDINPUT && tok != LEXERR && zleparse);
            popheap();
            strinend();
            inpop();
      *** Src/zle_tricky.c.old	Wed Jul  5 02:37:32 1995
      --- Src/zle_tricky.c	Wed Jul  5 02:52:03 1995
      ***************
      *** 957,963 ****
        	    im &= ~2;
        
        	/* We reached the end. */
      ! 	if (tok == ENDINPUT)
        	    break;
        	if (tok == BAR || tok == AMPER || tok == BARAMP ||
        	    tok == DBAR || tok == DAMPER)
      --- 957,963 ----
        	    im &= ~2;
        
        	/* We reached the end. */
      ! 	if (tok == ENDINPUT || tok == LEXERR)
        	    break;
        	if (tok == BAR || tok == AMPER || tok == BARAMP ||
        	    tok == DBAR || tok == DAMPER)
      ***************
      *** 1009,1017 ****
        	if (clwpos == i++ && addedx)
        	    chuck(&clwords[i - 1][((cs - wb - 1) >= sl) ?
        				  (sl - 1) : (cs - wb - 1)]);
      !     }
      !     while (tok != LEXERR && tok != ENDINPUT &&
      ! 	   (tok != SEPER || (zleparse && !tt0)));
            /* Calculate the number of words stored in the clwords array. */
            clwnum = (tt || !i) ? i : i - 1;
            zsfree(clwords[clwnum]);
      --- 1009,1016 ----
        	if (clwpos == i++ && addedx)
        	    chuck(&clwords[i - 1][((cs - wb - 1) >= sl) ?
        				  (sl - 1) : (cs - wb - 1)]);
      !     } while (tok != LEXERR && tok != ENDINPUT &&
      ! 	(tok != SEPER || (zleparse && !tt0)));
            /* Calculate the number of words stored in the clwords array. */
            clwnum = (tt || !i) ? i : i - 1;
            zsfree(clwords[clwnum]);
      ***************
      *** 1020,1026 ****
            lincmd = cp;
            linredir = rd;
        
      !     if (!t0 || t0 == ENDINPUT) {
        	/* There was no word (empty line). */
        	s = ztrdup("");
        	we = wb = cs;
      --- 1019,1025 ----
            lincmd = cp;
            linredir = rd;
        
      !     if (!t0 || t0 == ENDINPUT || t0 == LEXERR) {
        	/* There was no word (empty line). */
        	s = ztrdup("");
        	we = wb = cs;
      ***************
      *** 2930,2942 ****
        	noaliases = 1;
        	do {
        	    ctxtlex();
      ! 	    if (tok == ENDINPUT)
        		break;
        	    if (!first && tokstr && *tokstr)
        		addlinknode(foo, ztrdup(tokstr));
        	    first = 0;
      ! 	}
      ! 	while (tok != ENDINPUT);
        	noaliases = 0;
        	strinend();
        	inpop();
      --- 2929,2940 ----
        	noaliases = 1;
        	do {
        	    ctxtlex();
      ! 	    if (tok == ENDINPUT || tok == LEXERR)
        		break;
        	    if (!first && tokstr && *tokstr)
        		addlinknode(foo, ztrdup(tokstr));
        	    first = 0;
      ! 	} while (tok != ENDINPUT && tok != LEXERR);
        	noaliases = 0;
        	strinend();
        	inpop();
      ***************
      *** 3795,3802 ****
            noerrs = 1;
            do {
        	ctxtlex();
      !     }
      !     while (tok != ENDINPUT && zleparse);
            noerrs = ne;
            noaliases = 0;
            popheap();
      --- 3793,3799 ----
            noerrs = 1;
            do {
        	ctxtlex();
      !     } while (tok != ENDINPUT && tok != LEXERR && zleparse);
            noerrs = ne;
            noaliases = 0;
            popheap();
      ***************
      *** 3869,3875 ****
            do {
        	curlincmd = incmdpos;
        	ctxtlex();
      ! 	if (tok == ENDINPUT)
        	    break;
        	if (tok == STRING && curlincmd) {
        	    zsfree(s);
      --- 3866,3872 ----
            do {
        	curlincmd = incmdpos;
        	ctxtlex();
      ! 	if (tok == ENDINPUT || tok == LEXERR)
        	    break;
        	if (tok == STRING && curlincmd) {
        	    zsfree(s);
      ***************
      *** 3877,3884 ****
        	    cmdwb = ll - wordbeg;
        	    cmdwe = ll + 1 - inbufct;
        	}
      !     }
      !     while (tok != ENDINPUT && zleparse);
            popheap();
            strinend();
            inpop();
      --- 3874,3880 ----
        	    cmdwb = ll - wordbeg;
        	    cmdwe = ll + 1 - inbufct;
        	}
      !     } while (tok != ENDINPUT && tok != LEXERR && zleparse);
            popheap();
            strinend();
            inpop();

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQBVAgUBL/nwYWWJ8JfKi+e9AQF6zQH/QMzkmp0DWZU+e+3dnbeBv6duj/nbtogo
S3TKNlTiMulXsF32NZMKsr0ThvXYXa7i8xmOw1OZ1zz4tOGciM6Bxw==
=Bop0
-----END PGP SIGNATURE-----


                 reply	other threads:[~1995-07-05 13:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15723.199507051334@stone.dcs.warwick.ac.uk \
    --to=a.main@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).