zsh-workers
 help / color / mirror / code / Atom feed
* Alias fix
@ 1995-11-15 15:32 Peter William Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter William Stephenson @ 1995-11-15 15:32 UTC (permalink / raw)
  To: Zsh hackers list

I've wasted the whole day fixing bugs, there's no point doing
anything useful now:

This fixes this problem I've just reported:

% alias foo='echo '
% foo bar
bar
% <up-arrow>	->	% foo  bar

(extra spaces being inserted).  The fix is deliberately restrictive so
as not to cause knock-on problems.

*** Src/hist.c.sp	Wed Nov 15 14:29:01 1995
--- Src/hist.c	Wed Nov 15 16:29:55 1995
***************
*** 686,691 ****
--- 686,701 ----
  	alstat = 0;
  }
  
+ /* Go back to immediately after the last word, skipping space. */
+ 
+ /**/
+ void
+ histbackword(void)
+ {
+     if (!(chwordpos%2) && chwordpos)
+ 	hptr = chline + chwords[chwordpos-1];
+ }
+ 
  /* Get the start and end point of the current history word */
  
  /**/
*** Src/input.c.sp	Wed Nov 15 16:14:35 1995
--- Src/input.c	Wed Nov 15 16:22:30 1995
***************
*** 161,169 ****
  		/* a real alias:  mark it as unused. */
  		ix->inuse = 0;
  		t = ix->text;
! 		if (*t && t[strlen(t) - 1] == ' ')
  		    alstat = ALSTAT_MORE;
! 		else
  		    alstat = ALSTAT_JUNK;
  		inalpush(ix);
  	    }
--- 161,170 ----
  		/* a real alias:  mark it as unused. */
  		ix->inuse = 0;
  		t = ix->text;
! 		if (*t && t[strlen(t) - 1] == ' ') {
  		    alstat = ALSTAT_MORE;
! 		    histbackword();
! 		} else
  		    alstat = ALSTAT_JUNK;
  		inalpush(ix);
  	    }

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


^ permalink raw reply	[flat|nested] 2+ messages in thread
* beta12-test1 snapshot
@ 1995-11-15  5:32 Richard Coleman
  1995-11-15 14:58 ` Alias fix Peter William Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Coleman @ 1995-11-15  5:32 UTC (permalink / raw)
  To: zsh-workers

I've put

zsh-2.6-beta12-test1.tar.gz

in /pub/zsh/testing at my ftp site (ftp.math.gatech.edu)

I was getting ready to release this as beta12, but last minute
testing showed that there is a massive memory leak when you do
filename completion.  I hadn't had a chance to look at it yet,
but I thought I would through it out for everyone to take a
look at.  Changes so far are

1) Various changes in exec.c involving when to fork and subshells.
   I've added Peter's two patches as well as some changes of my
   own.  For instance, now not only does zsh -c 'vared DISPLAY'
   work as Peter talked about, but also  `exec vared DISPLAY'
   (which I don't think ever worked until now).  Of course, no one
   will ever need to do either of these, but it's cool that they do
   work.

2) Peter's patch for changing the way history remembers breaks in
   words.  I'm suspecting this is where the memory leak is.

3) various changes to the man pages.

4) the fix for substituting things such as ${FOO:-} when FOO is
   unset.

So if you are working on the code, you should take a look at this,
but you shouldn't install it for real use.

rc


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

end of thread, other threads:[~1995-11-15 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-15 15:32 Alias fix Peter William Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1995-11-15  5:32 beta12-test1 snapshot Richard Coleman
1995-11-15 14:58 ` Alias fix Peter William Stephenson

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