зеркало из https://github.com/github/ruby.git
* dln.c (dln_find_1): removed duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
be8326b2e0
Коммит
5a7c9df5b5
|
@ -1,4 +1,4 @@
|
|||
Mon Nov 23 10:52:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Mon Nov 23 11:26:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dln.c (dln_find_1): removed duplication.
|
||||
|
||||
|
|
7
dln.c
7
dln.c
|
@ -1557,8 +1557,8 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
|
|||
size_t j;
|
||||
int is_abs = 0, has_path = 0;
|
||||
const char *ext = 0;
|
||||
const char *p = fname;
|
||||
#endif
|
||||
const char *p = fname;
|
||||
|
||||
static const char pathname_too_long[] = "openpath: pathname too long (ignored)\n\
|
||||
\tDirectory \"%.*s\"\n\tFile \"%s\"\n";
|
||||
|
@ -1620,10 +1620,11 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
|
|||
memcpy(fbuf, fname, i + 1);
|
||||
goto needs_extension;
|
||||
}
|
||||
p = fname;
|
||||
#endif
|
||||
|
||||
RETURN_IF(fname[0] == '/');
|
||||
RETURN_IF(strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0);
|
||||
if (*p == '.' && *++p == '.') ++p;
|
||||
RETURN_IF(*p == '/');
|
||||
RETURN_IF(exe_flag && strchr(fname, '/'));
|
||||
|
||||
#undef RETURN_IF
|
||||
|
|
Загрузка…
Ссылка в новой задаче