From trineo at gmail.com Fri May 1 23:00:43 2009 From: trineo at gmail.com (Neon Ngo) Date: Fri, 1 May 2009 16:00:43 -0400 Subject: [PATCH]$name[selector] breaks rightness of empty range with omitted second argument in range Message-ID: <30db90810905011300u2b8ac682k5528fa19bb8ef3d4@mail.gmail.com> I agree, this valid behavior ($argv[1-]) is NOW broken with the sm (symmetry) option I believe the previous patch should be removed or fix to allow doing $argv[1-]. tcsh maintainer(s), what is the plan for resolving this issue? Or do you all still think that is an invalid scenario? See my posting in the tcsh-bugs mailing list: Subscript out of range error on existing working script http://mx.gw.com/pipermail/tcsh-bugs/2009-April/000621.html I have a workaround for my script by doing: set x "" if ($#argv >= 1) then set x $argv[1-] endif vs my one line in the past (which will set x to "" when run without args) set x $argv[1-] See also this thread on CentOS: 0003543: "argv: Subscript out of range." http://bugs.centos.org/view.php?id=3543 Regards, Neon On Wed, Apr 15, 2009 at 5:00 AM, wrote: > Date: Tue, 14 Apr 2009 07:38:44 -0400 (EDT) > From: Vitezslav Crhonek > Subject: [PATCH]$name[selector] breaks rightness of empty range with > omitted second argument in range > Hi, > > This is related to "[PATCH]$name[selector]:it should fail when any number > of 'selector' is out of range" thread discussed here roughly a year ago > (see http://mx.gw.com/pipermail/tcsh/2008-February/003923.html). > > The patch breaks $name[selector-] functionality (the second argument is > omitted). > > This situation is described in man page: "It is not an error for a range > to be empty if the second argument is omitted or in range.". But with the > patch the tcsh produces "argv: Subscript out of range." in this situation. > > Try: > #!/bin/tcsh -f > echo $argv[1-] > > The patch should be reverted or fixed (if you believe that $name[selector] > should fail when any number of selector if out of range - I'm not sure, > because > man page doesn't state it). > > The patch is part of tarball since tcsh-6.16.00. > > Best regards, > Vitezslav Crhonek >