[Tcsh] change in head/tail handling in tcsh-6.22.03

Christos Zoulas christos at zoulas.com
Sun Nov 22 14:30:23 UTC 2020


It was unintentional so a bug...

christos

diff --git a/sh.lex.c b/sh.lex.c
index fdd24bc..9df132d 100644
--- a/sh.lex.c
+++ b/sh.lex.c
@@ -1046,7 +1046,7 @@ domod(Char *cp, Char type)
     case 't':
        wp = Strrchr(cp, '/');
        if (wp == NULL)
-           return Strsave(type == 't' ? cp : STRNULL);
+           return type == 't' ? Strsave(cp) : NULL;
        if (type == 't')
            xp = Strsave(wp + 1);
        else


> On Nov 22, 2020, at 9:10 AM, Nelson H. F. Beebe <beebe at math.utah.edu> wrote:
> 
> A colleague reported a change in behavior of the head/tail
> modifiers in tcsh after I upgraded our systems to tcsh-6.22.03
> three days ago.  We always keep old versions around, so that we
> can easily do a rollback.  Here is a demo of the change:
> 
> 	% tcsh-6.22.02
> 	1 home> set arg=ls
> 	2 home> echo $arg
> 	ls
> 	3 home> echo $arg:h
> 	ls
> 	4 home> echo $arg:t
> 	ls
> 
> 	% tcsh-6.22.03
> 	1 home> set arg=ls
> 	2 home> echo $arg
> 	ls
> 	3 home> echo $arg:h
> 
> 	4 home> echo $arg:t
> 	ls
> 
> Is this a bug, or a `feature'?
> 
> -------------------------------------------------------------------------------
> - Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
> - University of Utah                    FAX: +1 801 581 4148                  -
> - Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
> - 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
> - Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
> -------------------------------------------------------------------------------
> -- 
> Tcsh mailing list
> Tcsh at astron.com
> https://mailman.astron.com/mailman/listinfo/tcsh



More information about the Tcsh mailing list