zsh-workers
 help / color / mirror / code / Atom feed
From: "Matt Armstrong" <mattarmst@hotmail.com>
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	[thread overview]
Message-ID: <19990228041310.17775.qmail@hotmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

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

[-- Attachment #2: cygwin.hashtable.patch.txt --]
[-- Type: text/plain, Size: 1165 bytes --]

*** 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 ----

             reply	other threads:[~1999-02-28  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-28  4:13 Matt Armstrong [this message]
1999-02-28 10:10 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990228041310.17775.qmail@hotmail.com \
    --to=mattarmst@hotmail.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).