mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 22:21:09 -04:00
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:
parent
e67412cc8c
commit
fd76e2ec4b
1 changed files with 27 additions and 10 deletions
|
@ -303,10 +303,20 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
|||
|
||||
/* THIS IS A HACK TO ALLOW WINDOWS TO ACCEPT COMMANDLINE ARGUMENTS */
|
||||
|
||||
const int MAX_ARGS = 32;
|
||||
int i,j;
|
||||
|
||||
|
||||
|
||||
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 *wholeline = (char*)GetCommandLine();
|
||||
int cmdlen = strlen(wholeline);
|
||||
|
@ -330,11 +340,18 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
|||
}
|
||||
}
|
||||
argc = i;
|
||||
|
||||
#endif
|
||||
|
||||
for( i=0; i<argc; i++)
|
||||
{
|
||||
printf("%d: %s\n", i, argv[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* for static PThreads under windows... we need to init the library...
|
||||
*/
|
||||
#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
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue