[前][次][番号順一覧][スレッド一覧]

ruby-changes:4683

From: ko1@a...
Date: Thu, 24 Apr 2008 14:15:37 +0900 (JST)
Subject: [ruby-changes:4683] nobu - Ruby:r16177 (ruby_1_8, trunk): * dln.c (dln_find_1): prior files with extensions to files sans

nobu	2008-04-24 14:15:13 +0900 (Thu, 24 Apr 2008)

  New Revision: 16177

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/dln.c
    branches/ruby_1_8/version.h
    trunk/ChangeLog
    trunk/dln.c

  Log:
    * 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/ChangeLog?r1=16177&r2=16176&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16177&r2=16176&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/dln.c?r1=16177&r2=16176&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/dln.c?r1=16177&r2=16176&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/version.h?r1=16177&r2=16176&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16176)
+++ ChangeLog	(revision 16177)
@@ -1,3 +1,8 @@
+Thu Apr 24 14:15:11 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* dln.c (dln_find_1): prior files with extensions to files sans
+	  extensions.  [ruby-core:16517]
+
 Thu Apr 24 00:26:06 2008  NAKAMURA Usaku  <usa@r...>
 
 	* lib/rdoc/ri/descriptions.rb: fixed wrong class nestings.
Index: dln.c
===================================================================
--- dln.c	(revision 16176)
+++ dln.c	(revision 16177)
@@ -1694,26 +1694,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 *const extension[] = {
+	    static const char extension[][5] = {
 #if defined(MSDOS)
 		".com", ".exe", ".bat",
 #if defined(DJGPP)
@@ -1726,11 +1709,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);
@@ -1747,9 +1729,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/dln.c
===================================================================
--- ruby_1_8/dln.c	(revision 16176)
+++ ruby_1_8/dln.c	(revision 16177)
@@ -1781,26 +1781,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 *const extension[] = {
+	    static const char extension[][5] = {
 #if defined(MSDOS)
 		".com", ".exe", ".bat",
 #if defined(DJGPP)
@@ -1813,11 +1796,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);
@@ -1834,9 +1816,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/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 16176)
+++ ruby_1_8/ChangeLog	(revision 16177)
@@ -1,3 +1,8 @@
+Thu Apr 24 14:15:11 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* dln.c (dln_find_1): prior files with extensions to files sans
+	  extensions.  [ruby-core:16517]
+
 Wed Apr 23 15:39:31 2008  Akinori MUSHA  <knu@i...>
 
 	* eval.c (bind_eval): Add Binding#eval, a shorthand method for
Index: ruby_1_8/version.h
===================================================================
--- ruby_1_8/version.h	(revision 16176)
+++ ruby_1_8/version.h	(revision 16177)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2008-04-23"
+#define RUBY_RELEASE_DATE "2008-04-24"
 #define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20080423
+#define RUBY_RELEASE_CODE 20080424
 #define RUBY_PATCHLEVEL 5000
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 7
 #define RUBY_RELEASE_YEAR 2008
 #define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DAY 24
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]