ruby-changes:5753
From: shyouhei <ko1@a...>
Date: Sun, 15 Jun 2008 22:24:24 +0900 (JST)
Subject: [ruby-changes:5753] Ruby:r17260 (ruby_1_8_5): merge revision(s) 16177:
shyouhei 2008-06-15 22:24:05 +0900 (Sun, 15 Jun 2008)
New Revision: 17260
Modified files:
branches/ruby_1_8_5/ChangeLog
branches/ruby_1_8_5/dln.c
branches/ruby_1_8_5/version.h
Log:
merge revision(s) 16177:
* dln.c (dln_find_1): prior files with extensions to files sans
extensions. [ruby-core:16517]
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/dln.c?r1=17260&r2=17259&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=17260&r2=17259&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=17260&r2=17259&diff_format=u
Index: ruby_1_8_5/dln.c
===================================================================
--- ruby_1_8_5/dln.c (revision 17259)
+++ ruby_1_8_5/dln.c (revision 17260)
@@ -1772,26 +1772,9 @@
}
memcpy(bp, fname, i + 1);
-#ifndef __MACOS__
- if (stat(fbuf, &st) == 0) {
- if (exe_flag == 0) return fbuf;
- /* looking for executable */
- if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
- return fbuf;
- }
-#else
- if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
- if (exe_flag == 0) return mac_fullpath;
- /* looking for executable */
- if (stat(mac_fullpath, &st) == 0) {
- if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
- return mac_fullpath;
- }
- }
-#endif
#if defined(DOSISH)
if (exe_flag) {
- static const char *extension[] = {
+ static const char extension[][5] = {
#if defined(MSDOS)
".com", ".exe", ".bat",
#if defined(DJGPP)
@@ -1804,11 +1787,10 @@
".r", ".R", ".x", ".X", ".bat", ".BAT",
/* __human68k__ */
#endif
- (char *) NULL
};
int j;
- for (j = 0; extension[j]; j++) {
+ for (j = 0; j < sizeof(extension) / sizeof(extension[0]); j++) {
if (fspace < strlen(extension[j])) {
fprintf(stderr, "openpath: pathname too long (ignored)\n");
fprintf(stderr, "\tDirectory \"%.*s\"\n", (int) (bp - fbuf), fbuf);
@@ -1825,9 +1807,28 @@
#endif
}
+ goto next;
}
#endif /* MSDOS or _WIN32 or __human68k__ or __EMX__ */
+#ifndef __MACOS__
+ if (stat(fbuf, &st) == 0) {
+ if (exe_flag == 0) return fbuf;
+ /* looking for executable */
+ if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
+ return fbuf;
+ }
+#else
+ if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
+ if (exe_flag == 0) return mac_fullpath;
+ /* looking for executable */
+ if (stat(mac_fullpath, &st) == 0) {
+ if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
+ return mac_fullpath;
+ }
+ }
+#endif
+
next:
/* if not, and no other alternatives, life is bleak */
if (*ep == '\0') {
Index: ruby_1_8_5/ChangeLog
===================================================================
--- ruby_1_8_5/ChangeLog (revision 17259)
+++ ruby_1_8_5/ChangeLog (revision 17260)
@@ -1,3 +1,8 @@
+Sun Jun 15 22:21:07 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * dln.c (dln_find_1): prior files with extensions to files sans
+ extensions. [ruby-core:16517]
+
Sun Jun 15 22:19:33 2008 Yukihiro Matsumoto <matz@r...>
* sprintf.c (rb_f_sprintf): should protect temporary string from
Index: ruby_1_8_5/version.h
===================================================================
--- ruby_1_8_5/version.h (revision 17259)
+++ ruby_1_8_5/version.h (revision 17260)
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 198
+#define RUBY_PATCHLEVEL 199
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/