8000 merge revision(s) 16177: · documenting-ruby/ruby@840a5b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 840a5b4

Browse files
committed
merge revision(s) 16177:
* dln.c (dln_find_1): prior files with extensions to files sans extensions. [ruby-core:16517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent f8535d1 commit 840a5b4

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Jun 15 22:21:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* dln.c (dln_find_1): prior files with extensions to files sans
4+
extensions. [ruby-core:16517]
5+
16
Sun Jun 15 22:19:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
27

38
* sprintf.c (rb_f_sprintf): should protect temporary string from

dln.c

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,26 +1772,9 @@ dln_find_1(fname, path, exe_flag)
17721772
}
17731773
memcpy(bp, fname, i + 1);
17741774

1775-
#ifndef __MACOS__
1776-
if (stat(fbuf, &st) == 0) {
1777-
if (exe_flag == 0) return fbuf;
1778-
/* looking for executable */
1779-
if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
1780-
return fbuf;
1781-
}
1782-
#else
1783-
if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
1784-
if (exe_flag == 0) return mac_fullpath;
1785-
/* looking for executable */
1786-
if (stat(mac_fullpath, &st) == 0) {
1787-
if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
1788-
return mac_fullpath;
1789-
}
1790-
}
1791-
#endif
17921775
#if defined(DOSISH)
17931776
if (exe_flag) {
1794-
static const char *extension[] = {
1777+
static const char extension[][5] = {
17951778
#if defined(MSDOS)
17961779
".com", ".exe", ".bat",
17971780
#if defined(DJGPP)
@@ -1804,11 +1787,10 @@ dln_find_1(fname, path, exe_flag)
18041787
".r", ".R", ".x", ".X", ".bat", ".BAT",
18051788
/* __human68k__ */
18061789
#endif
1807-
(char *) NULL
18081790
};
18091791
int j;
18101792

1811-
for (j = 0; extension[j]; j++) {
1793+
for (j = 0; j < sizeof(extension) / sizeof(extension[0]); j++) {
18121794
if (fspace < strlen(extension[j])) {
18131795
fprintf(stderr, "openpath: pathname too long (ignored)\n");
18141796
fprintf(stderr, "\tDirectory \"%.*s\"\n", (int) (bp - fbuf), fbuf);
@@ -1825,9 +1807,28 @@ dln_find_1(fname, path, exe_flag)
18251807

18261808
#endif
18271809
}
1810+
goto next;
18281811
}
18291812
#endif /* MSDOS or _WIN32 or __human68k__ or __EMX__ */
18301813

1814+
#ifndef __MACOS__
1815+
if (stat(fbuf, &st) == 0) {
1816+
if (exe_flag == 0) return fbuf;
1817+
/* looking for executable */
1818+
if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
1819+
return fbuf;
1820+
}
1821+
#else
1822+
if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
1823+
if (exe_flag == 0) return mac_fullpath;
1824+
/* looking for executable */
1825+
if (stat(mac_fullpath, &st) == 0) {
1826+
if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
1827+
return mac_fullpath;
1828+
}
1829+
}
1830+
#endif
1831+
18311832
next:
18321833
/* if not, and no other alternatives, life is bleak */
18331834
if (*ep == '\0') {

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-15"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080615
5-
#define RUBY_PATCHLEVEL 198
5+
#define RUBY_PATCHLEVEL 199
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)
0