checked in fix to cmd console rsinit.cc, pls test and get back to me

use USE_CMD_ARGS define in windows which enables use of cmd 
line console args 

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3423 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-09-01 21:08:08 +00:00
parent e67412cc8c
commit fd76e2ec4b

View file

@ -303,10 +303,20 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
/* THIS IS A HACK TO ALLOW WINDOWS TO ACCEPT COMMANDLINE ARGUMENTS */ /* THIS IS A HACK TO ALLOW WINDOWS TO ACCEPT COMMANDLINE ARGUMENTS */
const int MAX_ARGS = 32;
int i,j;
int argc; int argc;
int i;
#ifdef USE_CMD_ARGS
char** argv = argvIgnored;
argc = argcIgnored;
#else
const int MAX_ARGS = 32;
int j;
char *argv[MAX_ARGS]; char *argv[MAX_ARGS];
char *wholeline = (char*)GetCommandLine(); char *wholeline = (char*)GetCommandLine();
int cmdlen = strlen(wholeline); int cmdlen = strlen(wholeline);
@ -330,11 +340,18 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
} }
} }
argc = i; argc = i;
#endif
for( i=0; i<argc; i++) for( i=0; i<argc; i++)
{ {
printf("%d: %s\n", i, argv[i]); printf("%d: %s\n", i, argv[i]);
} }
/* for static PThreads under windows... we need to init the library... /* for static PThreads under windows... we need to init the library...
*/ */
#ifdef PTW32_STATIC_LIB #ifdef PTW32_STATIC_LIB
@ -349,7 +366,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
/* getopt info: every availiable option is listed here. if it is followed by a ':' it /* getopt info: every availiable option is listed here. if it is followed by a ':' it
needs an argument. If it is followed by a '::' the argument is optional. needs an argument. If it is followed by a '::' the argument is optional.
*/ */
while((c = getopt(argc, argv,"hesamui:p:c:w:l:d:U:")) != -1) while((c = getopt(argcIgnored, argvIgnored,"hesamui:p:c:w:l:d:U:")) != -1)
{ {
switch (c) switch (c)
{ {