fix ! in debugger (execute_clause)
improve system/1 and execute/1 git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1610 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
8
C/exec.c
8
C/exec.c
@@ -42,7 +42,7 @@ cp_as_integer(choiceptr cp)
|
||||
static choiceptr
|
||||
cp_from_integer(Term cpt)
|
||||
{
|
||||
return (choiceptr)(LCL0-(CELL *)IntegerOfTerm(cpt));
|
||||
return (choiceptr)(LCL0-IntegerOfTerm(cpt));
|
||||
}
|
||||
|
||||
Term
|
||||
@@ -82,7 +82,7 @@ CallPredicate(PredEntry *pen, choiceptr cut_pt, yamop *code) {
|
||||
ENV = YENV;
|
||||
YENV = ASP;
|
||||
YENV[E_CB] = (CELL) cut_pt;
|
||||
return (TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline static Int
|
||||
@@ -422,7 +422,7 @@ p_execute_clause(void)
|
||||
{ /* '$execute_clause'(Goal) */
|
||||
Term t = Deref(ARG1);
|
||||
Term mod = Deref(ARG2);
|
||||
choiceptr cp = cp_from_integer(Deref(ARG4));
|
||||
choiceptr cut_cp = cp_from_integer(Deref(ARG4));
|
||||
unsigned int arity;
|
||||
Prop pe;
|
||||
yamop *code;
|
||||
@@ -478,7 +478,7 @@ p_execute_clause(void)
|
||||
} else {
|
||||
code = Yap_ClauseFromTerm(clt)->ClCode;
|
||||
}
|
||||
return CallPredicate(RepPredProp(pe), cp, code);
|
||||
return CallPredicate(RepPredProp(pe), cut_cp, code);
|
||||
}
|
||||
|
||||
static Int
|
||||
|
28
C/sysbits.c
28
C/sysbits.c
@@ -1783,19 +1783,19 @@ p_shell (void)
|
||||
bourne = TRUE;
|
||||
/* Yap_CloseStreams(TRUE); */
|
||||
if (bourne)
|
||||
return (system (RepAtom(AtomOfTerm(t1))->StrOfAE) == 0);
|
||||
return system(RepAtom(AtomOfTerm(t1))->StrOfAE) == 0;
|
||||
else {
|
||||
int status = -1;
|
||||
int child = fork ();
|
||||
if (child == 0)
|
||||
{ /* let the children go */
|
||||
if (!execl (shell, shell, "-c", RepAtom(AtomOfTerm(t1))->StrOfAE , NULL)) {
|
||||
exit(-1);
|
||||
}
|
||||
exit(TRUE);
|
||||
}
|
||||
{ /* put the father on wait */
|
||||
int result = child < 0 ||
|
||||
int status = -1;
|
||||
int child = fork ();
|
||||
|
||||
if (child == 0) { /* let the children go */
|
||||
if (!execl (shell, shell, "-c", RepAtom(AtomOfTerm(t1))->StrOfAE , NULL)) {
|
||||
exit(-1);
|
||||
}
|
||||
exit(TRUE);
|
||||
}
|
||||
{ /* put the father on wait */
|
||||
int result = child < 0 ||
|
||||
/* vsc:I am not sure this is used, Stevens say wait returns an integer.
|
||||
#if NO_UNION_WAIT
|
||||
*/
|
||||
@@ -1815,10 +1815,10 @@ p_shell (void)
|
||||
shell = "msh -i";
|
||||
/* Yap_CloseStreams(); */
|
||||
system (shell);
|
||||
return (TRUE);
|
||||
return TRUE;
|
||||
#else
|
||||
Yap_Error (SYSTEM_ERROR,TermNil,"shell not available in this configuration");
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
#endif
|
||||
#endif /* HAVE_SYSTEM */
|
||||
#endif /* _MSC_VER */
|
||||
|
Reference in New Issue
Block a user