summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-17 14:54:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-17 14:54:07 +0000
commitf47aeffd24a3bbe3768dfa959d5278666804bff3 (patch)
tree624bf9e71514b623b5e9d9c154d30e11ab403bb0
parentb881b57c9e025dc5bc36e2ac9c17911f353755a6 (diff)
* file.c (file_expand_path): fix for short file name on Cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@16450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--file.c12
-rw-r--r--version.h2
3 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3868cb2..66cef5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (file_expand_path): fix for short file name on Cygwin.
+
Sat May 17 23:50:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (OpenFile): prevent conflict on Windows.
diff --git a/file.c b/file.c
index da4443b..2938b89 100644
--- a/file.c
+++ b/file.c
@@ -2745,15 +2745,20 @@ file_expand_path(fname, dname, result)
RSTRING(result)->len = buflen;
*p = '\0';
#if USE_NTFS
- if (!strpbrk(b = buf, "*?")) {
+ if (1 &&
+#ifdef __CYGWIN__
+ !(buf[0] == '/' && !buf[1]) &&
+#endif
+ !strpbrk(b = buf, "*?")) {
size_t len;
WIN32_FIND_DATA wfd;
#ifdef __CYGWIN__
- int lnk_added = 0;
+ int lnk_added = 0, is_symlink = 0;
struct stat st;
char w32buf[MAXPATHLEN], sep = 0;
p = 0;
if (lstat(buf, &st) == 0 && S_ISLNK(st.st_mode)) {
+ is_symlink = 1;
p = strrdirsep(buf);
if (!p) p = skipprefix(buf);
if (p) {
@@ -2766,8 +2771,7 @@ file_expand_path(fname, dname, result)
}
if (p) *p = sep;
else p = buf;
- if (b == w32buf) {
- strlcat(w32buf, p, sizeof(w32buf));
+ if (is_symlink && b == w32buf) {
len = strlen(p);
if (len > 4 && strcasecmp(p + len - 4, ".lnk") != 0) {
lnk_added = 1;
diff --git a/version.h b/version.h
index 944a180..7777d2e 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-05-17"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080517
-#define RUBY_PATCHLEVEL 116
+#define RUBY_PATCHLEVEL 117
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8