From 7a332f23ce609f6c2e224d030135db7df4af5d66 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 14 Apr 2003 10:46:00 +0000 Subject: * file.c (file_expand_path): root must follow buf when reallocated. [ruby-talk:69339], [ruby-dev:20025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ file.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0a11d9b0ba..1c5030162f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 14 19:45:56 2003 Nobuyoshi Nakada + + * file.c (file_expand_path): root must follow buf when + reallocated. [ruby-talk:69339], [ruby-dev:20025] + Mon Apr 14 03:22:33 2003 Yukihiro Matsumoto * rubyio.h (struct OpenFile): add error raise flag to finalizer. diff --git a/file.c b/file.c index 93ed79b224..079d8cc631 100644 --- a/file.c +++ b/file.c @@ -1677,7 +1677,9 @@ file_expand_path(fname, dname, result) case '\\': #endif if (s > b) { + long rootdiff = root - buf; BUFCHECK(p + (s-b+1) >= pend); + root = buf + rootdiff; memcpy(++p, b, s-b); p += s-b; *p = '/'; -- cgit v1.2.3