From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id DAA11949 for ; Fri, 27 Sep 1996 03:49:35 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA12394; Thu, 26 Sep 1996 13:42:46 -0400 (EDT) Resent-Date: Thu, 26 Sep 1996 13:40:40 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960926104254.ZM15298@candle.brasslantern.com> Date: Thu, 26 Sep 1996 10:42:53 -0700 In-Reply-To: Zefram "Re: twiddle-number problem?" (Sep 26, 2:11pm) References: <6675.199609261311@stone.dcs.warwick.ac.uk> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zefram , colin@fuligin.loni.ucla.edu (Colin Holmes), zsh-users@math.gatech.edu Subject: Re: twiddle-number problem? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"Bgcw2.0.e03.N0iIo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/426 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sep 26, 2:11pm, Zefram wrote: } Subject: Re: twiddle-number problem? } } >Can anyone explain how I can get tilde-user completion to } >handle usernames starting with numbers? On SGIs, there's } >a default user called "4Dgifts" that contains nice source } >code examples and other goodies. } } *sigh* } } When I proposed using ~ instead of = for the directory } stack, I assumed that no one would be perverse enough to have a } username start with a digit or punctuation character. What, you've never seen AOL and MCImail and CompuServe usernames in your email? There are many thousands, if not millions, of such perversities. This can't be *that* hard to fix in a reasonable manner. If you assume that nobody is going to have a username consisting *entirely* of digits, and you further assume that nobody is going to have a directory stack more than 99 (or 999 if you're paranoid) directories deep, you can do a really fast test to determine whether something beginning with ~ is a directory stack reference or a username. zagzig<2> echo ~5 /usr/src/local/zsh-3.0.1-test2-work/Src zagzig<3> echo ~3 /usr/src/local zagzig<4> echo ~4DGifts zsh: no such user or named directory: 4DGifts I can't find anything that the following patch breaks (except a directory stack 1000+ levels deep). Can anyone else? *** Src/subst.c.0 Mon Sep 23 22:04:54 1996 --- Src/subst.c Thu Sep 26 10:13:40 1996 *************** *** 344,350 **** } else if (str[1] == '-' && idigit(str[2])) { /* ~-42 */ str++; goto dstack; ! } else if (idigit(str[1])) { /* ~42 */ char *ds, *ptr; int val; dstack: --- 344,355 ---- } else if (str[1] == '-' && idigit(str[2])) { /* ~-42 */ str++; goto dstack; ! } else if (idigit(str[1]) && /* ~42 */ ! (isend(str[2]) || ! (idigit(str[2]) && ! (isend(str[3]) || ! (idigit(str[3]) && ! isend(str[4]))))) { char *ds, *ptr; int val; dstack: -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"