From 96aca8fc70270a1d491b638eadace2ebc5456455 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 16 Dec 2009 11:27:51 +0000 Subject: merge revision(s) 25656: * win32/win32.c (CreateChild): allocate temporary buffer and use it instead of directly modify the passed string. [ruby-dev:39635] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@26113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ version.h | 2 +- win32/win32.c | 12 +++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2897810bac..da05afaf25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 16 20:17:40 2009 NAKAMURA Usaku + + * win32/win32.c (CreateChild): allocate temporary buffer and use it + instead of directly modify the passed string. [ruby-dev:39635] + Wed Dec 16 19:49:47 2009 URABE Shyouhei * instruby.rb (with_destdir): revert. [ruby-dev:39885] diff --git a/version.h b/version.h index e249f36d73..b88e1d57bc 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-12-16" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20091216 -#define RUBY_PATCHLEVEL 241 +#define RUBY_PATCHLEVEL 242 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 diff --git a/win32/win32.c b/win32/win32.c index c9081327f5..c4b6a124ab 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1066,11 +1066,13 @@ CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa, } } if (p) { - shell = p; - while (*p) { - if ((unsigned char)*p == '/') - *p = '\\'; - p = CharNext(p); + char *tmp = ALLOCA_N(char, strlen(p) + 1); + strcpy(tmp, p); + shell = tmp; + while (*tmp) { + if ((unsigned char)*tmp == '/') + *tmp = '\\'; + tmp = CharNext(tmp); } } -- cgit v1.2.3