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

ruby-changes:15055

From: nobu <ko1@a...>
Date: Mon, 15 Mar 2010 07:41:22 +0900 (JST)
Subject: [ruby-changes:15055] Ruby:r26931 (trunk): * file.c (realpath_rec): use same cache.

nobu	2010-03-15 07:41:04 +0900 (Mon, 15 Mar 2010)

  New Revision: 26931

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26931

  Log:
    * file.c (realpath_rec): use same cache.

  Modified files:
    trunk/ChangeLog
    trunk/file.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26930)
+++ ChangeLog	(revision 26931)
@@ -1,5 +1,7 @@
-Mon Mar 15 07:38:28 2010  Nobuyoshi Nakada  <nobu@r...>
+Mon Mar 15 07:41:00 2010  Nobuyoshi Nakada  <nobu@r...>
 
+	* file.c (realpath_rec): use same cache.
+
 	* file.c (realpath_internal): regulate separators in prefix.
 	  [ruby-core:28653]
 
Index: file.c
===================================================================
--- file.c	(revision 26930)
+++ file.c	(revision 26931)
@@ -3087,6 +3087,8 @@
 static void
 realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopcheck, int strict, int last)
 {
+    ID resolving;
+    CONST_ID(resolving, "resolving");
     while (*unresolved) {
         char *testname = unresolved;
         char *unresolved_firstsep = rb_path_next(unresolved);
@@ -3112,7 +3114,7 @@
             rb_str_cat(testpath, testname, testnamelen);
             checkval = rb_hash_aref(loopcheck, testpath);
             if (!NIL_P(checkval)) {
-                if (checkval == ID2SYM(rb_intern("resolving"))) {
+                if (checkval == ID2SYM(resolving)) {
                     errno = ELOOP;
                     rb_sys_fail(RSTRING_PTR(testpath));
                 }
@@ -3140,7 +3142,7 @@
                     volatile VALUE link;
                     char *link_prefix, *link_names;
                     long link_prefixlen;
-                    rb_hash_aset(loopcheck, testpath, ID2SYM(rb_intern("resolving")));
+                    rb_hash_aset(loopcheck, testpath, ID2SYM(resolving));
                     link = rb_file_s_readlink(rb_cFile, testpath);
                     link_prefix = RSTRING_PTR(link);
                     link_names = skiproot(link_prefix);

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

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