mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/mkmf.rb (have_library, find_library): configure by library
name. * win32/win32.c (isInternalCmd): distinguish command.com and cmd.exe. * win32/win32.c (make_cmdvector): a character just after wildcard was ignored. [ruby-core:01518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d833e3db01
commit
01e3a55648
3 changed files with 88 additions and 44 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Sat Sep 6 00:00:20 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (have_library, find_library): configure by library
|
||||
name.
|
||||
|
||||
Sat Sep 6 00:00:20 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (isInternalCmd): distinguish command.com and
|
||||
cmd.exe.
|
||||
|
||||
* win32/win32.c (make_cmdvector): a character just after wildcard
|
||||
was ignored. [ruby-core:01518]
|
||||
|
||||
Fri Sep 5 20:27:08 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'
|
||||
|
|
|
@ -456,7 +456,8 @@ end
|
|||
|
||||
def have_library(lib, func = nil, &b)
|
||||
func = "main" if !func or func.empty?
|
||||
checking_for "#{func}() in -l#{lib}" do
|
||||
lib = with_config(lib+'lib', lib)
|
||||
checking_for "#{func}() in #{LIBARG%lib}" do
|
||||
if COMMON_LIBS.include?(lib)
|
||||
true
|
||||
else
|
||||
|
@ -472,7 +473,9 @@ def have_library(lib, func = nil, &b)
|
|||
end
|
||||
|
||||
def find_library(lib, func, *paths, &b)
|
||||
checking_for "#{func}() in -l#{lib}" do
|
||||
func = "main" if !func or func.empty?
|
||||
lib = with_config(lib+'lib', lib)
|
||||
checking_for "#{func}() in #{LIBARG%lib}" do
|
||||
libpath = $LIBPATH
|
||||
libs = append_library($libs, lib)
|
||||
begin
|
||||
|
|
112
win32/win32.c
112
win32/win32.c
|
@ -481,35 +481,62 @@ int SafeFree(char **vec, int vecc)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
ruby -lne 'BEGIN{$cmds = Hash.new(0); $mask = 1}'
|
||||
-e '$cmds[$_.downcase] |= $mask' -e '$mask <<= 1 if ARGF.eof'
|
||||
-e 'END{$cmds.sort.each{|n,f|puts " \"\\#{f.to_s(8)}\" #{n.dump} + 1,"}}'
|
||||
98cmd ntcmd
|
||||
*/
|
||||
static char *szInternalCmds[] = {
|
||||
"append",
|
||||
"break",
|
||||
"call",
|
||||
"cd",
|
||||
"chdir",
|
||||
"cls",
|
||||
"copy",
|
||||
"date",
|
||||
"del",
|
||||
"dir",
|
||||
"echo",
|
||||
"erase",
|
||||
"label",
|
||||
"md",
|
||||
"mkdir",
|
||||
"path",
|
||||
"pause",
|
||||
"rd",
|
||||
"rem",
|
||||
"ren",
|
||||
"rename",
|
||||
"rmdir",
|
||||
"set",
|
||||
"start",
|
||||
"time",
|
||||
"type",
|
||||
"ver",
|
||||
"vol",
|
||||
"\2" "assoc" + 1,
|
||||
"\3" "break" + 1,
|
||||
"\3" "call" + 1,
|
||||
"\3" "cd" + 1,
|
||||
"\1" "chcp" + 1,
|
||||
"\3" "chdir" + 1,
|
||||
"\3" "cls" + 1,
|
||||
"\2" "color" + 1,
|
||||
"\3" "copy" + 1,
|
||||
"\1" "ctty" + 1,
|
||||
"\3" "date" + 1,
|
||||
"\3" "del" + 1,
|
||||
"\3" "dir" + 1,
|
||||
"\3" "echo" + 1,
|
||||
"\2" "endlocal" + 1,
|
||||
"\3" "erase" + 1,
|
||||
"\3" "exit" + 1,
|
||||
"\3" "for" + 1,
|
||||
"\2" "ftype" + 1,
|
||||
"\3" "goto" + 1,
|
||||
"\3" "if" + 1,
|
||||
"\1" "lfnfor" + 1,
|
||||
"\1" "lh" + 1,
|
||||
"\1" "lock" + 1,
|
||||
"\3" "md" + 1,
|
||||
"\3" "mkdir" + 1,
|
||||
"\2" "move" + 1,
|
||||
"\3" "path" + 1,
|
||||
"\3" "pause" + 1,
|
||||
"\2" "popd" + 1,
|
||||
"\3" "prompt" + 1,
|
||||
"\2" "pushd" + 1,
|
||||
"\3" "rd" + 1,
|
||||
"\3" "rem" + 1,
|
||||
"\3" "ren" + 1,
|
||||
"\3" "rename" + 1,
|
||||
"\3" "rmdir" + 1,
|
||||
"\3" "set" + 1,
|
||||
"\2" "setlocal" + 1,
|
||||
"\3" "shift" + 1,
|
||||
"\2" "start" + 1,
|
||||
"\3" "time" + 1,
|
||||
"\2" "title" + 1,
|
||||
"\1" "truename" + 1,
|
||||
"\3" "type" + 1,
|
||||
"\1" "unlock" + 1,
|
||||
"\3" "ver" + 1,
|
||||
"\3" "verify" + 1,
|
||||
"\3" "vol" + 1,
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -519,11 +546,16 @@ internal_match(const void *key, const void *elem)
|
|||
}
|
||||
|
||||
static int
|
||||
isInternalCmd(const char *cmd)
|
||||
isInternalCmd(const char *cmd, const char *interp)
|
||||
{
|
||||
int i;
|
||||
char cmdname[8], *b = cmdname, c;
|
||||
int i, nt = 1;
|
||||
char cmdname[9], *b = cmdname, c, **nm;
|
||||
|
||||
i = strlen(interp) - 11;
|
||||
if ((i == 0 || i > 0 && isdirsep(interp[i])) &&
|
||||
strcasecmp(interp+i, "command.com") == 0) {
|
||||
nt = 0;
|
||||
}
|
||||
do {
|
||||
if (!(c = *cmd++)) return 0;
|
||||
} while (isspace(c));
|
||||
|
@ -542,10 +574,11 @@ isInternalCmd(const char *cmd)
|
|||
return 0;
|
||||
}
|
||||
*b = 0;
|
||||
if (!bsearch(cmdname, szInternalCmds,
|
||||
nm = bsearch(cmdname, szInternalCmds,
|
||||
sizeof(szInternalCmds) / sizeof(*szInternalCmds),
|
||||
sizeof(*szInternalCmds),
|
||||
internal_match))
|
||||
internal_match);
|
||||
if (!nm || !(nm[0][-1] & (nt ? 2 : 1)))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -877,27 +910,23 @@ CreateChild(char *cmd, char *prog, SECURITY_ATTRIBUTES *psa, HANDLE hInput, HAND
|
|||
|
||||
dwCreationFlags = (NORMAL_PRIORITY_CLASS);
|
||||
|
||||
shell = NULL;
|
||||
if (prog) {
|
||||
shell = prog;
|
||||
}
|
||||
else {
|
||||
int redir = -1;
|
||||
if ((shell = getenv("RUBYSHELL")) && (redir = has_redirection(cmd))) {
|
||||
else if (has_redirection(cmd)) {
|
||||
if (shell = getenv("RUBYSHELL")) {
|
||||
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
||||
sizeof (" -c "));
|
||||
sprintf(tmp, "%s -c %s", shell, cmd);
|
||||
cmd = tmp;
|
||||
}
|
||||
else if ((shell = getenv("COMSPEC")) &&
|
||||
((redir < 0 ? has_redirection(cmd) : redir) || isInternalCmd(cmd))) {
|
||||
else if ((shell = getenv("COMSPEC")) && isInternalCmd(cmd, shell)) {
|
||||
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
||||
sizeof (" /c "));
|
||||
sprintf(tmp, "%s /c %s", shell, cmd);
|
||||
cmd = tmp;
|
||||
}
|
||||
else {
|
||||
shell = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
RUBY_CRITICAL({
|
||||
|
@ -1116,7 +1145,6 @@ make_cmdvector(const char *cmd, char ***vec)
|
|||
|
||||
if (quote != '\'')
|
||||
globbing++;
|
||||
ptr++;
|
||||
slashes = 0;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue