delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/02/16:48:18

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199911022147.PAA16264@mercury.xraylith.wisc.edu>
To: banders AT ec DOT rockwell DOT com
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: command line globbing
In-Reply-To: Your message of "Tue, 02 Nov 1999 21:34:47 GMT."
<OFBB791211 DOT D2265612-ON8625681D DOT 00764446 AT switch DOT rockwell DOT com>
Date: Tue, 02 Nov 1999 15:47:26 -0600
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

<banders AT ec DOT rockwell DOT com> writes:
> I am trying to get shmsdos from netscape's win32 tools to work with
> mingw32.
> It seems that globbing is enabled by default in mingw32. Is there a way to
> turn it off.
> I understand there is a way to do it for cygwin, with a variable, but have
> not seen how it
> would be done for mingw32.
> 

It's quite easy to turn off globbing for Mingw32. There are two ways,
both of which are trivial:

1. Add the following object file to your link list:
   
   <install_root>/i386-mingw32/lib/CRT_noglob.o

   Where install_root is where you installed Mingw32 (eg., c:\gcc-2.95).
   You can of course always just copy the file to your directory and
   then you can omit the long path.

   C:\> gcc -o foo foo.o <install_root>\i386-mingw32\lib\CRT_noglob.o 

2. Define a variable _CRT_glob and initialize it to 0 at file scope in
   any of your source modules.

   /* file/global scope. */
   int _CRT_glob = 0;

   /* rest of file. */


   eg., try the following example:

   /* glob-test.c */
   #include <stdio.h>

   #if GLOB_ON
   int _CRT_glob = 1;
   #else
   int _CRT_glob = 0;
   #endif

   int
   main (int argc, char *argv[])
   {
     int i;
     for (i = 1; i < argc; i++)
       {
       printf ("%d: %s\n", i, argv[i]);
     }
     return 0;
   }

   
  To turn globbing on:

  C:\> gcc -DGLOB_ON=1 -o glob-on.exe glob-test.c

  To turn it off:

  C:\> gcc -DGLOB_ON=0 -o glob-off.exe glob-test.c

  Test it:

  C:\> glob-on *
  C:\> glob-off *

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019