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

ruby-changes:18365

From: nobu <ko1@a...>
Date: Sun, 26 Dec 2010 22:24:26 +0900 (JST)
Subject: [ruby-changes:18365] Ruby:r30388 (trunk): * file.c (file_expand_path): get rid of warnings caused by

nobu	2010-12-26 22:24:17 +0900 (Sun, 26 Dec 2010)

  New Revision: 30388

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

  Log:
    * file.c (file_expand_path): get rid of warnings caused by
      -Wdeclaration-after-statement on cygwin.

  Added files:
    trunk/change.log1
  Modified files:
    trunk/ChangeLog
    trunk/file.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30387)
+++ ChangeLog	(revision 30388)
@@ -1,3 +1,8 @@
+Sun Dec 26 22:24:14 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* file.c (file_expand_path): get rid of warnings caused by
+	  -Wdeclaration-after-statement on cygwin.
+
 Sun Dec 26 20:28:34 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* process.c (before_exec): add small comment.
Index: change.log1
===================================================================
--- change.log1	(revision 0)
+++ change.log1	(revision 30388)
@@ -0,0 +1,2 @@
+	* ext/ripper/depend (ripper.y): fix messages with nmake.
+	  [ruby-dev:42896]

Property changes on: change.log1
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: file.c
===================================================================
--- file.c	(revision 30387)
+++ file.c	(revision 30388)
@@ -3093,7 +3093,15 @@
     if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) {
 	size_t len;
 	WIN32_FIND_DATA wfd;
+	HANDLE h;
 #ifdef __CYGWIN__
+#ifdef HAVE_CYGWIN_CONV_PATH
+	char *w32buf = NULL;
+	const int flags = CCP_POSIX_TO_WIN_A | CCP_RELATIVE;
+#else
+	char w32buf[MAXPATHLEN];
+#endif
+	const char *path;
 	ssize_t bufsize;
 	int lnk_added = 0, is_symlink = 0;
 	struct stat st;
@@ -3105,10 +3113,8 @@
 		lnk_added = 1;
 	    }
 	}
-	const char *path = *buf ? buf : "/";
+	path = *buf ? buf : "/";
 #ifdef HAVE_CYGWIN_CONV_PATH
-	char *w32buf = NULL;
-	const int flags = CCP_POSIX_TO_WIN_A | CCP_RELATIVE;
 	bufsize = cygwin_conv_path(flags, path, NULL, 0);
 	if (bufsize > 0) {
 	    bufsize += len;
@@ -3119,7 +3125,6 @@
 	    }
 	}
 #else
-	char w32buf[MAXPATHLEN];
 	bufsize = MAXPATHLEN;
 	if (cygwin_conv_to_win32_path(path, w32buf) == 0) {
 	    b = w32buf;
@@ -3137,7 +3142,7 @@
 	}
 	*p = '/';
 #endif
-	HANDLE h = FindFirstFile(b, &wfd);
+	h = FindFirstFile(b, &wfd);
 	if (h != INVALID_HANDLE_VALUE) {
 	    FindClose(h);
 	    len = strlen(wfd.cFileName);

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

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