* file.c (file_expand_path): get rid of warnings caused by
-Wdeclaration-after-statement on cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5d276ea14a
commit
1b00c45dc0
@ -1,3 +1,8 @@
|
|||||||
|
Sun Dec 26 22:24:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@gmail.com>
|
Sun Dec 26 20:28:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* process.c (before_exec): add small comment.
|
* process.c (before_exec): add small comment.
|
||||||
|
2
change.log1
Normal file
2
change.log1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
* ext/ripper/depend (ripper.y): fix messages with nmake.
|
||||||
|
[ruby-dev:42896]
|
15
file.c
15
file.c
@ -3093,7 +3093,15 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) {
|
if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) {
|
||||||
size_t len;
|
size_t len;
|
||||||
WIN32_FIND_DATA wfd;
|
WIN32_FIND_DATA wfd;
|
||||||
|
HANDLE h;
|
||||||
#ifdef __CYGWIN__
|
#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;
|
ssize_t bufsize;
|
||||||
int lnk_added = 0, is_symlink = 0;
|
int lnk_added = 0, is_symlink = 0;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -3105,10 +3113,8 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
lnk_added = 1;
|
lnk_added = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const char *path = *buf ? buf : "/";
|
path = *buf ? buf : "/";
|
||||||
#ifdef HAVE_CYGWIN_CONV_PATH
|
#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);
|
bufsize = cygwin_conv_path(flags, path, NULL, 0);
|
||||||
if (bufsize > 0) {
|
if (bufsize > 0) {
|
||||||
bufsize += len;
|
bufsize += len;
|
||||||
@ -3119,7 +3125,6 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char w32buf[MAXPATHLEN];
|
|
||||||
bufsize = MAXPATHLEN;
|
bufsize = MAXPATHLEN;
|
||||||
if (cygwin_conv_to_win32_path(path, w32buf) == 0) {
|
if (cygwin_conv_to_win32_path(path, w32buf) == 0) {
|
||||||
b = w32buf;
|
b = w32buf;
|
||||||
@ -3137,7 +3142,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
}
|
}
|
||||||
*p = '/';
|
*p = '/';
|
||||||
#endif
|
#endif
|
||||||
HANDLE h = FindFirstFile(b, &wfd);
|
h = FindFirstFile(b, &wfd);
|
||||||
if (h != INVALID_HANDLE_VALUE) {
|
if (h != INVALID_HANDLE_VALUE) {
|
||||||
FindClose(h);
|
FindClose(h);
|
||||||
len = strlen(wfd.cFileName);
|
len = strlen(wfd.cFileName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user