zsh-workers
 help / color / mirror / code / Atom feed
* Yikes! Missing Patches in zsh-2.6-beta14...
@ 1996-04-16 19:16 Eskandar Ensafi
  1996-04-16 19:57 ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Eskandar Ensafi @ 1996-04-16 19:16 UTC (permalink / raw)
  To: zsh-workers


Hello,

Zoltan submitted some patches when zsh-2.6 was in beta12 and beta13.
Neither made it into beta13 or beta14.  Here are the patches (one is
slightly modified).  They address two problems:

	(1) Call init_term() if ``print -P'' is being used (otherwise,
	    escape sequences of the form '%B...%b' do not work in shell
	    scripts or noninteractive shells.

	(2) Fix crashes when using PROMPT_SUBST.  Recall the following
	    from Zoltan's message of 01-Mar-96:
	    
	    "[... after !! history expansion] lex.c calls the spell
	    checker on [a command] before the alias stack is popped.
	    The spell checker sees that [a misspelled command] should
	    be corrected, and prints the spelling correction prompt,
	    which then calls lexsave/lexrestore [...].  And the later
	    lexrestore calls clearalstack() which coredumps because of
	    the NULL entry that history expansion put there [...]"

The patches are included below.

- Eskandar


*** builtin.c.orig	Tue Apr 16 10:14:49 1996
--- builtin.c	Tue Apr 16 10:16:30 1996
***************
*** 4080,4087 ****
  	if (ops['D'])
  	    fprintdir(arg, fout);
  	else {
! 	    if (ops['P'])
  		arg = putprompt(arg, &len, NULL, 0);
  	    fwrite(arg, len, 1, fout);
  	    if(ops['P'])
  		free(arg);
--- 4080,4090 ----
  	if (ops['D'])
  	    fprintdir(arg, fout);
  	else {
! 	    if (ops['P']) {
!     		if (!termok && (isset(INTERACTIVE) || !init_term()))
! 		    return 1;
  		arg = putprompt(arg, &len, NULL, 0);
+ 	    }
  	    fwrite(arg, len, 1, fout);
  	    if(ops['P'])
  		free(arg);

*** lex.c.orig	Sun Apr 14 22:33:32 1996
--- lex.c	Tue Apr 16 10:20:07 1996
***************
*** 52,58 ****
      int histdone;
      int spaceflag;
      int stophist;
-     int alstackind;
      int hlinesz;
      char *hline;
      char *hptr;
--- 52,57 ----
***************
*** 83,88 ****
--- 82,93 ----
  {
      struct lexstack *ls;
  
+ #ifdef DEBUG
+     if (alstackind) {
+ 	fprintf(stdout, "BUG: lexsave called with alstackind != 0\n");
+ 	fflush(stdout);
+     }
+ #endif
      ls = (struct lexstack *)malloc(sizeof(struct lexstack));
  
      ls->incmdpos = incmdpos;
***************
*** 91,97 ****
      ls->dbparens = dbparens;
      ls->in_brace_param = in_brace_param;
      ls->alstat = alstat;
-     ls->alstackind = alstackind;
      ls->isfirstln = isfirstln;
      ls->isfirstch = isfirstch;
      ls->histremmed = histremmed;
--- 96,101 ----
***************
*** 155,161 ****
      chwordlen = lstack->chwordlen;
      chwordpos = lstack->chwordpos;
      clearalstack();
-     alstackind = lstack->alstackind;
      hlinesz = lstack->hlinesz;
      lexstop = errflag = 0;
  
--- 159,164 ----
***************
*** 917,923 ****
      hwget(&yytext);
      s = yytext;
      if (interact && isset(SHINSTDIN) && !strin && !incasepat && tok == STRING &&
! 	(isset(CORRECTALL) || (isset(CORRECT) && incmdpos)) && !nocorrect)
  	spckword(&tokstr, &s, incmdpos, 1);
      if (zleparse && !alstackind) {
  	int zp = zleparse;
--- 920,926 ----
      hwget(&yytext);
      s = yytext;
      if (interact && isset(SHINSTDIN) && !strin && !incasepat && tok == STRING &&
! 	(isset(CORRECTALL) || (isset(CORRECT) && incmdpos)) && !nocorrect && !alstackind)
  	spckword(&tokstr, &s, incmdpos, 1);
      if (zleparse && !alstackind) {
  	int zp = zleparse;



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

end of thread, other threads:[~1996-04-17  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-16 19:16 Yikes! Missing Patches in zsh-2.6-beta14 Eskandar Ensafi
1996-04-16 19:57 ` Zoltan Hidvegi
1996-04-16 20:04   ` Eskandar Ensafi
1996-04-17  0:18     ` Richard J. Coleman

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