ruby-changes:4957
From: ko1@a...
Date: Sat, 17 May 2008 23:54:34 +0900 (JST)
Subject: [ruby-changes:4957] nobu - Ruby:r16450 (ruby_1_8_6, trunk, ruby_1_8, ruby_1_8_5): * file.c (file_expand_path): fix for short file name on Cygwin.
nobu 2008-05-17 23:54:07 +0900 (Sat, 17 May 2008)
New Revision: 16450
Modified files:
branches/ruby_1_8/ChangeLog
branches/ruby_1_8/file.c
branches/ruby_1_8_5/ChangeLog
branches/ruby_1_8_5/file.c
branches/ruby_1_8_5/version.h
branches/ruby_1_8_6/ChangeLog
branches/ruby_1_8_6/file.c
branches/ruby_1_8_6/version.h
trunk/ChangeLog
trunk/file.c
Log:
* file.c (file_expand_path): fix for short file name on Cygwin.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/file.c?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/file.c?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/file.c?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=16450&r2=16449&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/file.c?r1=16450&r2=16449&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 16449)
+++ ChangeLog (revision 16450)
@@ -1,3 +1,7 @@
+Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * file.c (file_expand_path): fix for short file name on Cygwin.
+
Sat May 17 18:03:52 2008 Yuki Sonoda (Yugui) <yugui@y...>
* vm.c (Init_VM): removed the definition of Thread#initialize,
Index: file.c
===================================================================
--- file.c (revision 16449)
+++ file.c (revision 16450)
@@ -2827,15 +2827,20 @@
#if USE_NTFS
*p = '\0';
- 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) {
@@ -2848,8 +2853,7 @@
}
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;
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog (revision 16449)
+++ ruby_1_8/ChangeLog (revision 16450)
@@ -1,3 +1,7 @@
+Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * file.c (file_expand_path): fix for short file name on Cygwin.
+
Sat May 17 11:29:11 2008 Nobuyoshi Nakada <nobu@r...>
* file.c (rb_file_s_extname): first dot is not an extension name.
Index: ruby_1_8/file.c
===================================================================
--- ruby_1_8/file.c (revision 16449)
+++ ruby_1_8/file.c (revision 16450)
@@ -2742,15 +2742,20 @@
#if USE_NTFS
*p = '\0';
- 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) {
@@ -2763,8 +2768,7 @@
}
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;
Index: ruby_1_8_5/ChangeLog
===================================================================
--- ruby_1_8_5/ChangeLog (revision 16449)
+++ ruby_1_8_5/ChangeLog (revision 16450)
@@ -1,3 +1,7 @@
+Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * file.c (file_expand_path): fix for short file name on Cygwin.
+
Sat May 17 23:50:29 2008 Nobuyoshi Nakada <nobu@r...>
* file.c (OpenFile): prevent conflict on Windows.
Index: ruby_1_8_5/version.h
===================================================================
--- ruby_1_8_5/version.h (revision 16449)
+++ ruby_1_8_5/version.h (revision 16450)
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-05-17"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080517
-#define RUBY_PATCHLEVEL 117
+#define RUBY_PATCHLEVEL 118
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
Index: ruby_1_8_5/file.c
===================================================================
--- ruby_1_8_5/file.c (revision 16449)
+++ ruby_1_8_5/file.c (revision 16450)
@@ -2732,15 +2732,20 @@
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) {
@@ -2753,8 +2758,7 @@
}
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;
Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog (revision 16449)
+++ ruby_1_8_6/ChangeLog (revision 16450)
@@ -1,3 +1,7 @@
+Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * file.c (file_expand_path): fix for short file name on Cygwin.
+
Sat May 17 23:50:29 2008 Nobuyoshi Nakada <nobu@r...>
* file.c (OpenFile): prevent conflict on Windows.
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h (revision 16449)
+++ ruby_1_8_6/version.h (revision 16450)
@@ -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
Index: ruby_1_8_6/file.c
===================================================================
--- ruby_1_8_6/file.c (revision 16449)
+++ ruby_1_8_6/file.c (revision 16450)
@@ -2745,15 +2745,20 @@
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 @@
}
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;
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/