This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin exe magic does not understand .com extension?


On Tue, Nov 05, 2013 at 02:52:44AM +0400, Andrey Repin wrote:
>Greetings, All!
>
>$ mode<Tab>
>mode.com     modemui.dll  modex.dll

That would be /bin/sh exe magic from the looks of it.  It is probably
just trying to find anything with an executable bit set, just like on
Linux.

>$ mode
>bash: mode: command not found
>
>Now, I see two issues.
>First, it is that it see .dll files as executables. Which is true in essence,
>but rather suspicious, as .dll files are normally not directly executable.
>Would really like an explanation for this behavior.
>
>Second, is that it actually see mode.com, but unable to execute it.

It's likely that "mode.com" would execute it.

>P.S.
>$ set | grep PATHEXT
>PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1'

% cd /cygwin/sources
% grep -B17 PATHEXT *(.)
environ.cc-/* Minimal list of Windows vars which must be converted to uppercase.
environ.cc-   Either for POSIX compatibility of for backward compatibility with
environ.cc-   existing applications. */
environ.cc-static struct renv {
environ.cc-	const char *name;
environ.cc-	const size_t namelen;
environ.cc-} renv_arr[] = {
environ.cc-	{ NL("ALLUSERSPROFILE=") },		// 0
environ.cc-	{ NL("COMMONPROGRAMFILES=") },		// 1
environ.cc-	{ NL("COMPUTERNAME=") },
environ.cc-	{ NL("COMSPEC=") },
environ.cc-	{ NL("HOME=") },			// 4
environ.cc-	{ NL("HOMEDRIVE=") },
environ.cc-	{ NL("HOMEPATH=") },
environ.cc-	{ NL("NUMBER_OF_PROCESSORS=") },	// 7
environ.cc-	{ NL("OS=") },				// 8
environ.cc-	{ NL("PATH=") },			// 9
environ.cc:	{ NL("PATHEXT=") },


i.e., the only thing Cygwin does with PATHEXT is convert it to upper case.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]