delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/04/06:58:59

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Hannu E K Nevalainen \(garbage mail\)" <garbage_collector AT telia DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Path separator
Date: Wed, 4 Jun 2003 12:57:26 +0200
Message-ID: <NGBBLLIAMFLGJEOAJCCECEFJDAAA.garbage_collector@telia.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
In-Reply-To: <20030603220046.97377.qmail@web40605.mail.yahoo.com>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf
> Of Greg Fenton

> --- Max Bowsher <maxb AT ukf DOT net> wrote:
> >
> > No: Cygwin != _WIN32.
> >
>
> No argument from me here.  :-)
>
>
> > A native/Cygwin dual-mode binary sounds like a clever idea, but AFAIK
> > has never been done before, and is probably ridiculously infeasible
> on the balance of work/benefit.

> I don't see that the amount of work is ridiculous at all.  Any portable
> code will have a path-conversion (canonicalization) function in place
> for any and all file system access.  That canonicalization should be
> able to determine the PATH_SEPARATOR for the given environment.

What in particular is it that you wish to do?

Idea:

 Windows <-link-> DOS
This means that %PATH% contains ':\' characters and ';' separators

 cygwin <-link-> Unix/Linux
Here we have '/' characters and ':' separators in $PATH

 Might it be possible to exploit this?

It won't work by simply reading the environment as cygwin.dll will be in
there, supplying you with the (converted) environment contents.
 To see the difference you neeed to recompile under the other OS.

/Hannu E K Nevalainen, Mariefred, Sweden, 59~14'N, 17~12'E. >17~C avg/d now.
~ <=> degree

--
/*

 I have not seen 'char **env' _really_ documented -- pointers?
*/

# include <stdio.h>

int main(int argc, char **argv, char **env) {
  int i;

  printf("*** Arg-vector *** %d items \n",argc);
    for (i=0; i<argc; i++)
    printf("%2d: \"%s\"\n",i,*argv++);

  printf("*** Env-vector ***\n");
  i=0;
  while (*env!=NULL) {
    printf("%2d: \"%s\"\n",i++,*env++);
    }
  return 0;
}
--END OF MESSAGE--


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

- Raw text -


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