trail_ref cleanup
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@64 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -282,8 +282,7 @@ check_mode(Mode, G) :-
|
||||
|
||||
shell :-
|
||||
G = shell,
|
||||
get_shell(Shell),
|
||||
atom_codes(FullCommand, Shell),
|
||||
get_shell0(FullCommand),
|
||||
exec_command(FullCommand, '$stream'(0),'$stream'(1), '$stream'(2), PID, Error),
|
||||
handle_system_error(Error, off, G),
|
||||
wait(PID, _Status, Error),
|
||||
@@ -313,11 +312,18 @@ shell(Command, Status) :-
|
||||
wait(PID, Status,Error),
|
||||
handle_system_error(Error, off, G).
|
||||
|
||||
get_shell0(Shell) :-
|
||||
getenv('SHELL', Shell), !.
|
||||
get_shell0(Shell) :-
|
||||
win,
|
||||
getenv('COMSPEC', Shell0).
|
||||
|
||||
get_shell(Shell) :-
|
||||
getenv('SHELL', Shell0), !,
|
||||
atom_codes(Shell0, Codes),
|
||||
append(Codes," -c ", Shell).
|
||||
get_shell(Shell) :-
|
||||
win,
|
||||
getenv('COMPSEC', Shell0),
|
||||
atom_codes(Shell0, Codes),
|
||||
append(Codes," /c ", Shell).
|
||||
|
@@ -672,6 +672,16 @@ pid(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
win(void)
|
||||
{
|
||||
#if defined(__MINGW32__) || _MSC_VER
|
||||
return(TRUE);
|
||||
#else
|
||||
return(FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
p_kill(void)
|
||||
{
|
||||
@@ -732,6 +742,7 @@ init_sys(void)
|
||||
UserCPredicate("rename_file", rename_file, 3);
|
||||
UserCPredicate("sleep", p_sleep, 2);
|
||||
UserCPredicate("error_message", error_message, 2);
|
||||
UserCPredicate("win", win, 0);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
Reference in New Issue
Block a user