[rkward-cvs] rkward/rkward/rbackend rembedinternal.cpp,1.9,1.10
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Fri Apr 15 09:57:04 UTC 2005
Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14246
Modified Files:
rembedinternal.cpp
Log Message:
Should no longer crash on incomplete statements
Index: rembedinternal.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rembedinternal.cpp 10 Oct 2004 14:31:51 -0000 1.9
--- rembedinternal.cpp 15 Apr 2005 09:57:02 -0000 1.10
***************
*** 112,115 ****
--- 112,117 ----
SEXP runCommandInternalBase (const char *command, bool *error) {
// heavy copying from RServe below
+ extern SEXP R_ParseVector(SEXP, int, int*);
+
int maxParts=1;
int r_error = 0;
***************
*** 128,136 ****
while (maxParts>0) {
- extern SEXP R_ParseVector(SEXP, int, int*);
pr=R_ParseVector(cv, maxParts, status);
// 2=incomplete; 4=eof
if (*status!=2 && *status!=4) {
- r_error = 1;
break;
}
--- 130,136 ----
***************
*** 141,146 ****
if (*status == 1) {
PROTECT (pr);
-
exp=R_NilValue;
if (TYPEOF(pr)==EXPRSXP && LENGTH(pr)>0) {
int bi=0;
--- 141,146 ----
if (*status == 1) {
PROTECT (pr);
exp=R_NilValue;
+
if (TYPEOF(pr)==EXPRSXP && LENGTH(pr)>0) {
int bi=0;
***************
*** 160,165 ****
--- 160,170 ----
UNPROTECT(1); /* pr */
+ } else {
+ r_error = 1;
}
+ if (r_error) {
+ exp = R_NilValue;
+ }
*error = (r_error != 0);
return exp;
More information about the rkward-tracker
mailing list