[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn system() replacement ?

From: Lars Kellogg-Stedman <lars_at_larsshack.org>
Date: 2002-01-28 15:43:03 CET

> Yes. But we need to make main() pass the environment data to the commit
> function which need to pass it on to the APR function...

If the system() replacement is the only function that needs to
explicitly pass the environment on to another function call, then
instead of passing in the environment as a function parameter from
main() you may be able to use the global 'environ' variable.

I don't know if this is a POSIX-ism or just a common convention, but the
following works under both Linux and Solaris:

#include <stdio.h>

extern char **environ;

int main() {
         int i;

         for (i=0; environ[i]; i++)
                 printf("%s\n", environ[i]);
}

Cheers,

-- Lars

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.