1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (ruby_options): now we cannot call rb_glob() before

ruby_init(), so call rb_w32_cmdvector() at ruby_options().

* win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
  export it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2004-11-12 06:15:40 +00:00
parent 47fa2caf2e
commit c4ce79084f
4 changed files with 19 additions and 13 deletions

View file

@ -1,3 +1,11 @@
Fri Nov 12 15:15:06 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* eval.c (ruby_options): now we cannot call rb_glob() before
ruby_init(), so call rb_w32_cmdvector() at ruby_options().
* win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
export it.
Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/event.rb: remove $LOADED_FEATURES trick

8
eval.c
View file

@ -1364,6 +1364,10 @@ ruby_options(argc, argv)
{
int state;
#ifdef _WIN32
argc = rb_w32_cmdvector(GetCommandLine(), &argv);
#endif
Init_stack((void*)&state);
PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
@ -1375,6 +1379,10 @@ ruby_options(argc, argv)
exit(error_handle(state));
}
POP_TAG();
#ifdef _WIN32_WCE
wce_FreeCommandLine();
#endif
}
void rb_exec_end_proc _((void));

View file

@ -85,7 +85,6 @@
#define TO_SOCKET(x) _get_osfhandle(x)
static struct ChildRecord *CreateChild(const char *, const char *, SECURITY_ATTRIBUTES *, HANDLE, HANDLE, HANDLE);
static int make_cmdvector(const char *, char ***);
static int has_redirection(const char *);
static void StartSockets(void);
static DWORD wait_events(HANDLE event, DWORD timeout);
@ -422,11 +421,6 @@ NtInitialize(int *argc, char ***argv)
_controlfp(0x5, 0x5);
#endif
//
// subvert cmd.exe's feeble attempt at command line parsing
//
*argc = make_cmdvector(GetCommandLine(), argv);
//
// Now set up the correct time stuff
//
@ -437,11 +431,6 @@ NtInitialize(int *argc, char ***argv)
// Initialize Winsock
StartSockets();
#ifdef _WIN32_WCE
// free commandline buffer
wce_FreeCommandLine();
#endif
}
char *
@ -1141,8 +1130,8 @@ skipspace(char *ptr)
return ptr;
}
static int
make_cmdvector(const char *cmd, char ***vec)
int
rb_w32_cmdvector(const char *cmd, char ***vec)
{
int cmdlen, globbing, len, i;
int elements, strsz, done;

View file

@ -134,6 +134,7 @@ struct timezone {
};
#endif
extern void NtInitialize(int *, char ***);
extern int rb_w32_cmdvector(const char *, char ***);
extern pid_t rb_w32_pipe_exec(const char *, const char *, int, FILE **, FILE **);
extern int flock(int fd, int oper);
extern int rb_w32_accept(int, struct sockaddr *, int *);