From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25450 invoked from network); 28 Feb 1999 04:36:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Feb 1999 04:36:31 -0000 Received: (qmail 15613 invoked by alias); 28 Feb 1999 04:36:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5553 Received: (qmail 15606 invoked from network); 28 Feb 1999 04:36:14 -0000 Message-ID: <19990228041310.17775.qmail@hotmail.com> X-Originating-IP: [209.157.52.1] From: "Matt Armstrong" To: zsh-workers@sunsite.auc.dk Subject: PATCH: zsh-3.1.5-pws-9: Cygwin, hash foo.exe as foo Date: Sat, 27 Feb 1999 20:13:10 PST Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_1767a401_54585748$4db2ac72" ------=_NextPart_000_1767a401_54585748$4db2ac72 Content-type: text/plain Under DOS/Win32 most executables have a .exe extension. When running under Cygwin, the command hash gets filled with all the .exe versions of the names. This works fine, except when CORRECT or CORRECT_ALL are set -- zsh tries to spell correct when you don't type the trailing .exe. This is inconvenient. This patch introduces a _WIN32 specific change. If a file foo.exe is in the path, the patch causes both foo and foo.exe to be added to the command hash. I didn't use __CYGWIN__ because I think this is useful for both UWIN (which may define _WIN32) and a native port (which does define _WIN32). -- I'm really matt_armstrong@bigfoot.com. My ISP is blacklisted by http://www.orbs.org, so I must use hotmail. :-( ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com ------=_NextPart_000_1767a401_54585748$4db2ac72 Content-Type: text/plain; name="cygwin.hashtable.patch.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="cygwin.hashtable.patch.txt" *** Src/hashtable.c Sat Feb 27 20:06:23 1999 --- ../zsh-3.1.5-pws-9.orig/Src/hashtable.c Tue Jan 19 04:28:00 1999 *************** *** 607,615 **** Cmdnam cn; DIR *dir; char *fn; - #ifdef _WIN32 - char *exe; - #endif if (isrelative(*dirp) || !(dir = opendir(unmeta(*dirp)))) return; --- 607,612 ---- *************** *** 621,643 **** cn->u.name = dirp; cmdnamtab->addnode(cmdnamtab, ztrdup(fn), cn); } - #ifdef _WIN32 - /* Hash foo.exe as foo, since when no real foo exists, foo.exe - will get executed by DOS automatically. This quiets - spurious corrections when CORRECT or CORRECT_ALL is set. */ - if ((exe = strrchr(fn, '.')) && - (exe[1] == 'E' || exe[1] == 'e') && - (exe[2] == 'X' || exe[2] == 'x') && - (exe[3] == 'E' || exe[3] == 'e') && exe[4] == 0) { - *exe = 0; - if (!cmdnamtab->getnode(cmdnamtab, fn)) { - cn = (Cmdnam) zcalloc(sizeof *cn); - cn->flags = 0; - cn->u.name = dirp; - cmdnamtab->addnode(cmdnamtab, ztrdup(fn), cn); - } - } - #endif /* __CYGWIN__ */ } closedir(dir); } --- 618,623 ---- ------=_NextPart_000_1767a401_54585748$4db2ac72--